Skip to content

Commit f491da2

Browse files
authored
SDK: Add helper to metapackage to construct ChainContext (#513)
1 parent 564802e commit f491da2

File tree

10 files changed

+392
-616
lines changed

10 files changed

+392
-616
lines changed

examples/src/platform.ts

-16
This file was deleted.

examples/src/platforms.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { blindDeserializePayload, loadProtocols } from "@wormhole-foundation/sdk";
2+
import evm from "@wormhole-foundation/sdk/platforms/evm";
3+
4+
(async function () {
5+
await loadProtocols(evm, ["TokenBridge", "WormholeCore"]);
6+
7+
const platform = new evm.Platform("Mainnet");
8+
const ethereum = platform.getChain("Ethereum");
9+
const core = await ethereum.getWormholeCore();
10+
const [msg] = await core.parseMessages(
11+
"0xee0faa8eaf0f0acf7c6835f35fd4e58fb57d74a3f6dcf4067acc02aca1dd3916",
12+
);
13+
console.log(blindDeserializePayload(msg!.payload));
14+
15+
const sepolia = evm.getChain("Testnet", "Sepolia");
16+
const tb = await sepolia.getTokenBridge();
17+
const address = await tb.getWrappedNative();
18+
console.log(address.toString());
19+
})();

0 commit comments

Comments
 (0)