npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

warpgate-swap-sdk

v1.1.2

Published

Warpgate Swap SDK for Movement blockchain

Readme

WarpGate Swap SDK

npm version License: MIT TypeScript

TypeScript SDK for interacting with WarpGate Swap on Movement blockchain. This SDK provides a simple and intuitive way to integrate WarpGate Swap functionality into your applications.

Features

  • Token Swapping with Best Price Routing
  • Liquidity Pool Management
  • Price Calculations and Pool Information
  • Type-safe Implementation
  • Simple and Intuitive Interface
  • Comprehensive Error Handling

Installation

npm install warpgate-swap-sdk @aptos-labs/ts-sdk

Quick Start

1. Initialize SDK

import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
import { WarpGateSDK } from "warpgate-swap-sdk";

// Initialize Aptos client for Movement Network
const config = new AptosConfig({
  network: Network.CUSTOM,
  fullnode: "https://mainnet.movementnetwork.xyz/v1",
  indexer: "https://indexer.mainnet.movementnetwork.xyz/v1/graphql",
});
const aptos = new Aptos(config);

// Initialize WarpGate SDK
const sdk = new WarpGateSDK(aptos);

2. Define Your Tokens

// Token definitions
const USDC = {
  address: "0x83121c9f9b0527d1f056e21a950d6bf3b9e9e2e8353d0e95ccea726713cbea39",
  decimals: 6,
  symbol: "USDC.e",
  name: "USD Coin",
};

const USDT = {
  address: "0x447721a30109c662dde9c73a0c2c9c9c459fb5e5a9c92f03c50fa69737f5d08d",
  decimals: 6,
  symbol: "USDT.e",
  name: "USDT",
};

3. Check Pool Information

// Get pool information and check if it exists
const poolInfo = await sdk.getPoolInfo(tokenA, tokenB);
// Returns: { exists: boolean, fee?: bigint, reserveA?: string, reserveB?: string }

4. Add Liquidity

// For existing pools:
// Only need to specify one amount, the other is calculated automatically
const addToExistingPool = await sdk.addLiquidity({
  tokenA,
  tokenB,
  amountA: "1", // Amount of tokenA to add
  slippage: 0.5, // Maximum price slippage tolerance (0.5%)
});

// For new pools:
// Must specify both amounts and pool fee
const createNewPool = await sdk.addLiquidity({
  tokenA,
  tokenB,
  amountA: "1000", // Initial tokenA amount
  amountB: "1000", // Initial tokenB amount
  fee: "10", // Pool fee in basis points (0.1%)
  slippage: 0.5, // Maximum price slippage tolerance (0.5%)
});
// Both return: InputGenerateTransactionPayloadData for creating the transaction

5. Swap Tokens

// The SDK automatically finds the best route for the swap
const swapParams = await sdk.swap({
  fromToken: tokenA,
  toToken: tokenB,
  amount: "1", // Amount of fromToken to swap
  slippage: 0.5, // Maximum price slippage tolerance (0.5%)
});
// Returns: InputGenerateTransactionPayloadData for creating the transaction

6. Remove Liquidity

// Remove liquidity and receive both tokens back
const removeLiquidityParams = await sdk.removeLiquidity({
  tokenA,
  tokenB,
  lpAmount: "1", // Amount of LP tokens to burn
  slippage: 0.5, // Maximum price slippage tolerance (0.5%)
});
// Returns: InputGenerateTransactionPayloadData for creating the transaction

Complete Example

Check out our example implementation that demonstrates:

  1. Checking pool existence
  2. Adding liquidity (both new and existing pools)
  3. Performing swaps
  4. Removing liquidity

Development

# Clone the repository
git clone https://github.com/hatchy-fun/warpgate-swap-sdk.git
cd warpgate-swap-sdk

# Install dependencies
npm install

# Build the project
npm run build

Available Scripts

  • npm run build - Build the SDK
  • npm run clean - Clean build artifacts
  • npm run format - Format code with Prettier
  • npm run lint - Lint code with ESLint

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.