Skip to content

Commit fc32e64

Browse files
committed
use orchestrator server-side nonce and gas estimate values
1 parent 108034f commit fc32e64

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

advanced/wallets/react-wallet-v2/src/components/MultibridgeRequestModal.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,15 @@ export default function MultibridgeRequestModal({
6868
const chainProvider = new providers.JsonRpcProvider(EIP155_CHAINS[chainId as TEIP155Chain].rpc)
6969
const chainConnectedWallet = await wallet.connect(chainProvider)
7070
const walletAddress = wallet.getAddress()
71-
const gasPrice = await chainProvider.getGasPrice()
72-
const gasEstimate = await chainProvider.estimateGas({
73-
from: walletAddress,
74-
to: transaction.to,
75-
value: transaction.value,
76-
data: transaction.data,
77-
gasPrice: gasPrice
78-
})
7971

8072
const hash = await chainConnectedWallet.sendTransaction({
8173
from: walletAddress,
8274
to: transaction.to,
8375
value: transaction.value,
8476
data: transaction.data,
85-
gasPrice: gasPrice,
86-
gasLimit: gasEstimate
77+
nonce:transaction.nonce,
78+
gasPrice: transaction.gasPrice,
79+
gasLimit: transaction.gas
8780
})
8881
const receipt = typeof hash === 'string' ? hash : hash?.hash
8982
console.log(`Transaction broadcasted on chain ${chainId} , ${{ receipt }}`)

0 commit comments

Comments
 (0)