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

Connecting Wallets

SwapKit provides multiple ways to connect wallets for different blockchain networks. This guide demonstrates how to connect various wallet types using both granular and all-in-one approaches.

You can use SwapKit in two ways:

  1. Granular approach - Import only what you need from individual packages:

    import { 
    function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
        config?: SKConfigState;
        plugins?: Plugins;
        wallets?: Wallets;
    }): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
        ...;
    }
    SwapKit
    } from "@swapkit/core";
    import {
    const keystoreWallet: {
        connectKeystore: {
            connectWallet: (connectParams: {
                addChain: AddChainType;
            }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
                ARB?: DerivationPathArray | undefined;
                ... 21 more ...;
                SOL?: DerivationPathArray | undefined;
            } | undefined) => Promise<boolean>;
            supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
        };
    }
    keystoreWallet
    } from "@swapkit/wallets/keystore";
  2. All-in-one approach - Import everything from the SDK (better for backend/Node.js):

    import { 
    function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
        chainflip: {
            supportedSwapkitProviders: ProviderName[];
        } & {
            swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
        };
        ... 5 more ...;
        solana: {
            ...;
        } & {
            ...;
        };
    } & {
        ...;
    } & {
        ...;
    }
    createSwapKit
    } from "@swapkit/sdk";

The granular approach is recommended for frontend applications as it results in smaller bundle sizes.


import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const keystoreWallet: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
}
keystoreWallet
} from "@swapkit/wallets/keystore";
import {
const ledgerWallet: {
    connectLedger: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 12 more ... | Chain.THORChain)[];
    };
}
ledgerWallet
} from "@swapkit/wallets/ledger";
import {
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
} from "@swapkit/wallets/evm-extensions";
// Initialize the SwapKit client with specific wallets const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
    connectLedger: (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
config?: SKConfigState | undefinedconfig: {
apiKeys?: Partial<{
    blockchair: string;
    kado: string;
    keepKey: string;
    swapKit: string;
    walletConnectProjectId: string;
}> | undefined
apiKeys
: {
swapKit?: string | undefinedswapKit: "your-swapkit-api-key", walletConnectProjectId?: string | undefinedwalletConnectProjectId: "your-walletconnect-project-id", }, },
wallets?: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
    connectLedger: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 12 more ... | Chain.THORChain)[];
    };
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
} | undefined
wallets
: { ...
const keystoreWallet: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
}
keystoreWallet
, ...
const ledgerWallet: {
    connectLedger: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 12 more ... | Chain.THORChain)[];
    };
}
ledgerWallet
, ...
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
},
});

import { 
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    solana: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
} from "@swapkit/sdk";
// Initialize the SwapKit client with all wallets included const
const swapKit: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    solana: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
swapKit
=
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    solana: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
({
config?: SKConfigState | undefinedconfig: {
apiKeys?: Partial<{
    blockchair: string;
    kado: string;
    keepKey: string;
    swapKit: string;
    walletConnectProjectId: string;
}> | undefined
apiKeys
: {
swapKit?: string | undefinedswapKit: "your-swapkit-api-key", walletConnectProjectId?: string | undefinedwalletConnectProjectId: "your-walletconnect-project-id", }, }, });
import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const keystoreWallet: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
}
keystoreWallet
} from "@swapkit/wallets/keystore";
import { function decryptFromKeystore(keystore: Keystore, password: string): Promise<string>decryptFromKeystore, type
type Keystore = {
    version: number;
    meta: string;
    crypto: {
        cipher: string;
        cipherparams: {
            iv: string;
        };
        ciphertext: string;
        kdf: string;
        kdfparams: {
            prf: string;
            dklen: number;
            salt: string;
            c: number;
        };
        mac: string;
    };
}
Keystore
} from "@swapkit/wallets/keystore";
// Initialize SwapKit const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
} | undefined
wallets
: { ...
const keystoreWallet: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
}
keystoreWallet
},
}); // Connect with keystore async function
function connectWithKeystore(keystoreFile: Keystore, password: string, chains: Chain[]): Promise<{
    success: boolean;
    balances: AssetValue[][];
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
    balances?: undefined;
}>
connectWithKeystore
(
keystoreFile: KeystorekeystoreFile:
type Keystore = {
    version: number;
    meta: string;
    crypto: {
        cipher: string;
        cipherparams: {
            iv: string;
        };
        ciphertext: string;
        kdf: string;
        kdfparams: {
            prf: string;
            dklen: number;
            salt: string;
            c: number;
        };
        mac: string;
    };
}
Keystore
,
password: stringpassword: string, chains: Chain[]chains: enum ChainChain[] ) { try { // Decrypt the keystore file const const phrase: stringphrase = await function decryptFromKeystore(keystore: Keystore, password: string): Promise<string>decryptFromKeystore(keystoreFile: KeystorekeystoreFile, password: stringpassword); // Connect the chains with the decrypted phrase await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.
connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
    ARB?: DerivationPathArray | undefined;
    AVAX?: DerivationPathArray | undefined;
    ... 20 more ...;
    SOL?: DerivationPathArray | undefined;
} | undefined) => Promise<boolean>
connectKeystore
(chains: Chain[]chains, const phrase: stringphrase);
// Get wallet balances const const balances: AssetValue[][]balances = await var Promise: PromiseConstructor
Represents the completion of an asynchronous operation
Promise
.PromiseConstructor.all<Promise<AssetValue[]>[]>(values: Promise<AssetValue[]>[]): Promise<AssetValue[][]> (+1 overload)
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
@paramvalues An array of Promises.@returnsA new Promise.
all
(
chains: Chain[]chains.Array<Chain>.map<Promise<AssetValue[]>>(callbackfn: (value: Chain, index: number, array: Chain[]) => Promise<AssetValue[]>, thisArg?: any): Promise<...>[]
Calls a defined callback function on each element of an array, and returns an array that contains the results.
@paramcallbackfn A function that accepts up to three arguments. The map method 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.
map
(async (chain: Chainchain) => {
const
const wallet: ((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}
wallet
= await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.
getWalletWithBalance: <Chain>(chain: Chain, scamFilter?: boolean) => Promise<((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}>
getWalletWithBalance
(chain: Chainchain);
return
const wallet: ((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}
wallet
.balance: AssetValue[]balance;
}) ); return { success: booleansuccess: true, balances: AssetValue[][]balances }; } catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain } from "@swapkit/helpers";
import { 
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    solana: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
} from "@swapkit/sdk";
import { function decryptFromKeystore(keystore: Keystore, password: string): Promise<string>decryptFromKeystore, type
type Keystore = {
    version: number;
    meta: string;
    crypto: {
        cipher: string;
        cipherparams: {
            iv: string;
        };
        ciphertext: string;
        kdf: string;
        kdfparams: {
            prf: string;
            dklen: number;
            salt: string;
            c: number;
        };
        mac: string;
    };
}
Keystore
} from "@swapkit/wallets/keystore";
// Initialize SwapKit const
const swapKit: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    solana: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
swapKit
=
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    solana: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
();
// Connect with keystore async function
function connectWithKeystore(keystoreFile: Keystore, password: string, chains: Chain[]): Promise<{
    success: boolean;
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
}>
connectWithKeystore
(
keystoreFile: KeystorekeystoreFile:
type Keystore = {
    version: number;
    meta: string;
    crypto: {
        cipher: string;
        cipherparams: {
            iv: string;
        };
        ciphertext: string;
        kdf: string;
        kdfparams: {
            prf: string;
            dklen: number;
            salt: string;
            c: number;
        };
        mac: string;
    };
}
Keystore
,
password: stringpassword: string, chains: Chain[]chains: enum ChainChain[] ) { try { // Decrypt the keystore file const const phrase: stringphrase = await function decryptFromKeystore(keystore: Keystore, password: string): Promise<string>decryptFromKeystore(keystoreFile: KeystorekeystoreFile, password: stringpassword); // Connect the chains with the decrypted phrase await
const swapKit: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    solana: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
swapKit
.
connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
    ARB?: DerivationPathArray | undefined;
    AVAX?: DerivationPathArray | undefined;
    ... 20 more ...;
    SOL?: DerivationPathArray | undefined;
} | undefined) => Promise<boolean>
connectKeystore
(chains: Chain[]chains, const phrase: stringphrase);
return { success: booleansuccess: true }; } catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const ledgerWallet: {
    connectLedger: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 12 more ... | Chain.THORChain)[];
    };
}
ledgerWallet
} from "@swapkit/wallets/ledger";
// Initialize SwapKit with Ledger wallet const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectLedger: (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectLedger: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 12 more ... | Chain.THORChain)[];
    };
} | undefined
wallets
: { ...
const ledgerWallet: {
    connectLedger: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 12 more ... | Chain.THORChain)[];
    };
}
ledgerWallet
},
}); // Connect Ledger wallet async function
function connectLedger(chains: Chain[]): Promise<{
    success: boolean;
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
}>
connectLedger
(chains: Chain[]chains: enum ChainChain[]) {
try { // Connect to Ledger await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectLedger: (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectLedger: (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>connectLedger(chains: Chain[]chains);
// Get the wallet address for a specific chain const const ethAddress: stringethAddress =
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectLedger: (chains: Chain[], derivationPath?: DerivationPathArray | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Ethereum>(chain: Chain.Ethereum) => stringgetAddress(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum);
return { success: booleansuccess: true }; } catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain, const NetworkDerivationPath: Record<Chain, DerivationPathArray>NetworkDerivationPath } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const trezorWallet: {
    connectTrezor: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath: DerivationPathArray) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 10 more ... | Chain.Polygon)[];
    };
}
trezorWallet
} from "@swapkit/wallets/trezor";
// Initialize SwapKit with Trezor wallet const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectTrezor: (chains: Chain[], derivationPath: DerivationPathArray) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectTrezor: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath: DerivationPathArray) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 10 more ... | Chain.Polygon)[];
    };
} | undefined
wallets
: { ...
const trezorWallet: {
    connectTrezor: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], derivationPath: DerivationPathArray) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 10 more ... | Chain.Polygon)[];
    };
}
trezorWallet
},
}); // Connect Trezor wallet async function
function connectTrezor(chains: Chain[]): Promise<{
    success: boolean;
    balance: AssetValue[];
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
    balance?: undefined;
}>
connectTrezor
(chains: Chain[]chains: enum ChainChain[]) {
try { // Connect to Trezor await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectTrezor: (chains: Chain[], derivationPath: DerivationPathArray) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectTrezor: (chains: Chain[], derivationPath: DerivationPathArray) => Promise<boolean>connectTrezor([enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin], const NetworkDerivationPath: Record<Chain, DerivationPathArray>NetworkDerivationPath.type BTC: DerivationPathArrayBTC);
// Get wallet balances for Bitcoin const
const btcWallet: ((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}
btcWallet
= await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectTrezor: (chains: Chain[], derivationPath: DerivationPathArray) => Promise<boolean>;
} & {
    ...;
}
swapKit
.
getWalletWithBalance: <Chain.Bitcoin>(chain: Chain.Bitcoin, scamFilter?: boolean) => Promise<((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}>
getWalletWithBalance
(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin);
return { success: booleansuccess: true, balance: AssetValue[]balance:
const btcWallet: ((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}
btcWallet
.balance: AssetValue[]balance };
} catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
} from "@swapkit/wallets/evm-extensions";
// Initialize SwapKit const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
} | undefined
wallets
: { ...
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
},
}); // Connect to MetaMask or other EVM wallets async function
function connectEVMWallet(): Promise<{
    success: boolean;
    address: string;
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
    address?: undefined;
}>
connectEVMWallet
() {
try { // This will prompt the user to connect with their browser wallet await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>connectEVMWallet([enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, enum ChainChain.function (enum member) Chain.BinanceSmartChain = "BSC"BinanceSmartChain]);
// Get the Ethereum address const const address: stringaddress =
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Ethereum>(chain: Chain.Ethereum) => stringgetAddress(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum);
return { success: booleansuccess: true, address: stringaddress }; } catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const keplrWallet: {
    connectKeplr: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>;
        supportedChains: (Chain.Cosmos | ... 1 more ... | Chain.THORChain)[];
    };
}
keplrWallet
} from "@swapkit/wallets/keplr";
// Initialize SwapKit const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectKeplr: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>;
        supportedChains: (Chain.Cosmos | ... 1 more ... | Chain.THORChain)[];
    };
} | undefined
wallets
: { ...
const keplrWallet: {
    connectKeplr: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>;
        supportedChains: (Chain.Cosmos | ... 1 more ... | Chain.THORChain)[];
    };
}
keplrWallet
},
}); // Connect to Keplr async function
function connectKeplr(): Promise<{
    success: boolean;
    address: string;
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
    address?: undefined;
}>
connectKeplr
() {
try { await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>connectKeplr([enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos]);
// Get the Cosmos address const const address: stringaddress =
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Cosmos>(chain: Chain.Cosmos) => stringgetAddress(enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos);
return { success: booleansuccess: true, address: stringaddress }; } catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const phantomWallet: {
    connectPhantom: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[]) => Promise<boolean>;
        supportedChains: (Chain.Bitcoin | Chain.Ethereum | Chain.Solana)[];
    };
}
phantomWallet
} from "@swapkit/wallets/phantom";
// Initialize SwapKit const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectPhantom: (chains: Chain[]) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectPhantom: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[]) => Promise<boolean>;
        supportedChains: (Chain.Bitcoin | Chain.Ethereum | Chain.Solana)[];
    };
} | undefined
wallets
: { ...
const phantomWallet: {
    connectPhantom: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[]) => Promise<boolean>;
        supportedChains: (Chain.Bitcoin | Chain.Ethereum | Chain.Solana)[];
    };
}
phantomWallet
},
}); // Connect to Phantom async function
function connectPhantom(): Promise<{
    success: boolean;
    address: string;
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
    address?: undefined;
}>
connectPhantom
() {
try { await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectPhantom: (chains: Chain[]) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectPhantom: (chains: Chain[]) => Promise<boolean>connectPhantom([enum ChainChain.function (enum member) Chain.Solana = "SOL"Solana]);
// Get the Solana address const const address: stringaddress =
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectPhantom: (chains: Chain[]) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Solana>(chain: Chain.Solana) => stringgetAddress(enum ChainChain.function (enum member) Chain.Solana = "SOL"Solana);
return { success: booleansuccess: true, address: stringaddress }; } catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
} from "@swapkit/wallets/evm-extensions";
// Initialize SwapKit const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
} | undefined
wallets
: { ...
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
},
}); // Get all connected wallets function
function getAllWallets(): {
    ARB: ChainWallet<Chain.Arbitrum> & {
        estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
            feeOption: FeeOption;
            chain: EVMChain;
        }) => Promise<...>;
        ... 20 more ...;
        validateAddress: (address: string) => boolean;
    };
    ... 21 more ...;
    SOL: ChainWallet<...> & {
        ...;
    };
}
getAllWallets
() {
const
const wallets: {
    ARB: ChainWallet<Chain.Arbitrum> & {
        estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
            feeOption: FeeOption;
            chain: EVMChain;
        }) => Promise<...>;
        ... 20 more ...;
        validateAddress: (address: string) => boolean;
    };
    ... 21 more ...;
    SOL: ChainWallet<...> & {
        ...;
    };
}
wallets
=
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.
getAllWallets: () => {
    ARB: ChainWallet<Chain.Arbitrum> & {
        estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
            feeOption: FeeOption;
            chain: EVMChain;
        }) => Promise<...>;
        ... 20 more ...;
        validateAddress: (address: string) => boolean;
    };
    ... 21 more ...;
    SOL: ChainWallet<...> & {
        ...;
    };
}
getAllWallets
();
return
const wallets: {
    ARB: ChainWallet<Chain.Arbitrum> & {
        estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
            feeOption: FeeOption;
            chain: EVMChain;
        }) => Promise<...>;
        ... 20 more ...;
        validateAddress: (address: string) => boolean;
    };
    ... 21 more ...;
    SOL: ChainWallet<...> & {
        ...;
    };
}
wallets
;
} // Disconnect a specific chain function function disconnectChain(chain: Chain): voiddisconnectChain(chain: Chainchain: enum ChainChain) {
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.disconnectChain: <Chain>(chain: Chain) => voiddisconnectChain(chain: Chainchain);
} // Disconnect all wallets function function disconnectAll(): voiddisconnectAll() {
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.disconnectAll: () => voiddisconnectAll();
}

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
} from "@swapkit/wallets/evm-extensions";
// Initialize SwapKit const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
} | undefined
wallets
: { ...
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
},
}); // Connect a wallet first await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>connectEVMWallet([enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum]);
// Get balance for a specific chain async function function getChainBalance(chain: Chain): Promise<AssetValue[]>getChainBalance(chain: Chainchain: enum ChainChain) { // Get the balance (true parameter refreshes the balance from the network) const const balance: AssetValue[]balance = await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getBalance: <Chain, true>(chain: Chain, refresh?: true | undefined) => Promise<AssetValue[]>getBalance(chain: Chainchain, true);
return const balance: AssetValue[]balance; } // Get balances for multiple chains async function
function getAllBalances(chains: Chain[]): Promise<({
    chain: Chain;
    balance: AssetValue[];
    error?: undefined;
} | {
    chain: Chain;
    balance: never[];
    error: unknown;
})[]>
getAllBalances
(chains: Chain[]chains: enum ChainChain[]) {
const
const balances: ({
    chain: Chain;
    balance: AssetValue[];
    error?: undefined;
} | {
    chain: Chain;
    balance: never[];
    error: unknown;
})[]
balances
= await var Promise: PromiseConstructor
Represents the completion of an asynchronous operation
Promise
.
PromiseConstructor.all<Promise<{
    chain: Chain;
    balance: AssetValue[];
    error?: undefined;
} | {
    chain: Chain;
    balance: never[];
    error: unknown;
}>[]>(values: Promise<{
    chain: Chain;
    balance: AssetValue[];
    error?: undefined;
} | {
    chain: Chain;
    balance: never[];
    error: unknown;
}>[]): Promise<...> (+1 overload)
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
@paramvalues An array of Promises.@returnsA new Promise.
all
(
chains: Chain[]chains.
Array<Chain>.map<Promise<{
    chain: Chain;
    balance: AssetValue[];
    error?: undefined;
} | {
    chain: Chain;
    balance: never[];
    error: unknown;
}>>(callbackfn: (value: Chain, index: number, array: Chain[]) => Promise<...>, thisArg?: any): Promise<...>[]
Calls a defined callback function on each element of an array, and returns an array that contains the results.
@paramcallbackfn A function that accepts up to three arguments. The map method 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.
map
(async (chain: Chainchain) => {
try { const
const wallet: ((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}
wallet
= await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.
getWalletWithBalance: <Chain>(chain: Chain, scamFilter?: boolean) => Promise<((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}>
getWalletWithBalance
(chain: Chainchain);
return { chain: Chainchain, balance: AssetValue[]balance:
const wallet: ((ChainWallet<Chain.Arbitrum> & {
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
}) | ... 21 more ... | (ChainWallet<...> & {
    ...;
})) & {
    ...;
}
wallet
.balance: AssetValue[]balance };
} catch (function (local var) error: unknownerror) { return { chain: Chainchain, balance: never[]balance: [], error: unknownerror }; } }) ); return
const balances: ({
    chain: Chain;
    balance: AssetValue[];
    error?: undefined;
} | {
    chain: Chain;
    balance: never[];
    error: unknown;
})[]
balances
;
}

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const walletconnectWallet: {
    connectWalletconnect: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletconnectOptions?: SignClientTypes.Options | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 9 more ... | Chain.THORChain)[];
    };
}
walletconnectWallet
} from "@swapkit/wallets/walletconnect";
// Initialize SwapKit with WalletConnect const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectWalletconnect: (chains: Chain[], walletconnectOptions?: SignClientTypes.Options | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
config?: SKConfigState | undefinedconfig: {
apiKeys?: Partial<{
    blockchair: string;
    kado: string;
    keepKey: string;
    swapKit: string;
    walletConnectProjectId: string;
}> | undefined
apiKeys
: {
walletConnectProjectId?: string | undefinedwalletConnectProjectId: "YOUR_WALLETCONNECT_PROJECT_ID", // Required }, },
wallets?: {
    connectWalletconnect: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletconnectOptions?: SignClientTypes.Options | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 9 more ... | Chain.THORChain)[];
    };
} | undefined
wallets
: { ...
const walletconnectWallet: {
    connectWalletconnect: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletconnectOptions?: SignClientTypes.Options | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 9 more ... | Chain.THORChain)[];
    };
}
walletconnectWallet
},
}); // Connect using WalletConnect async function
function connectWalletConnect(): Promise<{
    success: boolean;
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
}>
connectWalletConnect
() {
try { await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectWalletconnect: (chains: Chain[], walletconnectOptions?: SignClientTypes.Options | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectWalletconnect: (chains: Chain[], walletconnectOptions?: SignClientTypes.Options | undefined) => Promise<boolean>connectWalletconnect([
enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, enum ChainChain.function (enum member) Chain.BinanceSmartChain = "BSC"BinanceSmartChain, enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos, ]); // Check connected addresses const const ethAddress: stringethAddress =
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectWalletconnect: (chains: Chain[], walletconnectOptions?: SignClientTypes.Options | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Ethereum>(chain: Chain.Ethereum) => stringgetAddress(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum);
return { success: booleansuccess: true }; } catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }

import { enum ChainChain } from "@swapkit/helpers";
import { 
function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets, }?: {
    config?: SKConfigState;
    plugins?: Plugins;
    wallets?: Wallets;
}): { [key in keyof Plugins]: ReturnType<...>; } & ... 1 more ... & {
    ...;
}
SwapKit
} from "@swapkit/core";
import {
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
} from "@swapkit/wallets/evm-extensions";
import {
const keplrWallet: {
    connectKeplr: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>;
        supportedChains: (Chain.Cosmos | ... 1 more ... | Chain.THORChain)[];
    };
}
keplrWallet
} from "@swapkit/wallets/keplr";
import {
const keystoreWallet: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
}
keystoreWallet
} from "@swapkit/wallets/keystore";
// Initialize SwapKit with multiple wallet types const
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
=
SwapKit<{
    [x: string]: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<...>;
}, {
    ...;
}>({ config, plugins, wallets, }?: {
    ...;
}): {
    ...;
} & ... 1 more ... & {
    ...;
}
SwapKit
({
wallets?: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
    connectKeplr: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>;
        supportedChains: (Chain.Cosmos | ... 1 more ... | Chain.THORChain)[];
    };
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
} | undefined
wallets
: { ...
const evmWallet: {
    connectEVMWallet: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
        supportedChains: EVMChain[];
    };
}
evmWallet
, ...
const keplrWallet: {
    connectKeplr: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>;
        supportedChains: (Chain.Cosmos | ... 1 more ... | Chain.THORChain)[];
    };
}
keplrWallet
, ...
const keystoreWallet: {
    connectKeystore: {
        connectWallet: (connectParams: {
            addChain: AddChainType;
        }) => (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
            ARB?: DerivationPathArray | undefined;
            ... 21 more ...;
            SOL?: DerivationPathArray | undefined;
        } | undefined) => Promise<boolean>;
        supportedChains: (Chain.Arbitrum | ... 18 more ... | Chain.Solana)[];
    };
}
keystoreWallet
},
}); // Connect multiple wallet types async function
function connectMultipleWallets(phrase: string): Promise<{
    success: boolean;
    addresses: {
        ETH: string;
        GAIA: string;
        BTC: string;
    };
    error?: undefined;
} | {
    success: boolean;
    error: unknown;
    addresses?: undefined;
}>
connectMultipleWallets
(phrase: stringphrase: string) {
try { // Connect EVM wallet for Ethereum await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>connectEVMWallet([enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum]);
// Connect Keplr for Cosmos await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | WalletOption.LEAP | undefined) => Promise<boolean>connectKeplr([enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos]);
// Connect keystore for Bitcoin await
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.
connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
    ARB?: DerivationPathArray | undefined;
    AVAX?: DerivationPathArray | undefined;
    ... 20 more ...;
    SOL?: DerivationPathArray | undefined;
} | undefined) => Promise<boolean>
connectKeystore
([enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin], phrase: stringphrase);
// Get all connected wallets const
const wallets: {
    ARB: ChainWallet<Chain.Arbitrum> & {
        estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
            feeOption: FeeOption;
            chain: EVMChain;
        }) => Promise<...>;
        ... 20 more ...;
        validateAddress: (address: string) => boolean;
    };
    ... 21 more ...;
    SOL: ChainWallet<...> & {
        ...;
    };
}
wallets
=
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.
getAllWallets: () => {
    ARB: ChainWallet<Chain.Arbitrum> & {
        estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
            feeOption: FeeOption;
            chain: EVMChain;
        }) => Promise<...>;
        ... 20 more ...;
        validateAddress: (address: string) => boolean;
    };
    ... 21 more ...;
    SOL: ChainWallet<...> & {
        ...;
    };
}
getAllWallets
();
// Get addresses for each chain const
const addresses: {
    ETH: string;
    GAIA: string;
    BTC: string;
}
addresses
= {
[enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum]:
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Ethereum>(chain: Chain.Ethereum) => stringgetAddress(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum),
[enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos]:
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Cosmos>(chain: Chain.Cosmos) => stringgetAddress(enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos),
[enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin]:
const swapKit: {
    [x: string]: {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & Record<string, unknown>;
} & {
    connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | ... 1 more ... | undefined) => Promise<boolean>;
    connectKeplr: (chains: Chain[], walletType?: WalletOption.KEPLR | ... 1 more ... | undefined) => Promise<boolean>;
    connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>;
} & {
    ...;
}
swapKit
.getAddress: <Chain.Bitcoin>(chain: Chain.Bitcoin) => stringgetAddress(enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin),
}; return { success: booleansuccess: true,
addresses: {
    ETH: string;
    GAIA: string;
    BTC: string;
}
addresses
};
} catch (function (local var) error: unknownerror) { return { success: booleansuccess: false, error: unknownerror }; } }