diff --git a/.changeset/thirty-chairs-wait.md b/.changeset/thirty-chairs-wait.md new file mode 100644 index 000000000..3ec635e75 --- /dev/null +++ b/.changeset/thirty-chairs-wait.md @@ -0,0 +1,5 @@ +--- +'@xchainjs/xchain-evm': patch +--- + +Bug fix related to the nonce at making approve and transfer transactions with Keystore clients diff --git a/packages/xchain-evm/src/clients/client.ts b/packages/xchain-evm/src/clients/client.ts index 9cc313bd3..277a79422 100644 --- a/packages/xchain-evm/src/clients/client.ts +++ b/packages/xchain-evm/src/clients/client.ts @@ -801,7 +801,7 @@ export class Client extends BaseXChainClient implements EVMClient { const tx = await ethers.utils.resolveProperties(transactionRequest) const signedTx = await this.getSigner().signApprove({ - sender: await this.getAddressAsync(), + sender, tx: { type: 1, chainId: tx.chainId, diff --git a/packages/xchain-evm/src/signers/keystoreSigner.ts b/packages/xchain-evm/src/signers/keystoreSigner.ts index 33023514f..6577b0837 100644 --- a/packages/xchain-evm/src/signers/keystoreSigner.ts +++ b/packages/xchain-evm/src/signers/keystoreSigner.ts @@ -111,6 +111,7 @@ export class KeystoreSigner extends Signer implements IKeystoreSigner { to: tx.to, data: tx.data, value: tx.value, + nonce: tx.nonce ? ethers.BigNumber.from(tx.nonce).toNumber() : undefined, gasLimit: tx.gasLimit, gasPrice: tx.gasPrice, maxPriorityFeePerGas: tx.maxPriorityFeePerGas, @@ -134,6 +135,7 @@ export class KeystoreSigner extends Signer implements IKeystoreSigner { to: tx.to, value: tx.value, data: tx.data, + nonce: tx.nonce ? ethers.BigNumber.from(tx.nonce).toNumber() : undefined, gasPrice: tx.gasPrice, gasLimit: tx.gasLimit, })