Skip to content

Commit

Permalink
add: example for refuel eth
Browse files Browse the repository at this point in the history
  • Loading branch information
nitinmittal23 committed Oct 12, 2023
1 parent 85fd933 commit 0f80f04
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/pos/erc20/deposit_ether_with_gas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { getPOSClient, from } = require('../../utils_pos');

const execute = async () => {
const client = await getPOSClient();
const result = await client.depositEtherWithGas(
1,
from,
1000000000000000,
"0xd9627aa4000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000286556c0f059561200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0869584cd000000000000000000000000dea904157bd08dae959a04dc7e5924b6e3cfe450000000000000000000000000000000007551d94e15a6d9373f715de5b9f4080b"
);

const txHash = await result.getTransactionHash();
console.log("txHash", txHash);
const receipt = await result.getReceipt();
console.log("receipt", receipt);

};

execute().then(() => {
}).catch(err => {
console.error("err", err);
}).finally(_ => {
process.exit(0);
})

0 comments on commit 0f80f04

Please sign in to comment.