Skip to content

Commit 9757330

Browse files
committed
fix: fix createSwapKit sdk type errors
1 parent bd37d97 commit 9757330

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/sdk/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ export const defaultWallets = {
117117
};
118118

119119
export function createSwapKit<
120-
Plugins extends ReturnType<typeof createPlugin> = typeof defaultPlugins,
121-
Wallets extends ReturnType<typeof createWallet> = typeof defaultWallets,
120+
PluginName extends string,
121+
WalletName extends string,
122+
Plugins extends Record<PluginName, ReturnType<typeof createPlugin>[PluginName]>,
123+
Wallets extends Record<WalletName, ReturnType<typeof createWallet>[WalletName]>,
122124
>({ config, plugins, wallets }: { config?: SKConfigState; plugins?: Plugins; wallets?: Wallets } = {}) {
123-
const mergedPlugins = { ...defaultPlugins, ...plugins } as typeof defaultPlugins & Plugins;
124-
const mergedWallets = { ...defaultWallets, ...wallets } as typeof defaultWallets & Wallets;
125+
const mergedPlugins = { ...defaultPlugins, ...plugins };
126+
const mergedWallets = { ...defaultWallets, ...wallets };
125127

126128
return SwapKit({ config: config, plugins: mergedPlugins, wallets: mergedWallets });
127129
}

0 commit comments

Comments
 (0)