Skip to content

Commit

Permalink
added testnet manully register script
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Jul 2, 2024
1 parent d962c47 commit 7c94726
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions scripts/wormhole-bulk-attest/src/manual.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { AcalaJsonRpcProvider } from "@acala-network/eth-providers";
import { createWrappedOnEth, getEmitterAddressEth, getSignedVAA } from "@certusone/wormhole-sdk";
import { Wallet } from "ethers";
import dotenv from 'dotenv';
import { NodeHttpTransport } from "@improbable-eng/grpc-web-node-http-transport";

dotenv.config();

const key = process.env.KEY;
if (!key) throw new Error('no key!');

(async () => {
const srcTokenBridgeAddr = '0xDB5492265f6038831E89f495670FF909aDe94bd9';
const emitterAddress = getEmitterAddressEth(srcTokenBridgeAddr);
const sepoliaWhChainId = 10002;
const signedVaa = await getSignedVAA(
'https://api.testnet.wormholescan.io',
sepoliaWhChainId,
emitterAddress,
"3270",
{ transport: NodeHttpTransport() }
)
console.log(signedVaa)

const dstTokenBridgeAddr = '0xe157115ef34c93145Fec2FE53706846853B07F42';
const provider = new AcalaJsonRpcProvider('https://eth-rpc-acala-testnet.aca-staging.network');
const wallet = new Wallet(key, provider);
const receipt = await createWrappedOnEth(dstTokenBridgeAddr, wallet, signedVaa.vaaBytes);
console.log(receipt)
})()
8 changes: 4 additions & 4 deletions scripts/wormhole-bulk-attest/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7c94726

Please sign in to comment.