Skip to content
SwapKit is a powerful suite of tools for building blockchain applications.

Using SwapKit Toolboxes

SwapKit toolboxes provide chain-specific utility functions for various blockchain networks. These toolboxes are used by wallet adapters and plugins, but can also be used directly for custom implementations.

SwapKit provides specialized toolboxes for different blockchain ecosystems:

  • EVM Toolbox: For Ethereum, BSC, Arbitrum, Avalanche, Polygon, etc.
  • UTXO Toolbox: For Bitcoin, Litecoin, Dogecoin, etc.
  • Cosmos Toolbox: For ATOM, THORChain, Kujira, etc.
  • Solana Toolbox: For Solana blockchain
  • Substrate Toolbox: For Polkadot, Chainflip, etc.
  • Radix Toolbox: For Radix ecosystem

Each toolbox can be imported individually, which is preferred for frontend applications to minimize bundle size.

You can initialize a toolbox either by importing specific toolbox methods like getEvmToolbox or getUtxoToolbox or by common toolbox method getToolbox.

import { enum ChainChain } from "@swapkit/helpers";
import { 
function getEvmToolbox<T extends EVMChain>(chain: T, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
} from "@swapkit/toolboxes/evm";
import {
function getUtxoToolbox<T extends keyof UTXOToolboxes>(chain: T, params?: UtxoToolboxParams[T] | {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
}): Promise<UTXOToolboxes[T]>
getUtxoToolbox
} from "@swapkit/toolboxes/utxo";
const
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
= await
getEvmToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum);
const
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
= await
getUtxoToolbox<Chain.Bitcoin>(chain: Chain.Bitcoin, params?: {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
} | {
    signer: ChainSigner<Psbt, Psbt>;
} | undefined): Promise<...>
getUtxoToolbox
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);

or

import { enum ChainChain } from "@swapkit/helpers";
import { function getToolbox<T extends Chain.Radix | Chain.Ripple | Chain.Solana | EVMChain | UTXOChain | CosmosChain | SubstrateChain>(chain: T, params?: ToolboxParams[T]): Promise<Toolboxes[T]>getToolbox } from "@swapkit/toolboxes";

const 
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
= await
getToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams | undefined): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum);
const
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
} | {
    ...;
}
btcToolbox
= await
getToolbox<Chain.Bitcoin>(chain: Chain.Bitcoin, params?: undefined): Promise<{
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
} | {
    ...;
}>
getToolbox
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);
import { enum ChainChain } from "@swapkit/helpers";
import { 
function getEvmToolbox<T extends EVMChain>(chain: T, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
, function getProvider(chain: EVMChain, customUrl?: string): Promise<ethers.JsonRpcProvider>getProvider } from "@swapkit/toolboxes/evm";
import { import ethersethers } from "ethers"; // Get a toolbox for a specific EVM chain const
const ethereumToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethereumToolbox
= await
getEvmToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum);
const const provider: ethers.JsonRpcProviderprovider = await function getProvider(chain: EVMChain, customUrl?: string): Promise<ethers.JsonRpcProvider>getProvider(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum); // With a signer (for transactions) const const signer: ethers.Walletsigner = new import ethersethers.
new Wallet(key: string | ethers.SigningKey, provider?: null | ethers.Provider): ethers.Wallet
export Wallet
Create a new wallet for the private %%key%%, optionally connected to %%provider%%.
Wallet
("your-private-key-here", const provider: ethers.JsonRpcProviderprovider);
const
const signingToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
signingToolbox
= await
getEvmToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, {
// You can provide a custom provider & signer // provider: getProvider(Chain.Ethereum), signer?: (ChainSigner<EVMTransferParams, string> & ethers.Signer) | ethers.JsonRpcSigner | undefinedsigner, });
import { enum ChainChain } from "@swapkit/helpers";
import { 
function evmValidateAddress({ address }: {
    address: string;
}): boolean
evmValidateAddress
} from "@swapkit/toolboxes/evm";
// Validate an Ethereum address | true or false const const isValidAddress: booleanisValidAddress =
function evmValidateAddress({ address }: {
    address: string;
}): boolean
evmValidateAddress
({
address: stringaddress: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", });
import { class AssetValueAssetValue, enum ChainChain, enum FeeOptionFeeOption } from "@swapkit/helpers";
import { 
function getEvmToolbox<T extends EVMChain>(chain: T, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
, function getProvider(chain: EVMChain, customUrl?: string): Promise<ethers.JsonRpcProvider>getProvider } from "@swapkit/toolboxes/evm";
import { import ethersethers } from "ethers"; async function function transferTokens(): Promise<string>transferTokens() { // Create a signer const const provider: ethers.JsonRpcProviderprovider = await function getProvider(chain: EVMChain, customUrl?: string): Promise<ethers.JsonRpcProvider>getProvider(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum); const const signer: ethers.Walletsigner = new import ethersethers.
new Wallet(key: string | ethers.SigningKey, provider?: null | ethers.Provider): ethers.Wallet
export Wallet
Create a new wallet for the private %%key%%, optionally connected to %%provider%%.
Wallet
("your-private-key", const provider: ethers.JsonRpcProviderprovider);
// Create a toolbox with signer const
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<AssetValue>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
= await
getEvmToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, {
provider?: ethers.BrowserProvider | ethers.JsonRpcProvider | undefinedprovider, signer?: (ChainSigner<EVMTransferParams, string> & ethers.Signer) | ethers.JsonRpcSigner | undefinedsigner }); // ERC20 token transfer (USDC) const const tokenAmount: AssetValuetokenAmount = class AssetValueAssetValue.
AssetValue.from<{
    chain: Chain.Ethereum;
    symbol: string;
    address: string;
    value: string;
}>({ value, fromBaseDecimal, asyncTokenLookup, ...fromAssetOrChain }: {
    chain: Chain.Ethereum;
    symbol: string;
    address: string;
    value: string;
} & AssetValueFromParams): AssetValue
from
({
chain: Chain.Ethereumchain: enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, symbol: stringsymbol: "USDC", address: stringaddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC contract value: stringvalue: "10", // 10 USDC }); // Transfer the tokens const const txHash: stringtxHash = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<AssetValue>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, ...tx }: EVMTransferParams) => Promise<string>transfer({
assetValue: AssetValueassetValue: const tokenAmount: AssetValuetokenAmount, recipient: stringrecipient: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", from: const signer: ethers.Walletsigner.BaseWallet.address: string
The wallet address.
address
,
Object literal may only specify known properties, and 'from' does not exist in type 'EVMTransferParams'.
feeOptionKey?: FeeOption | undefinedfeeOptionKey: enum FeeOptionFeeOption.function (enum member) FeeOption.Fast = "fast"Fast, }); return const txHash: stringtxHash; }
import { enum ChainChain } from "@swapkit/helpers";
import { 
const erc20ABI: ({
    inputs: never[];
    stateMutability: string;
    type: string;
    anonymous?: undefined;
    name?: undefined;
    outputs?: undefined;
} | {
    anonymous: boolean;
    inputs: {
        indexed: boolean;
        internalType: string;
        name: string;
        type: string;
    }[];
    name: string;
    type: string;
    stateMutability?: undefined;
    outputs?: undefined;
} | {
    ...;
})[]
erc20ABI
} from "@swapkit/helpers/contracts";
import {
function getEvmToolbox<T extends EVMChain>(chain: T, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
, function getProvider(chain: EVMChain, customUrl?: string): Promise<ethers.JsonRpcProvider>getProvider } from "@swapkit/toolboxes/evm";
import { import ethersethers } from "ethers"; async function
function interactWithContract(): Promise<{
    name: string;
    balance: string;
    transferTx: string;
}>
interactWithContract
() {
// Create a signer const const provider: ethers.JsonRpcProviderprovider = await function getProvider(chain: EVMChain, customUrl?: string): Promise<ethers.JsonRpcProvider>getProvider(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum); const const signer: ethers.Walletsigner = new import ethersethers.
new Wallet(key: string | ethers.SigningKey, provider?: null | ethers.Provider): ethers.Wallet
export Wallet
Create a new wallet for the private %%key%%, optionally connected to %%provider%%.
Wallet
("your-private-key", const provider: ethers.JsonRpcProviderprovider);
// Create a toolbox with signer const
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
= await
getEvmToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, {
provider?: ethers.BrowserProvider | ethers.JsonRpcProvider | undefinedprovider, signer?: (ChainSigner<EVMTransferParams, string> & ethers.Signer) | ethers.JsonRpcSigner | undefinedsigner }); // USDC contract address const const contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"contractAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; // Read-only call (no signer needed) const const tokenName: stringtokenName = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.call: <string>({ callProvider, contractAddress, abi, funcName, funcParams, txOverrides, feeOption, }: CallParams) => Promise<string>
@infocall contract function When using this method to make a non state changing call to the blockchain, like a isApproved call, the signer needs to be set to undefined
call
<string>({
contractAddress: stringcontractAddress, abi: readonly ethers.JsonFragment[]abi:
const erc20ABI: ({
    inputs: never[];
    stateMutability: string;
    type: string;
    anonymous?: undefined;
    name?: undefined;
    outputs?: undefined;
} | {
    anonymous: boolean;
    inputs: {
        indexed: boolean;
        internalType: string;
        name: string;
        type: string;
    }[];
    name: string;
    type: string;
    stateMutability?: undefined;
    outputs?: undefined;
} | {
    ...;
})[]
erc20ABI
,
funcName: stringfuncName: "name", }); // Get balance const const balance: numberbalance = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.call: <number>({ callProvider, contractAddress, abi, funcName, funcParams, txOverrides, feeOption, }: CallParams) => Promise<number>
@infocall contract function When using this method to make a non state changing call to the blockchain, like a isApproved call, the signer needs to be set to undefined
call
<number>({
contractAddress: stringcontractAddress, abi: readonly ethers.JsonFragment[]abi:
const erc20ABI: ({
    inputs: never[];
    stateMutability: string;
    type: string;
    anonymous?: undefined;
    name?: undefined;
    outputs?: undefined;
} | {
    anonymous: boolean;
    inputs: {
        indexed: boolean;
        internalType: string;
        name: string;
        type: string;
    }[];
    name: string;
    type: string;
    stateMutability?: undefined;
    outputs?: undefined;
} | {
    ...;
})[]
erc20ABI
,
funcName: stringfuncName: "balanceOf", funcParams?: unknown[] | undefinedfuncParams: [const signer: ethers.Walletsigner.BaseWallet.address: string
The wallet address.
address
],
}); // Get decimals const const decimals: numberdecimals = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.call: <number>({ callProvider, contractAddress, abi, funcName, funcParams, txOverrides, feeOption, }: CallParams) => Promise<number>
@infocall contract function When using this method to make a non state changing call to the blockchain, like a isApproved call, the signer needs to be set to undefined
call
<number>({
contractAddress: stringcontractAddress, abi: readonly ethers.JsonFragment[]abi:
const erc20ABI: ({
    inputs: never[];
    stateMutability: string;
    type: string;
    anonymous?: undefined;
    name?: undefined;
    outputs?: undefined;
} | {
    anonymous: boolean;
    inputs: {
        indexed: boolean;
        internalType: string;
        name: string;
        type: string;
    }[];
    name: string;
    type: string;
    stateMutability?: undefined;
    outputs?: undefined;
} | {
    ...;
})[]
erc20ABI
,
funcName: stringfuncName: "decimals", }); // Format the balance const const formattedBalance: stringformattedBalance = import ethersethers.
function formatUnits(value: ethers.BigNumberish, unit?: string | ethers.Numeric): string
export formatUnits
Converts %%value%% into a //decimal string//, assuming %%unit%% decimal places. The %%unit%% may be the number of decimal places or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
formatUnits
(const balance: numberbalance, const decimals: numberdecimals);
// Contract write operation (requires signer) const const transferResult: stringtransferResult = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.call: <string>({ callProvider, contractAddress, abi, funcName, funcParams, txOverrides, feeOption, }: CallParams) => Promise<string>
@infocall contract function When using this method to make a non state changing call to the blockchain, like a isApproved call, the signer needs to be set to undefined
call
<string>({
contractAddress: stringcontractAddress, abi: readonly ethers.JsonFragment[]abi:
const erc20ABI: ({
    inputs: never[];
    stateMutability: string;
    type: string;
    anonymous?: undefined;
    name?: undefined;
    outputs?: undefined;
} | {
    anonymous: boolean;
    inputs: {
        indexed: boolean;
        internalType: string;
        name: string;
        type: string;
    }[];
    name: string;
    type: string;
    stateMutability?: undefined;
    outputs?: undefined;
} | {
    ...;
})[]
erc20ABI
,
funcName: stringfuncName: "transfer", funcParams?: unknown[] | undefinedfuncParams: [ "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", import ethersethers.
function parseUnits(value: string, unit?: string | ethers.Numeric): bigint
export parseUnits
Converts the //decimal string// %%value%% to a BigInt, assuming %%unit%% decimal places. The %%unit%% may the number of decimal places or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
parseUnits
("1.0", const decimals: numberdecimals),
], }); return { name: stringname: const tokenName: stringtokenName, balance: stringbalance: const formattedBalance: stringformattedBalance, transferTx: stringtransferTx: const transferResult: stringtransferResult, }; }
import { enum ChainChain, enum FeeOptionFeeOption } from "@swapkit/helpers";
import { 
function getEvmToolbox<T extends EVMChain>(chain: T, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
} from "@swapkit/toolboxes/evm";
import { import ethersethers } from "ethers"; async function
function estimateFees(): Promise<{
    fast: any;
    average: any;
}>
estimateFees
() {
const
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<AssetValue>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
= await
getEvmToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum);
// Transaction to estimate const
const transaction: {
    to: string;
    from: string;
    value: bigint;
    data: string;
    chain: Chain.Ethereum;
}
transaction
= {
to: stringto: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", from: stringfrom: "0x8C8D7C46219D9205f056f28Fee5950aD564d7465", value: bigintvalue: import ethersethers.
function parseEther(ether: string): bigint
export parseEther
Converts the //decimal string// %%ether%% to a BigInt, using 18 decimal places.
parseEther
("0.01"),
data: stringdata: "0x", chain: Chain.Ethereumchain: enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum as type const = Chain.Ethereumconst, }; // Estimate with different fee options const const fastFee: anyfastFee = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<AssetValue>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.estimateTransactionFee({
Property 'estimateTransactionFee' does not exist on type '{ estimateTransactionFee: ({ feeOption, chain, ...txObject }: EVMTxBaseParams<bigint> & { type?: number | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; } & { ...; }) => Promise<...>; ... 20 more ...; validateAddress: (address: string) => boolean; } | { ...; } | { ...; }'. Property 'estimateTransactionFee' does not exist on type '{ estimateL1Gas: (tx: TransactionRequest) => Promise<any>; estimateL1GasCost: (tx: TransactionRequest) => Promise<any>; ... 23 more ...; validateAddress: (address: string) => boolean; }'.
...
const transaction: {
    to: string;
    from: string;
    value: bigint;
    data: string;
    chain: Chain.Ethereum;
}
transaction
,
feeOption: FeeOptionfeeOption: enum FeeOptionFeeOption.function (enum member) FeeOption.Fast = "fast"Fast, }); const const averageFee: anyaverageFee = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<AssetValue>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.estimateTransactionFee({
Property 'estimateTransactionFee' does not exist on type '{ estimateTransactionFee: ({ feeOption, chain, ...txObject }: EVMTxBaseParams<bigint> & { type?: number | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; } & { ...; }) => Promise<...>; ... 20 more ...; validateAddress: (address: string) => boolean; } | { ...; } | { ...; }'. Property 'estimateTransactionFee' does not exist on type '{ estimateL1Gas: (tx: TransactionRequest) => Promise<any>; estimateL1GasCost: (tx: TransactionRequest) => Promise<any>; ... 23 more ...; validateAddress: (address: string) => boolean; }'.
...
const transaction: {
    to: string;
    from: string;
    value: bigint;
    data: string;
    chain: Chain.Ethereum;
}
transaction
,
feeOption: FeeOptionfeeOption: enum FeeOptionFeeOption.function (enum member) FeeOption.Average = "average"Average, }); return { fast: anyfast: const fastFee: anyfastFee.toString(), average: anyaverage: const averageFee: anyaverageFee.toString(), }; }
import { enum ChainChain } from "@swapkit/helpers";
import { 
function getUtxoToolbox<T extends keyof UTXOToolboxes>(chain: T, params?: UtxoToolboxParams[T] | {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
}): Promise<UTXOToolboxes[T]>
getUtxoToolbox
} from "@swapkit/toolboxes/utxo";
// Initialize the Bitcoin toolbox async function
function setupBitcoinToolbox(): Promise<{
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}>
setupBitcoinToolbox
() {
const
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
= await
getUtxoToolbox<Chain.Bitcoin>(chain: Chain.Bitcoin, params?: {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
} | {
    signer: ChainSigner<Psbt, Psbt>;
} | undefined): Promise<...>
getUtxoToolbox
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);
return
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
;
}
import { enum ChainChain } from "@swapkit/helpers";
import { 
function getUtxoToolbox<T extends keyof UTXOToolboxes>(chain: T, params?: UtxoToolboxParams[T] | {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
}): Promise<UTXOToolboxes[T]>
getUtxoToolbox
} from "@swapkit/toolboxes/utxo";
async function
function bitcoinKeysAndAddresses(): Promise<{
    address: string;
    isValid: boolean;
}>
bitcoinKeysAndAddresses
() {
const
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
= await
getUtxoToolbox<Chain.Bitcoin>(chain: Chain.Bitcoin, params?: {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
} | {
    signer: ChainSigner<Psbt, Psbt>;
} | undefined): Promise<...>
getUtxoToolbox
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);
// Create keys from a mnemonic phrase const const keys: ECPairInterfacekeys = await
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.
createKeysForPath: (params: {
    wif?: string;
    phrase?: string;
    derivationPath?: string;
}) => ECPairInterface
createKeysForPath
({
phrase?: string | undefinedphrase: "your twelve word mnemonic phrase here ...", derivationPath?: string | undefinedderivationPath: "m/84'/0'/0'/0/0", // BIP84 for native segwit }); // Get address from keys const const address: stringaddress =
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.getAddressFromKeys: (keys: ECPairInterface | BchECPair) => stringgetAddressFromKeys(const keys: ECPairInterfacekeys);
// Validate an address const const isValid: booleanisValid =
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.validateAddress: (address: string) => booleanvalidateAddress("bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq");
return { address: stringaddress, isValid: booleanisValid }; }
import { class AssetValueAssetValue, enum ChainChain, enum FeeOptionFeeOption } from "@swapkit/helpers";
import { 
function getUtxoToolbox<T extends keyof UTXOToolboxes>(chain: T, params?: UtxoToolboxParams[T] | {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
}): Promise<UTXOToolboxes[T]>
getUtxoToolbox
} from "@swapkit/toolboxes/utxo";
async function
function createBitcoinTransaction(): Promise<{
    txHex: any;
}>
createBitcoinTransaction
() {
const
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
= await
getUtxoToolbox<Chain.Bitcoin>(chain: Chain.Bitcoin, params?: {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
} | {
    signer: ChainSigner<Psbt, Psbt>;
} | undefined): Promise<...>
getUtxoToolbox
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);
// Create keys from a mnemonic phrase const const keys: ECPairInterfacekeys = await
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.
createKeysForPath: (params: {
    wif?: string;
    phrase?: string;
    derivationPath?: string;
}) => ECPairInterface
createKeysForPath
({
phrase?: string | undefinedphrase: "your twelve word mnemonic phrase here ...", derivationPath?: string | undefinedderivationPath: "m/84'/0'/0'/0/0", }); const const fromAddress: stringfromAddress =
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.getAddressFromKeys: (keys: ECPairInterface | BchECPair) => stringgetAddressFromKeys(const keys: ECPairInterfacekeys);
// Create a function to sign transactions async function
function (local function) signTransaction({ builder, utxos }: {
    builder: any;
    utxos: any[];
}): Promise<any>
signTransaction
({ builder: anybuilder, utxos: any[]utxos }: { builder: anybuilder: any, utxos: any[]utxos: any[] }) {
utxos: any[]utxos.Array<any>.forEach(callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any): void
Performs the specified action for each element in an array.
@paramcallbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.@paramthisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
forEach
((utxo: anyutxo, index: numberindex) => {
builder: anybuilder.sign(index: numberindex, const keys: ECPairInterfacekeys); }); return builder: anybuilder.build(); } // Get fee rates based on desired confirmation speed const const feeRate: numberfeeRate = (await
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.
getFeeRates: () => Promise<{
    average: number;
    fast: number;
    fastest: number;
}>
getFeeRates
()).[FeeOption.Average]: numberaverage
// Build a transaction const { psbt: const builder: anybuilder, const utxos: anyutxos } = await
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.buildTx({
Property 'buildTx' does not exist on type '{ accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & { outputs: TargetOutput[]; chain: UTXOChain; }) => { inputs: (UTXOType | UTXOInputWithScriptType)[]; outputs: TargetOutput[]; fee: number; } | { ...; }; ... 13 more ...; estimateMaxSendableAmount: ({ from, memo, feeRat...'.
recipient: stringrecipient: "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", feeRate: numberfeeRate, assetValue: AssetValueassetValue: class AssetValueAssetValue.
AssetValue.from<{
    chain: Chain.Bitcoin;
    value: string;
}>({ value, fromBaseDecimal, asyncTokenLookup, ...fromAssetOrChain }: {
    chain: Chain.Bitcoin;
    value: string;
} & AssetValueFromParams): AssetValue
from
({ chain: Chain.Bitcoinchain: enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin, value: stringvalue: "0.0001" }),
sender: stringsender: const fromAddress: stringfromAddress, memo: stringmemo: "Test transaction", }); // Sign the transaction const const signedTx: anysignedTx = await
function (local function) signTransaction({ builder, utxos }: {
    builder: any;
    utxos: any[];
}): Promise<any>
signTransaction
({ builder: anybuilder, utxos: any[]utxos });
// Get the raw transaction hex const const txHex: anytxHex = const signedTx: anysignedTx.toHex(); // To broadcast (send) the transaction: // const txHash = await btcToolbox.broadcastTransaction(txHex); return { txHex: anytxHex, // Once broadcast: txHash }; }
import { enum ChainChain } from "@swapkit/helpers";
import { 
function getUtxoToolbox<T extends keyof UTXOToolboxes>(chain: T, params?: UtxoToolboxParams[T] | {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
}): Promise<UTXOToolboxes[T]>
getUtxoToolbox
} from "@swapkit/toolboxes/utxo";
async function
function getUtxoData(): Promise<{
    balance: AssetValue[];
    feeRates: {
        average: number;
        fast: number;
        fastest: number;
    };
}>
getUtxoData
() {
const
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
= await
getUtxoToolbox<Chain.Bitcoin>(chain: Chain.Bitcoin, params?: {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
} | {
    signer: ChainSigner<Psbt, Psbt>;
} | undefined): Promise<...>
getUtxoToolbox
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);
// Get balance for an address const const address: "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"address = "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"; const const balance: AssetValue[]balance = await
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.getBalance: (address: string, scamFilter?: boolean) => Promise<AssetValue[]>getBalance(const address: "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"address);
// Calculate optimal fee const
const feeRates: {
    average: number;
    fast: number;
    fastest: number;
}
feeRates
= await
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.
getFeeRates: () => Promise<{
    average: number;
    fast: number;
    fastest: number;
}>
getFeeRates
();
return { balance: AssetValue[]balance,
feeRates: {
    average: number;
    fast: number;
    fastest: number;
}
feeRates
};
}
import { enum ChainChain } from "@swapkit/helpers";
import { const getCosmosToolbox: <T extends CosmosChain>(chain: T, params?: Omit<CosmosToolboxParams, "chain">) => CosmosToolboxes[T]getCosmosToolbox } from "@swapkit/toolboxes/cosmos";

// Initialize a Cosmos toolbox
function 
function initCosmosToolbox(): {
    cosmosToolbox: Promise<{
        transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>;
        getAddress: () => Promise<string>;
        ... 11 more ...;
        verifySignature: ({ signature, message, address, }: {
            signature: string;
            message: string;
            address: string;
        }) => Promise<...>;
    }>;
    thorchainToolbox: Promise<...>;
}
initCosmosToolbox
() {
// For Cosmos Hub (ATOM) const
const cosmosToolbox: Promise<{
    transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>;
    getAddress: () => Promise<string>;
    getAccount: (address: string) => Promise<...>;
    ... 10 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
cosmosToolbox
=
getCosmosToolbox<Chain.Cosmos>(chain: Chain.Cosmos, params?: Omit<CosmosToolboxParams, "chain">): Promise<{
    transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<...>;
    ... 12 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
getCosmosToolbox
(enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos);
// For THORChain const
const thorchainToolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
thorchainToolbox
=
getCosmosToolbox<Chain.THORChain>(chain: Chain.THORChain, params?: Omit<CosmosToolboxParams, "chain">): Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
getCosmosToolbox
(enum ChainChain.function (enum member) Chain.THORChain = "THOR"THORChain);
return {
cosmosToolbox: Promise<{
    transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>;
    getAddress: () => Promise<string>;
    getAccount: (address: string) => Promise<...>;
    ... 10 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
cosmosToolbox
,
thorchainToolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
thorchainToolbox
};
}
import { class AssetValueAssetValue, enum ChainChain, enum FeeOptionFeeOption } from "@swapkit/helpers";
import { const getCosmosToolbox: <T extends CosmosChain>(chain: T, params?: Omit<CosmosToolboxParams, "chain">) => CosmosToolboxes[T]getCosmosToolbox, TransferParams } from "@swapkit/toolboxes/cosmos";
Module '"@swapkit/toolboxes/cosmos"' has no exported member 'TransferParams'.
async function
function createThorchainWallet(): Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
createThorchainWallet
() {
const
const toolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
toolbox
=
getCosmosToolbox<Chain.THORChain>(chain: Chain.THORChain, params?: Omit<CosmosToolboxParams, "chain">): Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
getCosmosToolbox
(enum ChainChain.function (enum member) Chain.THORChain = "THOR"THORChain);
const const phrase: "your twelve word mnemonic phrase here"phrase = "your twelve word mnemonic phrase here"; const const signer: anysigner = await
const toolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
toolbox
.getSigner(const phrase: "your twelve word mnemonic phrase here"phrase);
Property 'getSigner' does not exist on type 'Promise<{ broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array<ArrayBufferLike>) => Promise<...>; ... 26 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }>'.
const const address: anyaddress = await
const toolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
toolbox
.getAddressFromMnemonic(const phrase: "your twelve word mnemonic phrase here"phrase);
Property 'getAddressFromMnemonic' does not exist on type 'Promise<{ broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array<ArrayBufferLike>) => Promise<...>; ... 26 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }>'.
return { ...
const toolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
toolbox
,
address: anyaddress, transfer: (params: TransferParams) => anytransfer: (params: TransferParamsparams: import TransferParamsTransferParams) =>
const toolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
toolbox
.transfer({ ...params: TransferParamsparams, from: anyfrom: const address: anyaddress, signer: anysigner }),
Property 'transfer' does not exist on type 'Promise<{ broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array<ArrayBufferLike>) => Promise<...>; ... 26 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }>'.
signMessage: (message: string) => Promise<any>signMessage: async (message: stringmessage: string) => { const const privateKey: anyprivateKey = await
const toolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
toolbox
.createPrivateKeyFromPhrase(const phrase: "your twelve word mnemonic phrase here"phrase);
Property 'createPrivateKeyFromPhrase' does not exist on type 'Promise<{ broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array<ArrayBufferLike>) => Promise<...>; ... 26 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }>'.
return
const toolbox: Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
toolbox
.signWithPrivateKey({ privateKey: anyprivateKey, message: stringmessage });
Property 'signWithPrivateKey' does not exist on type 'Promise<{ broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array<ArrayBufferLike>) => Promise<...>; ... 26 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }>'.
}, }; } const
const wallet: {
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<string>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}
wallet
= await
function createThorchainWallet(): Promise<{
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<...>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
createThorchainWallet
();
const const tx: stringtx = await
const wallet: {
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<string>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}
wallet
.
transfer: ({ assetValue, memo, recipient, }: Omit<GenericTransferParams, "recipient"> & {
    recipient?: string;
}) => Promise<string>
transfer
({
recipient?: string | undefinedrecipient: "cosmos1abcd1234abcd1234abcd1234abcd1234abcd12", assetValue: AssetValueassetValue: class AssetValueAssetValue.
AssetValue.from<{
    chain: Chain.THORChain;
    value: string;
}>({ value, fromBaseDecimal, asyncTokenLookup, ...fromAssetOrChain }: {
    chain: Chain.THORChain;
    value: string;
} & AssetValueFromParams): AssetValue
from
({ chain: Chain.THORChainchain: enum ChainChain.function (enum member) Chain.THORChain = "THOR"THORChain, value: stringvalue: "0.1" }),
from:
const wallet: {
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<string>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}
wallet
.address,
Property 'address' does not exist on type '{ broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array<ArrayBufferLike>) => Promise<...>; ... 26 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }'.
Object literal may only specify known properties, and 'from' does not exist in type 'Omit<GenericTransferParams, "recipient"> & { recipient?: string | undefined; }'.
feeOptionKey?: FeeOption | undefinedfeeOptionKey: enum FeeOptionFeeOption.function (enum member) FeeOption.Average = "average"Average, }); const const signedMessage: anysignedMessage = await
const wallet: {
    broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array) => Promise<string>;
    ... 26 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}
wallet
.signMessage("Hello, world!");
Property 'signMessage' does not exist on type '{ broadcastMultisigTx: (tx: string, signers: MultiSigSigner[], membersPubKeys: string[], threshold: number, bodyBytes: Uint8Array<ArrayBufferLike>) => Promise<...>; ... 26 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }'.
import { enum ChainChain } from "@swapkit/helpers";
import { const getCosmosToolbox: <T extends CosmosChain>(chain: T, params?: Omit<CosmosToolboxParams, "chain">) => CosmosToolboxes[T]getCosmosToolbox } from "@swapkit/toolboxes/cosmos";

async function 
function cosmosBalances(): Promise<{
    balances: any;
    accountInfo: any;
}>
cosmosBalances
() {
const
const cosmosToolbox: Promise<{
    transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>;
    getAddress: () => Promise<string>;
    getAccount: (address: string) => Promise<...>;
    ... 10 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
cosmosToolbox
=
getCosmosToolbox<Chain.Cosmos>(chain: Chain.Cosmos, params?: Omit<CosmosToolboxParams, "chain">): Promise<{
    transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<...>;
    ... 12 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
getCosmosToolbox
(enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos);
// Get balance for an address const const address: "cosmos1abcd1234abcd1234abcd1234abcd1234abcd12"address = "cosmos1abcd1234abcd1234abcd1234abcd1234abcd12"; const const balances: anybalances = await
const cosmosToolbox: Promise<{
    transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>;
    getAddress: () => Promise<string>;
    getAccount: (address: string) => Promise<...>;
    ... 10 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
cosmosToolbox
.getBalance(const address: "cosmos1abcd1234abcd1234abcd1234abcd1234abcd12"address);
Property 'getBalance' does not exist on type 'Promise<{ transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>; getAddress: () => Promise<string>; getAccount: (address: string) => Promise<Account | null>; ... 10 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }>'.
// Get account information const const accountInfo: anyaccountInfo = await
const cosmosToolbox: Promise<{
    transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>;
    getAddress: () => Promise<string>;
    getAccount: (address: string) => Promise<...>;
    ... 10 more ...;
    verifySignature: ({ signature, message, address, }: {
        signature: string;
        message: string;
        address: string;
    }) => Promise<...>;
}>
cosmosToolbox
.getAccount(const address: "cosmos1abcd1234abcd1234abcd1234abcd1234abcd12"address);
Property 'getAccount' does not exist on type 'Promise<{ transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>; getAddress: () => Promise<string>; getAccount: (address: string) => Promise<Account | null>; ... 10 more ...; verifySignature: ({ signature, message, address, }: { ...; }) => Promise<...>; }>'.
return { balances: anybalances, accountInfo: anyaccountInfo }; }
import { 
function getSolanaToolbox(toolboxParams?: {
    signer?: SolanaSigner;
} | {
    phrase?: string;
    index?: number;
    derivationPath?: DerivationPathArray;
}): Promise<...>
getSolanaToolbox
} from "@swapkit/toolboxes/solana";
// Initialize Solana toolbox function
function initSolanaToolbox(): Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
initSolanaToolbox
() {
const
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
=
function getSolanaToolbox(toolboxParams?: {
    signer?: SolanaSigner;
} | {
    phrase?: string;
    index?: number;
    derivationPath?: DerivationPathArray;
}): Promise<...>
getSolanaToolbox
();
return
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
;
}
import { 
function getSolanaToolbox(toolboxParams?: {
    signer?: SolanaSigner;
} | {
    phrase?: string;
    index?: number;
    derivationPath?: DerivationPathArray;
}): Promise<...>
getSolanaToolbox
} from "@swapkit/toolboxes/solana";
async function
function solanaKeysAndAddresses(): Promise<{
    address: any;
    keypair: any;
}>
solanaKeysAndAddresses
() {
const
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
=
function getSolanaToolbox(toolboxParams?: {
    signer?: SolanaSigner;
} | {
    phrase?: string;
    index?: number;
    derivationPath?: DerivationPathArray;
}): Promise<...>
getSolanaToolbox
();
// Generate a keypair from a mnemonic phrase const const keypair: anykeypair = await
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
.createKeysForPath({
Property 'createKeysForPath' does not exist on type 'Promise<{ getConnection: () => Promise<Connection>; getAddress: () => string; createKeysForPath: ({ phrase, derivationPath, }: { phrase: string; derivationPath?: string | undefined; }) => Promise<Keypair>; ... 9 more ...; estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omi...'.
phrase: stringphrase: "your twelve word mnemonic phrase here", derivationPath: stringderivationPath: "m/44'/501'/0'/0'", // Standard Solana derivation path }); // Get the address from the keypair const const address: anyaddress =
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
.getAddressFromKeys(const keypair: anykeypair);
Property 'getAddressFromKeys' does not exist on type 'Promise<{ getConnection: () => Promise<Connection>; getAddress: () => string; createKeysForPath: ({ phrase, derivationPath, }: { phrase: string; derivationPath?: string | undefined; }) => Promise<Keypair>; ... 9 more ...; estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omi...'.
return { address: anyaddress, keypair: anykeypair }; }
import { class AssetValueAssetValue, enum ChainChain } from "@swapkit/helpers";
import { 
function getSolanaToolbox(toolboxParams?: {
    signer?: SolanaSigner;
} | {
    phrase?: string;
    index?: number;
    derivationPath?: DerivationPathArray;
}): Promise<...>
getSolanaToolbox
} from "@swapkit/toolboxes/solana";
async function function solanaTransfer(): Promise<any>solanaTransfer() { const
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
=
function getSolanaToolbox(toolboxParams?: {
    signer?: SolanaSigner;
} | {
    phrase?: string;
    index?: number;
    derivationPath?: DerivationPathArray;
}): Promise<...>
getSolanaToolbox
();
// Generate a keypair from a mnemonic const const keypair: anykeypair = await
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
.createKeysForPath({
Property 'createKeysForPath' does not exist on type 'Promise<{ getConnection: () => Promise<Connection>; getAddress: () => string; createKeysForPath: ({ phrase, derivationPath, }: { phrase: string; derivationPath?: string | undefined; }) => Promise<Keypair>; ... 9 more ...; estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omi...'.
phrase: stringphrase: "your twelve word mnemonic phrase here", derivationPath: stringderivationPath: "m/44'/501'/0'/0'", }); // Amount to transfer const const amount: AssetValueamount = class AssetValueAssetValue.
AssetValue.from<{
    chain: Chain.Solana;
    symbol: string;
    value: string;
}>({ value, fromBaseDecimal, asyncTokenLookup, ...fromAssetOrChain }: {
    chain: Chain.Solana;
    symbol: string;
    value: string;
} & AssetValueFromParams): AssetValue
from
({
chain: Chain.Solanachain: enum ChainChain.function (enum member) Chain.Solana = "SOL"Solana, symbol: stringsymbol: "SOL", value: stringvalue: "0.01", // 0.01 SOL }); // Transfer SOL try { const const txHash: anytxHash = await
const solanaToolbox: Promise<{
    getConnection: () => Promise<Connection>;
    getAddress: () => string;
    createKeysForPath: ({ phrase, derivationPath, }: {
        phrase: string;
        derivationPath?: string;
    }) => Promise<Keypair>;
    ... 9 more ...;
    estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omit<GenericCreateTransactionParams, "feeRate"> & {
        isProgramDerivedAddress?: boolean;
    }) => Promise<...>;
}>
solanaToolbox
.transfer({
Property 'transfer' does not exist on type 'Promise<{ getConnection: () => Promise<Connection>; getAddress: () => string; createKeysForPath: ({ phrase, derivationPath, }: { phrase: string; derivationPath?: string | undefined; }) => Promise<Keypair>; ... 9 more ...; estimateTransactionFee: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, }: Omi...'.
assetValue: AssetValueassetValue: const amount: AssetValueamount, recipient: stringrecipient: "ASfS6nSsF1JW76EBKsHuAj1ypBGZz6uhLSJ5QBUcCJmr", fromKeypair: anyfromKeypair: const keypair: anykeypair, memo: stringmemo: "Transfer from SwapKit", }); return const txHash: anytxHash; } catch (function (local var) error: unknownerror) { throw function (local var) error: unknownerror; } }
import { enum ChainChain } from "@swapkit/helpers";
import { function createKeyring(phrase: string, networkPrefix: number): Promise<KeyringPair>createKeyring, Network, 
function getSubstrateToolbox<T extends SubstrateChain>(chain: T, params?: ToolboxParams): Promise<{
    api: ApiPromise;
    network: SubstrateNetwork;
    ... 13 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}>
getSubstrateToolbox
} from "@swapkit/toolboxes/substrate";
Module '"@swapkit/toolboxes/substrate"' has no exported member 'Network'.
async function
function initSubstrateToolbox(): Promise<{
    polkadotToolbox: {
        api: ApiPromise;
        network: SubstrateNetwork;
        gasAsset: AssetValue;
        decodeAddress: (address: string, networkPrefix?: number) => Uint8Array<...>;
        ... 11 more ...;
        signAndBroadcast: ({ tx, callback, address, }: {
            tx: SubmittableExtrinsic<"promise">;
            callback?: Callback<ISubmittableResult>;
            address?: string;
        }) => string | ... 1 more ... | Promise<...>;
    };
    signer: KeyringPair;
}>
initSubstrateToolbox
() {
// Create a keyring with a mnemonic phrase const const signer: KeyringPairsigner = await function createKeyring(phrase: string, networkPrefix: number): Promise<KeyringPair>createKeyring( "your twelve word mnemonic phrase here", import NetworkNetwork[enum ChainChain.function (enum member) Chain.Polkadot = "DOT"Polkadot].prefix ); // Get the toolbox with the signer const
const polkadotToolbox: {
    api: ApiPromise;
    network: SubstrateNetwork;
    gasAsset: AssetValue;
    decodeAddress: (address: string, networkPrefix?: number) => Uint8Array<ArrayBufferLike>;
    ... 11 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}
polkadotToolbox
= await
getSubstrateToolbox<Chain.Polkadot>(chain: Chain.Polkadot, params?: ToolboxParams): Promise<{
    api: ApiPromise;
    network: SubstrateNetwork;
    gasAsset: AssetValue;
    ... 12 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}>
getSubstrateToolbox
(enum ChainChain.function (enum member) Chain.Polkadot = "DOT"Polkadot, { signer?: KeyringPair | Signer | undefinedsigner });
return {
polkadotToolbox: {
    api: ApiPromise;
    network: SubstrateNetwork;
    gasAsset: AssetValue;
    decodeAddress: (address: string, networkPrefix?: number) => Uint8Array<ArrayBufferLike>;
    ... 11 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}
polkadotToolbox
, signer: KeyringPairsigner };
}
import { class AssetValueAssetValue, enum ChainChain } from "@swapkit/helpers";
import { function createKeyring(phrase: string, networkPrefix: number): Promise<KeyringPair>createKeyring, Network, 
function getSubstrateToolbox<T extends SubstrateChain>(chain: T, params?: ToolboxParams): Promise<{
    api: ApiPromise;
    network: SubstrateNetwork;
    ... 13 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}>
getSubstrateToolbox
} from "@swapkit/toolboxes/substrate";
Module '"@swapkit/toolboxes/substrate"' has no exported member 'Network'.
async function function substrateTransfer(): Promise<string | undefined>substrateTransfer() { // Create a keyring const const signer: KeyringPairsigner = await function createKeyring(phrase: string, networkPrefix: number): Promise<KeyringPair>createKeyring( "your twelve word mnemonic phrase here", import NetworkNetwork[enum ChainChain.function (enum member) Chain.Polkadot = "DOT"Polkadot].prefix ); // Get the toolbox const
const polkadotToolbox: {
    api: ApiPromise;
    network: SubstrateNetwork;
    gasAsset: AssetValue;
    decodeAddress: (address: string, networkPrefix?: number) => Uint8Array<ArrayBufferLike>;
    ... 11 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}
polkadotToolbox
= await
getSubstrateToolbox<Chain.Polkadot>(chain: Chain.Polkadot, params?: ToolboxParams): Promise<{
    api: ApiPromise;
    network: SubstrateNetwork;
    gasAsset: AssetValue;
    ... 12 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}>
getSubstrateToolbox
(enum ChainChain.function (enum member) Chain.Polkadot = "DOT"Polkadot, { signer?: KeyringPair | Signer | undefinedsigner });
// Amount to transfer const const amount: AssetValueamount = class AssetValueAssetValue.
AssetValue.from<{
    chain: Chain.Polkadot;
    symbol: string;
    value: string;
}>({ value, fromBaseDecimal, asyncTokenLookup, ...fromAssetOrChain }: {
    chain: Chain.Polkadot;
    symbol: string;
    value: string;
} & AssetValueFromParams): AssetValue
from
({
chain: Chain.Polkadotchain: enum ChainChain.function (enum member) Chain.Polkadot = "DOT"Polkadot, symbol: stringsymbol: "DOT", value: stringvalue: "0.1", // 0.1 DOT }); // Recipient address const const recipient: "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5"recipient = "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5"; // Transfer DOT try { const const txHash: string | undefinedtxHash = await
const polkadotToolbox: {
    api: ApiPromise;
    network: SubstrateNetwork;
    gasAsset: AssetValue;
    decodeAddress: (address: string, networkPrefix?: number) => Uint8Array<ArrayBufferLike>;
    ... 11 more ...;
    signAndBroadcast: ({ tx, callback, address, }: {
        tx: SubmittableExtrinsic<"promise">;
        callback?: Callback<ISubmittableResult>;
        address?: string;
    }) => string | ... 1 more ... | Promise<...>;
}
polkadotToolbox
.transfer: (params: SubstrateTransferParams) => Promise<string | undefined>transfer({
assetValue: AssetValueassetValue: const amount: AssetValueamount, recipient: stringrecipient, from: const signer: KeyringPairsigner.KeyringPair.address: stringaddress,
Object literal may only specify known properties, and 'from' does not exist in type 'SubstrateTransferParams'.
}); return const txHash: string | undefinedtxHash; } catch (function (local var) error: unknownerror) { throw function (local var) error: unknownerror; } }

For complex operations involving multiple chains, you can use multiple toolboxes together:

import { class AssetValueAssetValue, enum ChainChain } from "@swapkit/helpers";
import { 
function getUtxoToolbox<T extends keyof UTXOToolboxes>(chain: T, params?: UtxoToolboxParams[T] | {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
}): Promise<UTXOToolboxes[T]>
getUtxoToolbox
} from "@swapkit/toolboxes/utxo";
import {
function getEvmToolbox<T extends EVMChain>(chain: T, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
} from "@swapkit/toolboxes/evm";
import { import ethersethers } from "ethers"; async function
function crossChainOperation(): Promise<{
    btcBalance: AssetValue[];
    ethBalance: AssetValue[];
}>
crossChainOperation
() {
// Initialize Bitcoin toolbox const
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
= await
getUtxoToolbox<Chain.Bitcoin>(chain: Chain.Bitcoin, params?: {
    phrase?: string;
    derivationPath?: DerivationPathArray;
    index?: number;
} | {
    signer: ChainSigner<Psbt, Psbt>;
} | undefined): Promise<...>
getUtxoToolbox
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);
// Initialize Ethereum toolbox const const provider: ethers.JsonRpcProviderprovider = new import ethersethers.
new JsonRpcProvider(url?: string | ethers.FetchRequest, network?: ethers.Networkish, options?: ethers.JsonRpcApiProviderOptions): ethers.JsonRpcProvider
export JsonRpcProvider
The JsonRpcProvider is one of the most common Providers, which performs all operations over HTTP (or HTTPS) requests. Events are processed by polling the backend for the current block number; when it advances, all block-base events are then checked for updates.
JsonRpcProvider
("https://mainnet.infura.io/v3/your-infura-key");
const const signer: ethers.Walletsigner = new import ethersethers.
new Wallet(key: string | ethers.SigningKey, provider?: null | ethers.Provider): ethers.Wallet
export Wallet
Create a new wallet for the private %%key%%, optionally connected to %%provider%%.
Wallet
("your-eth-private-key", const provider: ethers.JsonRpcProviderprovider);
const
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
= await
getEvmToolbox<Chain.Ethereum>(chain: Chain.Ethereum, params?: EVMToolboxParams): Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
getEvmToolbox
(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, { provider?: ethers.BrowserProvider | ethers.JsonRpcProvider | undefinedprovider, signer?: (ChainSigner<EVMTransferParams, string> & ethers.Signer) | ethers.JsonRpcSigner | undefinedsigner });
// Get Bitcoin balance const const btcAddress: "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"btcAddress = "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"; const const btcBalance: AssetValue[]btcBalance = await
const btcToolbox: {
    accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: UTXOCalculateTxSizeParams & {
        outputs: TargetOutput[];
        chain: UTXOChain;
    }) => {
        ...;
    } | {
        ...;
    };
    ... 13 more ...;
    estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
        from: string;
        memo?: string;
        feeRate?: number;
        feeOptionKey?: FeeOption;
        recipients?: number | TargetOutput[];
    }) => Promise<...>;
}
btcToolbox
.getBalance: (address: string, scamFilter?: boolean) => Promise<AssetValue[]>getBalance(const btcAddress: "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"btcAddress);
// Get Ethereum balance const const ethAddress: stringethAddress = const signer: ethers.Walletsigner.BaseWallet.address: string
The wallet address.
address
;
const const ethBalance: AssetValue[]ethBalance = await
const ethToolbox: {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}
ethToolbox
.getBalance: (address: string, scamFilter?: boolean) => Promise<AssetValue[]>getBalance(const ethAddress: stringethAddress);
return { btcBalance: AssetValue[]btcBalance, ethBalance: AssetValue[]ethBalance }; }