Skip to content

Commit

Permalink
Merge pull request #93 from WalletConnect/fix/send-example
Browse files Browse the repository at this point in the history
fix: changed send transaction params
  • Loading branch information
ignaciosantise authored Aug 10, 2023
2 parents 7c2fdc3 + 7a752fb commit 465b5dc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dapps/v2Explorer/src/utils/MethodUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {numberToHex, sanitizeHex, utf8ToHex} from '@walletconnect/encoding';
import {ethers, TypedDataDomain, TypedDataField} from 'ethers';
import {TypedDataDomain, TypedDataField} from 'ethers';
import {recoverAddress} from '@ethersproject/transactions';
import {hashMessage} from '@ethersproject/hash';
import type {Bytes, SignatureLike} from '@ethersproject/bytes';
Expand Down Expand Up @@ -137,17 +137,22 @@ export const sendTransaction = async ({
throw new Error('web3Provider not connected');
}

// Get the signer from the UniversalProvider
// Get the signer from the Provider
const signer = web3Provider.getSigner();

const {chainId} = await web3Provider.getNetwork();

const amount = ethers.utils.parseEther('0.0001');
const address = '0x0000000000000000000000000000000000000000';
const [address] = await web3Provider.listAccounts();
if (!address) {
throw new Error('No address found');
}

const amount = sanitizeHex(numberToHex(0.0001));
const transaction = {
to: address,
value: amount,
chainId,
data: '0x',
};

// Send the transaction using the signer
Expand Down

0 comments on commit 465b5dc

Please sign in to comment.