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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@undercurrent-technologies/tapp-sdk

v0.0.1

Published

....

Downloads

3

Readme

TAPP DEX SDK

....

Prerequisites

1. NPM Install

npm i @undercurrent-technologies/tapp-sdk

2. Initialization

The Tapp TypeScript SDK provides a convenient helper function initTappSDK to initialize the SDK. You have an option to select either mainnet or testnet for the network.

Available params | key | type | description | |---------|---------------|--------------------------------------| | network | Aptos Network | optional, default: Network.TESTNET. Allowed: Network.TESTNET or Network.MAINNET | | url | string | optional. default: Testnet API |

import { Network } from "@aptos-labs/ts-sdk";
import { initTappSDK } from '@tapp/tapp-sdk'

const sdk = initTappSDK({
    network: Network.MAINNET,
    url: 'https://....'
})

Features

Pool

1. Get all pools

use sdk.Pool.getPools method.

Available params | key | type | description | |----------|----------|--------------------------------------------| | page | int | optional, default: 1 | | size | int | optional, default: 10 | | sortBy | string | optional, default: tvl | | poolType | PoolType | optional. allowed: CLMM, AMM, STABLE |

Example

async function getPools() {
    const poolItems = await sdk.Pool.getPools({
        page: 1,
        size: 15
    });
    console.log(poolItems)
}

2. Get Pool by poolId

use sdk.Pool.getInfo method.

Example

async function getInfo() {
    const poolId = "...."
    const poolInfo = await sdk.Pool.getInfo(poolId);
}

Swap

1. Swap AMM

use sdk.Swap.swapAMMTransactionPayload method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function swapAMM() {
    const params: SwapAMMParams = {
        poolId: '0x61064a140af9c1f7e01855536b92f2cba6101f02c06eba26926640b4cc2c0741',
        a2b: true,
        fixedAmountIn: true;
        amount0: 100000000;
        amount1: 10000000;
    }
    const data = sdk.Swap.swapAMMTransactionPayload(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

2. Swap CLMM

use sdk.Swap.swapCLMMTransactionPayload method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function swapCLMM() {
    const params: SwapCLMMParams = {
        poolId: '0x4de93306851b15eb4aea21161f397d57ffd6cc07fe14dd1277d5ffd84db548d4',
        amountIn: 100000000,
        minAmountOut: 521850658,
        a2b: true,
        fixedAmountIn: true,
        targetSqrtPrice: 4295048016
    }
    const data = sdk.Swap.swapCLMMTransactionPayload(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

3. Swap STABLE

use sdk.Swap.swapStableTransactionPayload method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function swapStable() {
    const params: SwapStableParams = {
        poolId: "0x52d2cc18cbcc07d05456e239f474b784288523e4a5e3ae8c8dc6aed8abbc752b",
        tokenIn: 2,
        tokenOut: 3,
        amountIn: 100000000,
        minAmountOut: 0,
    }
    const data = sdk.Swap.swapStableTransactionPayload(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

4. Get Swap Route

use sdk.Swap.getRoute method

Example

async function getRoute() {
    const token0 = '0xb61f9f829842869968edba4b88f0cf785ac6729fd664f50c7be8c630fd2daebc'
    const token1 = '0x895e73b44e8b083df4b203cce9ffe808b62dc17b27fdc0249be50e17b76e12e8'
    const poolInfo = await sdk.Swap.getRoute(token0, token1);

    console.log(poolInfo)
}

Create Pool And Add Liquidity

1. AMM

use sdk.Position.createAMMPoolAndAddLiquidity method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function createAMMPoolAndAddLiquidity() {
    const params: CreateAMMPoolAndAddLiquidityParams = {
        tokenAddress: ['0xb61f9f829842869968edba4b88f0cf785ac6729fd664f50c7be8c630fd2daebc', '0x895e73b44e8b083df4b203cce9ffe808b62dc17b27fdc0249be50e17b76e12e8'],
        fee: 3000,
        amounts: [20000000000, 30000000000],
    }
    const data = sdk.Position.createAMMPoolAndAddLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

2. CLMM

use sdk.Position.createCLMMPoolAndAddLiquidity method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function createCLMMPoolAndAddLiquidity() {
    const params: CreateCLMMPoolAndAddLiquidityParams = {
        tokenAddress: ['0xb61f9f829842869968edba4b88f0cf785ac6729fd664f50c7be8c630fd2daebc', '0x895e73b44e8b083df4b203cce9ffe808b62dc17b27fdc0249be50e17b76e12e8'],
        fee: 3000,
        amounts: [10000000000, 10000000000],
        initialPrice: 1,
        minPrice: 0.000001,
        maxPrice: Infinity,
        isMaxAmountB: boolean,
    }
    const data = sdk.Position.createCLMMPoolAndAddLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

3. STABLE

use sdk.Position.createStablePoolAndAddLiquidity method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function createStablePoolAndAddLiquidity() {
    const params: createStablePoolAndAddLiquidityParams = {
        tokenAddress: ['0xb61f9f829842869968edba4b88f0cf785ac6729fd664f50c7be8c630fd2daebc', '0x895e73b44e8b083df4b203cce9ffe808b62dc17b27fdc0249be50e17b76e12e8', '0xc92acc4a5268f9ffe9bac16bc1d1cb6cb63e560fe42592b24992062dd40eb47a'],
        fee: 500,
        amounts: [20000000000, 10000000000, 2000000000],
        amplificationFactor: 1000,
    }
    const data = sdk.Position.createStablePoolAndAddLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

Remove Liquidity

When you want to remove liquidity from the position, you can use the following method.

1. Remove AMM Single Position

use sdk.Position.removeSingleAMMLiquidity method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function removeSingleAMMLiquidity() {
    const params: RemoveSingleAMMLiquidityParams = {
        poolId: '0x61064a140af9c1f7e01855536b92f2cba6101f02c06eba26926640b4cc2c0741',
        positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7',
        mintedShare: 10000,
        minAmount0: 10000,
        minAmount1: 10000,
    }
    const data = sdk.Position.removeSingleAMMLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

2. Remove AMM Multiple Positions

use sdk.Position.removeMultipleAMMLiquidity method.

Example

const { signAndSubmitTransaction, account } = useWallet();

async function removeMultipleAMMLiquidity() {
    const params: RemoveMultipleAMMLiquidityParams = {
        poolId: '0x57ce8bc35b6ca1613fe1a0f5d8ecbb02e14e6920643ad478ab935de165a3a707',
        positions: [
            {
                positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7',
                mintedShare: 10000,
                minAmount0: 10000,
                minAmount1: 10000,
            },
            {
                positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b8',
                mintedShare: 20000,
                minAmount0: 20000,
                minAmount1: 20000,
            }
        ]
    }
    const data = sdk.Position.removeMultipleAMMLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

3. Remove CLMM Single Position

use sdk.Position.removeSingleCLMMLiquidity method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function removeSingleCLMMLiquidity() {
    const params: RemoveSingleCLMMLiquidityParams = {
        poolId: '0x57ce8bc35b6ca1613fe1a0f5d8ecbb02e14e6920643ad478ab935de165a3a707',
        positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7',
        mintedShare: 10000,
        minAmount0: 10000,
        minAmount1: 10000,
    }
    const data = sdk.Position.removeSingleCLMMLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

4. Remove CLMM Multiple Positions

use sdk.Position.removeMultipleCLMMLiquidity method.

Example

const { signAndSubmitTransaction, account } = useWallet();

async function removeMultipleCLMMLiquidity() {
    const params: RemoveMultipleCLMMLiquidityParams = {
        poolId: '0x57ce8bc35b6ca1613fe1a0f5d8ecbb02e14e6920643ad478ab935de165a3a707',
        positions: [
            {
                positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7',
                mintedShare: 10000,
                minAmount0: 10000,
                minAmount1: 10000,
            },
            {
                positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7',
                mintedShare: 20000,
                minAmount0: 20000,
                minAmount1: 20000,
            }
        ]
    }
    const data = sdk.Position.removeMultipleCLMMLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

5. Remove STABLE Single Position

use sdk.Position.removeSingleStableLiquidity method

Example

const { signAndSubmitTransaction, account } = useWallet();

async function removeSingleStableLiquidity() {
    const params: RemoveSingleStableLiquidityParams = {
        poolId: '0x57ce8bc35b6ca1613fe1a0f5d8ecbb02e14e6920643ad478ab935de165a3a707',
        liquidityType: 2,
        position: {
            positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7',
            mintedShare: 10000,
            amounts: [100, 200, 300]
        }
    }
    const data = sdk.Position.removeSingleStableLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

6. Remove STABLE Multiple Positions

use sdk.Position.removeMultipleStableLiquidity method.

Example

const { signAndSubmitTransaction, account } = useWallet();

async function removeMultipleStableLiquidity() {
    const params: RemoveMultipleStableLiquidityParams = {
        poolId: '0x57ce8bc35b6ca1613fe1a0f5d8ecbb02e14e6920643ad478ab935de165a3a707',
        liquidityType: 2,
        positions: [
            {
                positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7',
                mintedShare: 10000,
                amounts: [100, 200, 300]
            },
            {
                positionAddr: '0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b8',
                mintedShare: 10000,
                amounts: [300, 400, 500]
            }
        ]
    }
    const data = sdk.Position.removeMultipleStableLiquidity(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}

Collect Fee

use sdk.Position.collectFee method.

Example

const { signAndSubmitTransaction, account } = useWallet();

async function collectFee() {
    const params: CollectFeeParams = {
        poolId: "0x57ce8bc35b6ca1613fe1a0f5d8ecbb02e14e6920643ad478ab935de165a3a707"
        positionAddr: "0xaf43e27cedbcd99a08b30845b900ca3947098fa4564da465712884995e7881b7"
    }
    const data = sdk.Position.collectFee(params);

    await signAndSubmitTransaction({
        sender: account.address,
        data: data
    });
}