diff --git a/etc/replacements.js b/etc/replacements.js index 81f30085f..087ff0485 100644 --- a/etc/replacements.js +++ b/etc/replacements.js @@ -5,7 +5,6 @@ const isESM = process.env.BUILD_MODE.includes('esm') const REPLACEMENT_PAIRS = [ { - // path: './src/strategies/wallet-strategy/strategies/Ledger/Base.ts', path: './src/strategies/Ledger/Base.ts', cjs: '@ledgerhq/hw-app-eth/lib/services/ledger', esm: '@ledgerhq/hw-app-eth/lib-es/services/ledger', diff --git a/packages/wallet-ts/src/strategies/types/strategy.ts b/packages/wallet-ts/src/strategies/types/strategy.ts index 8eef657ff..10a1f8bb8 100644 --- a/packages/wallet-ts/src/strategies/types/strategy.ts +++ b/packages/wallet-ts/src/strategies/types/strategy.ts @@ -74,13 +74,20 @@ export interface WalletStrategyOptions { metadata?: Record> } +export type CreateWalletStrategyArguments = Omit< + WalletStrategyArguments, + 'walletStrategies' +> + export interface CosmosWalletStrategyArguments { chainId: CosmosChainId wallet?: Wallet walletStrategies: { wallet: Wallet - createStrategy: () => ConcreteWalletStrategy + createStrategy: ( + args: CreateWalletStrategyArguments, + ) => ConcreteWalletStrategy }[] } diff --git a/packages/wallet-ts/src/strategies/wallet-strategy/WalletStrategy.ts b/packages/wallet-ts/src/strategies/wallet-strategy/WalletStrategy.ts index f56f603fd..9774fe521 100644 --- a/packages/wallet-ts/src/strategies/wallet-strategy/WalletStrategy.ts +++ b/packages/wallet-ts/src/strategies/wallet-strategy/WalletStrategy.ts @@ -134,7 +134,7 @@ const createEnabledStrategies = ( return args.walletStrategies.reduce( (strategies, wallet) => ({ ...strategies, - [wallet.wallet]: wallet.createStrategy(), + [wallet.wallet]: wallet.createStrategy(args), }), {} as Record, ) diff --git a/packages/wallets/wallet-metamask/src/strategies/Metamask/index.ts b/packages/wallets/wallet-metamask/src/strategies/Metamask/index.ts index 25d534873..e5038829b 100644 --- a/packages/wallets/wallet-metamask/src/strategies/Metamask/index.ts +++ b/packages/wallets/wallet-metamask/src/strategies/Metamask/index.ts @@ -13,6 +13,7 @@ import { TxRaw, toUtf8, TxGrpcApi, TxResponse } from '@injectivelabs/sdk-ts' import { ConcreteWalletStrategy, EthereumWalletStrategyArgs, + CreateWalletStrategyArguments, } from '@injectivelabs/wallet-ts' import { BrowserEip1993Provider, @@ -30,7 +31,9 @@ export class Metamask extends BaseConcreteStrategy implements ConcreteWalletStrategy { - constructor(args: EthereumWalletStrategyArgs) { + constructor( + args: CreateWalletStrategyArguments | EthereumWalletStrategyArgs, + ) { super(args) }