wormhole logo

Wormhole TypeScript SDK

A modern TypeScript SDK to take your app or wallet multichain

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.

The most powerful multichain SDK

How to use Wormhole SDK

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");
Backpack

Case Study

Backpack

Backpack is not just an average digital wallet - it’s also a regulated centralized exchange that operates in jurisdictions across the world.

May 02, 2024

·

3 min read

Discover other Wormhole products
SDK

Build your custom multichain application.

Native Token Transfers

Make any token natively multichain.

Messaging

Build your custom multichain protocol.

Queries

Pull any on-chain data
on-demand.