Skip to content

Commit

Permalink
wait for tx complete
Browse files Browse the repository at this point in the history
  • Loading branch information
lei-1993 committed Apr 1, 2024
1 parent 5d096af commit adbb92a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mooncoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,16 @@ function toBuffer(hex) {

// Function to transfer moon coins from move to evm
async function transferFromMoveToEVM() {
let res = await coinClient.transfer(owner, evm_wallet.address, 5000000, { coinType: asset_address });
console.log(`transfer mooncoin from move to evm tx ${res}`);
let res = await coinClient.transfer(owner, evm_wallet.address, 20000000, { coinType: asset_address });
await client.waitForTransaction(res)
console.log(`transfer 20 mooncoin from move to evm tx ${res}`);
}

// Function to transfer moon coins from evm to move
async function transferFromEVMToMove() {
let from = owner.address().hexString;
let res = await evmContract.transferToMove(from, 1000000);
console.log(`transfer mooncoin from evm to move tx ${res}`);
let res = await evmContract.transferToMove(from, 10000000);
console.log(`transfer 10 mooncoin from evm to move tx ${res.hash}`);
}

// Function to deposit gas to the evm wallet
Expand Down

0 comments on commit adbb92a

Please sign in to comment.