-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added testnet manully register script
- Loading branch information
1 parent
d962c47
commit 7c94726
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
})() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.