Universal API
Provides a consistent interface across different chains to simplify development, eliminating the need to set up custom logic for each chain.
Modular and organized
Tailor your development experience by including only what you need, ensuring smaller bundles and faster startup times.
Flexible signer interface
Allows you to employ custom gas or fee strategies, offering you more adaptability in your projects.
Router plug-ins
Provide you with multiple options for choosing your route. They always find the best route given any input, enhancing your efficiency.
Token Transfers
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Chain, Network, TokenId, TokenTransfer, Wormhole, amount, isTokenId, wormhole, } from "@wormhole-foundation/sdk";
// Import the platform-specific packages
import evm from "@wormhole-foundation/sdk/evm";
import solana from "@wormhole-foundation/sdk/solana";
import { SignerStuff, getSigner, waitLog } from "./helpers/index.js";
(async function () {
// Init Wormhole object, passing config for which network
// to use (e.g. Mainnet/Testnet) and what Platforms to support
const wh = await wormhole("Testnet", [evm, solana]);
// Grab chain Contexts -- these hold a reference to a cached rpc client
const sendChain = wh.getChain("Avalanche");
const rcvChain = wh.getChain("Solana");
// Shortcut to allow transferring native gas token
const token = Wormhole.tokenId(sendChain.chain, "native");
Example Output
1
2
3
4
5
6
7
8
9
10
11
(async function () {
// Init Wormhole object, passing config for which network
// to use (e.g. Mainnet/Testnet) and what Platforms to support
const wh = await wormhole("Testnet", [evm, solana]);
// Grab chain Contexts -- these hold a reference to a cached rpc client
const sendChain = wh.getChain("Avalanche");
const rcvChain = wh.getChain("Solana");
// Shortcut to allow transferring native gas token
const token = Wormhole.tokenId(sendChain.chain, "native");
Router
Code
1
2
3
4
5
6
7
8
9
10
11
(async function () {
// Init Wormhole object, passing config for which network
// to use (e.g. Mainnet/Testnet) and what Platforms to support
const wh = await wormhole("Testnet", [evm, solana]);
// Grab chain Contexts -- these hold a reference to a cached rpc client
const sendChain = wh.getChain("Avalanche");
const rcvChain = wh.getChain("Solana");
// Shortcut to allow transferring native gas token
const token = Wormhole.tokenId(sendChain.chain, "native");
Example Output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Chain, Network, TokenId, TokenTransfer, Wormhole, amount, isTokenId, wormhole, } from "@wormhole-foundation/sdk";
// Import the platform-specific packages
import evm from "@wormhole-foundation/sdk/evm";
import solana from "@wormhole-foundation/sdk/solana";
import { SignerStuff, getSigner, waitLog } from "./helpers/index.js";
(async function () {
// Init Wormhole object, passing config for which network
// to use (e.g. Mainnet/Testnet) and what Platforms to support
const wh = await wormhole("Testnet", [evm, solana]);
// Grab chain Contexts -- these hold a reference to a cached rpc client
const sendChain = wh.getChain("Avalanche");
const rcvChain = wh.getChain("Solana");
// Shortcut to allow transferring native gas token
const token = Wormhole.tokenId(sendChain.chain, "native");