Skip to content

Commit a7c44bb

Browse files
committed
fix: web3broadcaster not passing on ethereumChainId from the args
1 parent a214c11 commit a7c44bb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/wallets/wallet-base/src/types/strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export type WalletConnectMetadata = {
4040
export interface WalletStrategyEthereumOptions {
4141
ethereumChainId: EthereumChainId
4242
rpcUrl?: string
43-
rpcUrls?: Record<Partial<EthereumChainId>, string>
43+
rpcUrls?: Partial<Record<EthereumChainId, string>>
4444
}
4545

4646
export interface SendTransactionOptions {

packages/wallets/wallet-core/src/broadcaster/Web3Broadcaster.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface SendTransactionOptions {
1313
data: any
1414
}
1515
address: string
16+
ethereumChainId?: EthereumChainId
1617
}
1718

1819
/**
@@ -40,12 +41,14 @@ export class Web3Broadcaster {
4041
const { walletStrategy, ethereumChainId } = this
4142

4243
try {
44+
const chainId = args.ethereumChainId || ethereumChainId
45+
4346
const txHash = await walletStrategy.sendEvmTransaction(args.tx, {
44-
ethereumChainId,
4547
address: args.address,
48+
ethereumChainId: chainId,
4649
})
4750

48-
await walletStrategy.getEvmTransactionReceipt(txHash, ethereumChainId)
51+
await walletStrategy.getEvmTransactionReceipt(txHash, chainId)
4952

5053
return txHash
5154
} catch (e: unknown) {

0 commit comments

Comments
 (0)