Skip to content

Commit

Permalink
fix: fix tx data for evm signers when transfering native tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
RanGojo committed Jun 24, 2024
1 parent 4ed178d commit a5d9f6e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions signers/signer-evm/src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,19 @@ export class DefaultEvmSigner implements GenericSigner<EvmTransaction> {
static buildTx(evmTx: EvmTransaction, disableV2 = false): TransactionRequest {
const TO_STRING_BASE = 16;
let tx: TransactionRequest = {};
/*
* it's better to pass 0x instead of undefined, otherwise some wallets could face issue
* https://github.com/WalletConnect/web3modal/issues/1082#issuecomment-1637793242
*/
tx = {
data: evmTx.data || '0x',
};
if (evmTx.from) {
tx = { ...tx, from: evmTx.from };
}
if (evmTx.to) {
tx = { ...tx, to: evmTx.to };
}
if (evmTx.data) {
tx = { ...tx, data: evmTx.data };
}
if (evmTx.value) {
tx = { ...tx, value: evmTx.value };
}
Expand Down

0 comments on commit a5d9f6e

Please sign in to comment.