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

Migrate to v4

This guide provides a comprehensive overview of all breaking changes and migration steps from SwapKit v3 to v4.

v4 fundamentally changes how packages are organized:

v3 Structure: Individual packages for each component

@swapkit/plugin-chainflip
@swapkit/plugin-evm
@swapkit/toolbox-cosmos
@swapkit/wallet-keystore
@swapkit/api

v4 Structure: Consolidated monolithic packages with submodule exports

@swapkit/plugins/*     # All plugins in one package
@swapkit/toolboxes/*   # All toolboxes in one package
@swapkit/wallets/*     # All wallets in one package
@swapkit/helpers       # Utilities and API (previously @swapkit/api)
@swapkit/sdk          # Complete bundle with everything

All imports must be updated:

// Plugins
- import { ChainflipPlugin } from "@swapkit/plugin-chainflip";
- import { EVMPlugin } from "@swapkit/plugin-evm";
+ import { ChainflipPlugin } from "@swapkit/plugins/chainflip";
+ import { EVMPlugin } from "@swapkit/plugins/evm";

// Toolboxes
- import { getToolboxByChain } from "@swapkit/toolbox-cosmos";
- import { EVMToolbox } from "@swapkit/toolbox-evm";
+ import { getCosmosToolbox } from "@swapkit/toolboxes/cosmos";
+ import { getEvmToolbox } from "@swapkit/toolboxes/evm";

// Wallets
- import { keystoreWallet } from "@swapkit/wallet-keystore";
+ import { keystoreWallet } from "@swapkit/wallets/keystore";

// API (moved to helpers)
- import { SwapKitApi } from "@swapkit/api";
+ import { SwapKitApi } from "@swapkit/helpers/api";

The SwapKit client initialization has changed:

// v3
- import { SwapKit } from "@swapkit/core";
- const client = SwapKit({
-   apis: { /* custom APIs */ },
-   rpcUrls: { /* RPC URLs */ },
-   config: { stagenet: false },
-   plugins: { ...ThorchainPlugin },
-   wallets: { ...keystoreWallet }
- });

// v4
+ import { SwapKit } from "@swapkit/core";
+ const client = SwapKit({
+   config: {
+     rpcUrls: { /* RPC URLs */ },
+     apiKeys: { /* API keys */ }
+   },
+   plugins: { ...ThorchainPlugin },
+   wallets: { ...keystoreWallet }
+ });

v4 introduces a centralized configuration system:

// v3 - Direct configuration
- const client = SwapKit({
-   apis: { [Chain.Ethereum]: customEthApi },
-   rpcUrls: { [Chain.Ethereum]: "https://eth-rpc.com" }
- });

// v4 - SKConfig system
+ import { SKConfig } from "@swapkit/helpers";
+ SKConfig.set({
+   rpcUrls: { [Chain.Ethereum]: "https://eth-rpc.com" },
+   apiKeys: {
+     blockchair: "YOUR_KEY",
+     swapKit: "YOUR_KEY"
+   }
+ });

Plugins now use the createPlugin helper:

// v3
- export function plugin({ getWallet, config }: SwapKitPluginParams<ConnectConfig>) {
-   return {
-     swap,
-     supportedSwapkitProviders: [ProviderName.THORCHAIN]
-   };
- }

// v4
+ import { createPlugin } from "@swapkit/helpers";
+ export const MyPlugin = createPlugin({
+   name: "myPlugin",
+   properties: { supportedSwapkitProviders: [ProviderName.THORCHAIN] },
+   methods: ({ getWallet }) => ({ swap })
+ });

Wallets now use the createWallet helper:

// v3
- export const keystoreWallet: SwapKitWallet<[chains: CryptoChain[], phrase: string]> =
-   ({ addChain, apis, rpcUrls }) => {
-     return async (chains, phrase) => { /* ... */ };
-   };

// v4
+ import { createWallet } from "@swapkit/helpers";
+ export const keystoreWallet = createWallet({
+   name: "keystore",
+   hooks: ({ config }) => ({
+     async connectWallet(chains: Chain[], phrase: string) { /* ... */ }
+   })
+ });

Toolboxes no longer accept RPC URLs directly:

// v3
- const toolbox = getToolboxByChain(chain, {
-   api: customApi,
-   rpcUrl: "https://rpc.url",
-   signer
- });

// v4 - RPC URLs from SKConfig only
+ const toolbox = getEvmToolbox(chain, { signer });
// RPC URL automatically retrieved from SKConfig

Several type imports have changed:

// Wallet types
- import type { EVMWallets } from "@swapkit/toolbox-evm";
+ import type { EVMToolboxes } from "@swapkit/toolboxes/evm";

// API types
- import type { QuoteRequest } from "@swapkit/api";
+ import type { QuoteRequest } from "@swapkit/helpers/api";

// Plugin params simplified
- SwapKitPluginParams<ConnectConfig>
+ SwapKitPluginParams
  • ChainApis type: Use SKConfig system instead
  • Direct API parameter: Configure via SKConfig
  • walletAddressValidator helper: Removed from core exports
  • Individual package installations: Must use consolidated packages
# Remove v3 packages
bun remove @swapkit/plugin-* @swapkit/toolbox-* @swapkit/wallet-*

# Install v4 packages
bun add @swapkit/sdk
# or individual packages
bun add @swapkit/core @swapkit/plugins @swapkit/toolboxes @swapkit/wallets

Replace all v3 imports with v4 equivalents:

-import { THORChainPlugin } from "@swapkit/plugin-thorchain";
-import { EVMToolbox } from "@swapkit/toolbox-evm";
-import { ledgerWallet } from "@swapkit/wallet-ledger";

+import { ThorchainPlugin } from "@swapkit/plugins/thorchain";
+import { getEvmToolbox } from "@swapkit/toolboxes/evm";
+import { ledgerWallet } from "@swapkit/wallets/ledger";
-import { SwapKitCore } from "@swapkit/core";
+import { createSwapKit } from "@swapkit/sdk";

-const client = new SwapKitCore({
+const client = createSwapKit({
  // config
});

The wallet connection pattern remains similar but uses the new import paths:

import { 
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
, enum ChainChain } from "@swapkit/sdk";
const
const client: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
client
=
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
({
// your config }); // Connect EVM wallet await
const client: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
client
.connectEVMWallet: (chains: Chain[], walletType?: EVMWalletOptions | undefined, eip1193Provider?: Eip1193Provider | undefined) => Promise<boolean>connectEVMWallet([enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum]);
// Connect keystore wallet const const chains: Chain[]chains = [enum ChainChain.function (enum member) Chain.Bitcoin = "BTC"Bitcoin, enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, enum ChainChain.function (enum member) Chain.Cosmos = "GAIA"Cosmos]; const const phrase: "your mnemonic phrase here"phrase = "your mnemonic phrase here"; await
const client: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
client
.
connectKeystore: (chains: Chain[], phrase: string, derivationPathMapOrIndex?: number | {
    ARB?: DerivationPathArray | undefined;
    AVAX?: DerivationPathArray | undefined;
    ... 21 more ...;
    TRX?: DerivationPathArray | undefined;
} | undefined) => Promise<boolean>
connectKeystore
(const chains: Chain[]chains, const phrase: "your mnemonic phrase here"phrase);

1. Runtime Configuration Updates (Major Improvement)

Section titled “1. Runtime Configuration Updates (Major Improvement)”

The biggest improvement in v4 is the ability to update configuration at runtime without recreating the SwapKit client.

// v3 - Had to recreate entire client for config changes
const const client1: anyclient1 = 
Cannot find name 'SwapKit'.
SwapKit
({
rpcUrls: {
    [x: number]: string;
}
rpcUrls
: { [
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
.Ethereum]: "https://public-rpc.com" },
apis: {
    [x: number]: any;
}
apis
: { [
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
Cannot find name 'customBtcApi'.
.Bitcoin]: customBtcApi }
}); // To change RPC URL, needed to create new client const const client2: anyclient2 =
Cannot find name 'SwapKit'.
SwapKit
({
rpcUrls: {
    [x: number]: string;
}
rpcUrls
: { [
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
.Ethereum]: "https://premium-rpc.com" },
apis: {
    [x: number]: any;
}
apis
: { [
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
Cannot find name 'customBtcApi'.
.Bitcoin]: customBtcApi }
});
import { 
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
,
const SKConfig: {
    getState: () => SwapKitConfigStore;
    get: <T extends "wallets" | "apiKeys" | "apis" | "chains" | "explorerUrls" | "nodeUrls" | "rpcUrls" | "envs" | "integrations">(key: T) => SwapKitConfigStore[T];
    ... 6 more ...;
    setIntegrationConfig: <T extends keyof SKConfigIntegrations>(integration: T, config: SKConfigIntegrations[T]) => void;
}
SKConfig
, enum ChainChain } from '@swapkit/sdk';
// Create client once const
const swapKit: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
swapKit
=
function createSwapKit(config?: Parameters<typeof SwapKit>[0]): {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
createSwapKit
({
config?: SKConfigState | undefinedconfig: { rpcUrls?: Partial<Record<Chain | StagenetChain, string>> | undefinedrpcUrls: { [enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum]: "https://public-rpc.com" },
apiKeys?: Partial<{
    blockchair: string;
    keepKey: string;
    swapKit: string;
    walletConnectProjectId: string;
}> | undefined
apiKeys
: { blockchair?: string | undefinedblockchair: "basic-key" }
} }); // Update configuration at runtime - client continues working with new config
const SKConfig: {
    getState: () => SwapKitConfigStore;
    get: <T extends "wallets" | "apiKeys" | "apis" | "chains" | "explorerUrls" | "nodeUrls" | "rpcUrls" | "envs" | "integrations">(key: T) => SwapKitConfigStore[T];
    ... 6 more ...;
    setIntegrationConfig: <T extends keyof SKConfigIntegrations>(integration: T, config: SKConfigIntegrations[T]) => void;
}
SKConfig
.setRpcUrl: <Chain.Ethereum>(chain: Chain.Ethereum, url: string) => voidsetRpcUrl(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum, "https://premium-rpc.com");
const SKConfig: {
    getState: () => SwapKitConfigStore;
    get: <T extends "wallets" | "apiKeys" | "apis" | "chains" | "explorerUrls" | "nodeUrls" | "rpcUrls" | "envs" | "integrations">(key: T) => SwapKitConfigStore[T];
    ... 6 more ...;
    setIntegrationConfig: <T extends keyof SKConfigIntegrations>(integration: T, config: SKConfigIntegrations[T]) => void;
}
SKConfig
.setApiKey: <"blockchair">(key: "blockchair", apiKey: string) => voidsetApiKey("blockchair", "premium-api-key");
// Switch to testnet mode
const SKConfig: {
    getState: () => SwapKitConfigStore;
    get: <T extends "wallets" | "apiKeys" | "apis" | "chains" | "explorerUrls" | "nodeUrls" | "rpcUrls" | "envs" | "integrations">(key: T) => SwapKitConfigStore[T];
    ... 6 more ...;
    setIntegrationConfig: <T extends keyof SKConfigIntegrations>(integration: T, config: SKConfigIntegrations[T]) => void;
}
SKConfig
.setEnv: <"isStagenet">(key: "isStagenet", value: boolean) => voidsetEnv("isStagenet", true);
// All subsequent operations automatically use new configuration! const const balance: AssetValue[]balance = await
const swapKit: {
    chainflip: {
        supportedSwapkitProviders: ProviderName[];
    } & {
        swap: (swapParams: RequestSwapDepositAddressParams) => Promise<...>;
    };
    ... 5 more ...;
    near: {
        ...;
    } & {
        ...;
    };
} & {
    ...;
} & {
    ...;
}
swapKit
.getBalance: <Chain.Ethereum, boolean>(chain: Chain.Ethereum, refresh?: boolean | undefined) => AssetValue[] | Promise<AssetValue[]>getBalance(enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum); // Uses premium RPC

Update specific parts of configuration without affecting others:

// Update API keys individually
Cannot find name 'SKConfig'.
SKConfig
.setApiKey("swapKit", "your-swapkit-api-key");
Cannot find name 'SKConfig'.
SKConfig
.setApiKey("walletConnectProjectId", "your-wc-project-id");
Cannot find name 'SKConfig'.
SKConfig
.setApiKey("blockchair", "your-blockchair-key");
// Update RPC URLs for specific chains
Cannot find name 'SKConfig'.
SKConfig
Cannot find name 'Chain'. Did you mean 'Chai'?
.setRpcUrl(Chain.Ethereum, "https://ethereum-rpc.com");
Cannot find name 'SKConfig'.
SKConfig
Cannot find name 'Chain'. Did you mean 'Chai'?
.setRpcUrl(Chain.Arbitrum, "https://arbitrum-rpc.com");
Cannot find name 'SKConfig'.
SKConfig
Cannot find name 'Chain'. Did you mean 'Chai'?
.setRpcUrl(Chain.Avalanche, "https://avalanche-rpc.com");
// Update environment settings
Cannot find name 'SKConfig'.
SKConfig
.setEnv("isDev", false);
Cannot find name 'SKConfig'.
SKConfig
.setEnv("isStagenet", true);
// Update integration configurations
Cannot find name 'SKConfig'.
SKConfig
.setIntegrationConfig("radix", {
dAppDefinitionAddress: stringdAppDefinitionAddress: "account_rdx...", applicationName: stringapplicationName: "My DeFi App", applicationVersion: stringapplicationVersion: "1.0.0",
network: {
    networkId: number;
    networkName: string;
}
network
: { networkId: numbernetworkId: 1, networkName: stringnetworkName: "mainnet" }
});

Update multiple configurations at once:

// Update multiple settings simultaneously
Cannot find name 'SKConfig'.
SKConfig
.set({
rpcUrls: {
    [x: number]: string;
}
rpcUrls
: {
[
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
.Ethereum]: "https://ethereum-rpc.com",
[
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
.Arbitrum]: "https://arbitrum-rpc.com",
[
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
.Avalanche]: "https://avalanche-rpc.com"
},
apiKeys: {
    blockchair: string;
    swapKit: string;
    walletConnectProjectId: string;
}
apiKeys
: {
blockchair: stringblockchair: "premium-blockchair-key", swapKit: stringswapKit: "premium-swapkit-key", walletConnectProjectId: stringwalletConnectProjectId: "your-project-id" },
envs: {
    isStagenet: boolean;
    isDev: boolean;
}
envs
: {
isStagenet: booleanisStagenet: false, isDev: booleanisDev: false } });

Switch between mainnet and testnet without recreating client:

// Start on mainnet
const const swapKit: anyswapKit = 
Cannot find name 'createSwapKit'.
createSwapKit
();
// Switch to testnet for testing
Cannot find name 'SKConfig'.
SKConfig
.setEnv("isStagenet", true);
Cannot find name 'SKConfig'.
SKConfig
Cannot find name 'Chain'. Did you mean 'Chai'?
.setRpcUrl(Chain.THORChain, "https://stagenet-thornode.ninerealms.com");
// All operations now use testnet await const swapKit: anyswapKit.connectKeystore([
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
Cannot find name 'phrase'.
.THORChain], phrase);
const const balance: anybalance = await const swapKit: anyswapKit.getBalance(
Cannot find name 'Chain'. Did you mean 'Chai'?
Chain
.THORChain); // Testnet balance
// Switch back to mainnet
Cannot find name 'SKConfig'.
SKConfig
.setEnv("isStagenet", false);
Cannot find name 'SKConfig'.
SKConfig
Cannot find name 'Chain'. Did you mean 'Chai'?
.setRpcUrl(Chain.THORChain, "https://thornode.ninerealms.com");

5. How Toolboxes Automatically Use Updated Config

Section titled “5. How Toolboxes Automatically Use Updated Config”

All toolboxes in v4 dynamically retrieve configuration from SKConfig:

// When you call this...
const const ethToolbox: anyethToolbox = await 
Cannot find name 'getEvmToolbox'. Did you mean 'ethToolbox'?
getEvmToolbox
Cannot find name 'Chain'. Did you mean 'Chai'?
(Chain.Ethereum);
// Internally, it gets the RPC URL from SKConfig const const rpcUrl: anyrpcUrl =
Cannot find name 'SKConfig'.
SKConfig
Cannot find name 'Chain'. Did you mean 'Chai'?
.get("rpcUrls")[Chain.Ethereum];
const const provider: anyprovider = new
Cannot find name 'JsonRpcProvider'.
JsonRpcProvider
(const rpcUrl: anyrpcUrl);
// So when you update the RPC URL...
Cannot find name 'SKConfig'.
SKConfig
Cannot find name 'Chain'. Did you mean 'Chai'?
.setRpcUrl(Chain.Ethereum, "https://new-rpc.com");
// The next toolbox instance automatically uses the new URL const const newEthToolbox: anynewEthToolbox = await
Cannot find name 'getEvmToolbox'. Did you mean 'ethToolbox'?
getEvmToolbox
Cannot find name 'Chain'. Did you mean 'Chai'?
(Chain.Ethereum); // Uses new RPC!
  • createPlugin: Streamlined plugin creation with consistent interface
  • createWallet: Simplified wallet adapter development
  • Improved Solana Support: Jupiter API integration for real-time token metadata
  • Dynamic Cosmos Fees: Automatic fee estimation when not provided
  • Ripple Support: Full XRP toolbox implementation
  • OneKey Wallet: New wallet integration

Updates preserve existing configuration:

// Set initial API key
Cannot find name 'SKConfig'.
SKConfig
.setApiKey("swapKit", "key1");
// Add another API key - preserves existing ones
Cannot find name 'SKConfig'.
SKConfig
.setApiKey("blockchair", "key2");
// Both keys are now available const const apiKeys: anyapiKeys =
Cannot find name 'SKConfig'.
SKConfig
.get("apiKeys");
console.Console.log(message?: any, ...optionalParams: any[]): void (+3 overloads)
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). ```js const count = 5; console.log('count: %d', count); // Prints: count: 5, to stdout console.log('count:', count); // Prints: count: 5, to stdout ``` See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
log
(const apiKeys: anyapiKeys.swapKit); // "key1"
console.Console.log(message?: any, ...optionalParams: any[]): void (+3 overloads)
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). ```js const count = 5; console.log('count: %d', count); // Prints: count: 5, to stdout console.log('count:', count); // Prints: count: 5, to stdout ``` See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
log
(const apiKeys: anyapiKeys.blockchair); // "key2"
// Error: Module '@swapkit/api' has no exported member 'SwapKitApi'

// Solution: Update import
import { 
const SwapKitApi: {
    mayachainMidgard: {
        getLiquidityPositionRaw: (address: string) => Promise<MemberDetailsMayachain>;
        getNameDetails: (name: string) => Promise<THORNameDetails>;
        getNamesByAddress: (address: string) => Promise<...>;
        getNamesByOwner: (address: string) => Promise<...>;
        getLiquidityPosition: (address: string) => Promise<...>;
    };
    ... 14 more ...;
    getChainflipDepositChannel(body: BrokerDepositChannelParams): Promise<...>;
}
SwapKitApi
} from "@swapkit/sdk";
// Error: Argument of type '{ signer }' is not assignable...

// Solution: Configure via SKConfig
import { 
const SKConfig: {
    getState: () => SwapKitConfigStore;
    get: <T extends "apiKeys" | "apis" | "chains" | "wallets" | "explorerUrls" | "nodeUrls" | "rpcUrls" | "envs" | "integrations">(key: T) => SwapKitConfigStore[T];
    ... 6 more ...;
    setIntegrationConfig: <T extends keyof SKConfigIntegrations>(integration: T, config: SKConfigIntegrations[T]) => void;
}
SKConfig
, enum ChainChain,
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/sdk";
const SKConfig: {
    getState: () => SwapKitConfigStore;
    get: <T extends "apiKeys" | "apis" | "chains" | "wallets" | "explorerUrls" | "nodeUrls" | "rpcUrls" | "envs" | "integrations">(key: T) => SwapKitConfigStore[T];
    ... 6 more ...;
    setIntegrationConfig: <T extends keyof SKConfigIntegrations>(integration: T, config: SKConfigIntegrations[T]) => void;
}
SKConfig
.
set: <{
    rpcUrls: {
        ETH: string;
    };
}>(config: {
    rpcUrls: {
        ETH: string;
    };
}) => void
set
({
rpcUrls: {
    ETH: string;
}
rpcUrls
: { [enum ChainChain.function (enum member) Chain.Ethereum = "ETH"Ethereum]: "https://..." } });
const const signer: anysigner = /* your signer instance */
Expression expected.
;
const
const toolbox: Promise<{
    estimateTransactionFee: ({ feeOption, chain, ...txObject }: EIP1559TxParams & {
        feeOption: FeeOption;
        chain: EVMChain;
    }) => Promise<...>;
    ... 20 more ...;
    validateAddress: (address: string) => boolean;
} | {
    ...;
} | {
    ...;
}>
toolbox
=
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, { signer?: (ChainSigner<EVMTransferParams, string> & Signer) | JsonRpcSigner | undefinedsigner });
// Error: Type '{ swap }' is not assignable...

// Solution: Use createPlugin helper
import { 
function createPlugin<const Name extends string, T extends (params: SwapKitPluginParams) => Record<string, unknown>, K extends {
    supportedSwapkitProviders?: (ProviderName | string)[];
}>({ name, properties, methods }: {
    name: Name;
    properties?: K;
    methods: T;
}): { [key in Name]: (pluginParams: SwapKitPluginParams) => K & ReturnType<T>; }
createPlugin
} from "@swapkit/sdk";
const const swap: (params: any) => Promise<void>swap = async (
Parameter 'params' implicitly has an 'any' type.
params
) => { /* implementation */ };
export const
const MyPlugin: {
    myPlugin: (pluginParams: SwapKitPluginParams) => {
        supportedSwapkitProviders?: (ProviderName | string)[];
    } & {
        ...;
    };
}
MyPlugin
=
createPlugin<"myPlugin", ({ getWallet }: SwapKitPluginParams) => {
    swap: (params: any) => Promise<void>;
}, {
    supportedSwapkitProviders?: (ProviderName | string)[];
}>({ name, properties, methods }: {
    ...;
}): {
    ...;
}
createPlugin
({
name: "myPlugin"name: "myPlugin",
methods: ({ getWallet }: SwapKitPluginParams) => {
    swap: (params: any) => Promise<void>;
}
methods
: ({ getWallet: <T extends CryptoChain>(chain: T) => FullWallet[T]getWallet }) => ({ swap: (params: any) => Promise<void>swap })
});
  • Update all package dependencies
  • Replace all import paths
  • Update client initialization code
  • Configure SKConfig for RPC URLs and API keys
  • Update custom plugins to use createPlugin
  • Update custom wallets to use createWallet
  • Remove direct API/RPC parameters from toolboxes
  • Test all functionality thoroughly