Skip to content

Commit

Permalink
chore: rest adjustments for ts checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-chillios committed Feb 11, 2025
1 parent 4e7fe3f commit 7696e62
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/plugins/thorchain/src/mayaPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ function plugin({ getWallet }: SwapKitPluginParams) {

default: {
if (wallet) {
// @ts-expect-error TODO: right now it's inferred from toolboxes
// we need to simplify this to one object params
return wallet.transfer(params);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/plugins/thorchain/src/tcPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ function plugin({ getWallet }: SwapKitPluginParams) {

default: {
if (wallet) {
// @ts-expect-error TODO: right now it's inferred from toolboxes
// we need to simplify this to one object params
return wallet.transfer(params);
}

Expand Down
8 changes: 5 additions & 3 deletions packages/swapkit/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {

export type PluginsType = {
[key in string]: {
plugin: (params: SwapKitPluginParams<any>) => any;
plugin: (params: SwapKitPluginParams) => any;
config?: any;
};
};
Expand Down Expand Up @@ -59,8 +59,8 @@ export function SwapKit<Plugins extends PluginsType, Wallets extends WalletsType
const connectedWallets = {} as FullWallet;

const availablePlugins = Object.entries(plugins || {}).reduce(
(acc, [pluginName, { plugin, config: pluginConfig }]) => {
const methods = plugin({ getWallet, config: pluginConfig });
(acc, [pluginName, { plugin }]) => {
const methods = plugin({ getWallet });

// @ts-expect-error key is generic and cannot be indexed
acc[pluginName] = methods;
Expand Down Expand Up @@ -247,6 +247,8 @@ export function SwapKit<Plugins extends PluginsType, Wallets extends WalletsType
}
const wallet = getWallet(chain as Exclude<Chain, Chain.Fiat | Chain.Radix>);

// @ts-expect-error TODO: right now it's inferred from toolboxes
// we need to simplify this to one object params
return wallet.transfer({ ...params, assetValue });
}

Expand Down
1 change: 1 addition & 0 deletions packages/toolboxes/utxo/src/toolbox/utxo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function transfer(chain: UTXOChain) {
}: UTXOWalletTransferParams<Psbt, Psbt>) {
if (!from) throw new Error("From address must be provided");
if (!recipient) throw new Error("Recipient address must be provided");
if (!signTransaction) throw new Error("Sign transaction must be provided");
const txFeeRate = feeRate || (await getFeeRates(chain))[feeOptionKey || FeeOption.Fast];

const { psbt } = await buildTx(chain)({
Expand Down
2 changes: 1 addition & 1 deletion packages/toolboxes/utxo/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ export type UTXOTransferParams = {
};

export type UTXOWalletTransferParams<T, U> = UTXOTransferParams & {
signTransaction: (params: T) => U | Promise<U>;
signTransaction?: (params: T) => U | Promise<U>;
};
2 changes: 1 addition & 1 deletion packages/wallets/keystore/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const getWalletMethods = async ({ chain, phrase, derivationPath }: Params) => {

case Chain.Solana: {
const { SOLToolbox } = await import("@swapkit/toolbox-solana");
const toolbox = SOLToolbox({ rpcUrl });
const toolbox = SOLToolbox();
const keypair = toolbox.createKeysForPath({ phrase, derivationPath });

return {
Expand Down

0 comments on commit 7696e62

Please sign in to comment.