π±Swap
Installation
npm install @holdstation/worldchain-sdk \\
@holdstation/worldchain-ethers-v5 \\
ethers@^5.8.0Setup
import { ethers } from "ethers";
import { Client, Multicall3, Quoter, SwapHelper } from "@holdstation/worldchain-ethers-v5";
import { config, TokenProvider } from "@holdstation/worldchain-sdk";
// 1. Create your JSONβRPC provider
const RPC_URL = "<https://worldchain-mainnet.g.alchemy.com/public>";
const provider = new ethers.providers.StaticJsonRpcProvider(RPC_URL, {
chainId: 480,
name: "worldchain",
});
// 2. Wire up the SDK client
const client = new Client(provider);
const multicall = new Multicall3(provider);
config.client = client;
config.multicall3 = multicall;
// 3. Helpers for tokens & swaps
const tokenProvider = new TokenProvider();
const quoter = new Quoter(client);
const swapHelper = new SwapHelper(client, { tokenStorage: config.tokenStorage });Contract Address
Overall Flow
Detailed Examples
Token Metadata
Quote
Simple Quote
Smart Quote
SwapParams Interfaces
Quote Input
Name
Type
Required
Description
Swap Input
Name
Type
Required
Description
Full Example & Further Reading
Last updated