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

@omnibtc/omnibtc-aptos-sdk

v0.1.5

Published

OmniSwap SDK for Aptos

Readme

aptos-amm-sdk

omni-amm-sdk provides the the following TypeScript interface:

  • swap in aptos amm
  • add and remove liquid

USAGE

Install SDK

yarn add @omnibtc/omniswap-aptos-sdk

Query All Support Coins

import { App } from '@omnibtc/omniswap-aptos-sdk/generated';
import { AptosAccount, AptosClient, HexString } from 'aptos';
import { CONFIGS } from '@omnibtc/omniswap-aptos-sdk/config';

const netConf = CONFIGS.testnet;
const client = new AptosClient("https://fullnode.testnet.aptoslabs.com/v1");
const app = new App(client);

(async()=>{
    const coinListClient = await CoinListClient.load(app);
    const coinlist = await coinListClient.getCoinInfoList()
    console.log(`JSON.stringify(coinlists)`);
})

Query All LiquidPools

import { App } from '@omnibtc/omniswap-aptos-sdk/generated';
import { AptosAccount, AptosClient, HexString } from 'aptos';
import { CONFIGS } from '@omnibtc/omniswap-aptos-sdk/config';

const netConf = CONFIGS.testnet;
const client = new AptosClient("https://fullnode.testnet.aptoslabs.com/v1");
const app = new App(client);

(async()=>{
    const coinListClient = await CoinListClient.load(app);
    const omniProvider = new OmniPoolProvider(app, netConf, coinListClient);
    const poollist = await omniProvider.loadPoolList();
    poollist.forEach(async (pool) => {
      await pool.reloadState(app);
      // calculate quote
      const quote = await pool.getQuote(1, true);
      console.log(`quote: ${JSON.stringify(quote)}`);
    });

})

Add liquidity

import { App,Swap } from '@omnibtc/omniswap-aptos-sdk/generated';
import { AptosAccount, AptosClient, HexString } from 'aptos';
import { CONFIGS } from '@omnibtc/omniswap-aptos-sdk/config';
import { parseTypeTagOrThrow, u64, sendPayloadTxAndLog, parseMoveStructTag, StructTag } from '@manahippo/move-to-ts';
const netConf = CONFIGS.testnet;
const client = new AptosClient("https://fullnode.testnet.aptoslabs.com/v1");
const app = new App(client);
const account = new AptosAccount(privateKey.toUint8Array());

(async()=>{
  // X_: 0xd415c5143d4f9752e462ab3476c567fdc0e2f0fb02f779d333e819c0e8624ea8::Coins::USDT
  // Y_: 0x1::aptos_coin::AptosCoin
  const X_ = parseTypeTagOrThrow(X);
  const Y_ = parseTypeTagOrThrow(Y);
  const coin_x_val_ = u64(coin_x_val);
  const coin_x_val_min_ = u64(coin_x_val_min);
  const coin_y_val_ = u64(coin_y_val);
  const coin_y_val_min_ = u64(coin_y_val_min);
  const max_gas_ = parseInt(max_gas);
  const payload = Swap.Interface.buildPayload_add_liquidity(
    coin_x_val_,
    coin_x_val_min_,
    coin_y_val_,
    coin_y_val_min_,
    [X_, Y_]
  );
  await sendPayloadTxAndLog(client, account, payload, { maxGasAmount: max_gas_ });

})

CLI

git clone https://github.com/OmniBTC/omniswap-aptos-sdk.git
yarn 
yarn build-cli

List commands

Usage: yarn cli [options] [command]
Options:
  -c, --config <path>                           path to your aptos config.yml (generated with "aptos init")
  -p, --profile <PROFILE>                       aptos config profile to use (default:"default")
  -h, --help                                    display help for command

Commands:
  interface:add-liquidity <TYPE_X> <TYPE_Y> <coin_x_val> <coin_x_val_min> <coin_y_val> <coin_y_val_min> [max_gas]  Add liquidity to the pool
  interface:initialize-swap <controller> <beneficiary> [max_gas]                                                   Initialize swap (admin-only)
  interface:register-pool <TYPE_X> <TYPE_Y> [max_gas]                                                              Register a new liquidity pool for
                                                                                                                   'X'/'Y' pair
  interface:remove-liquidity <TYPE_X> <TYPE_Y> <lp_val> <min_x_out_val> <min_y_out_val> [max_gas]                  Remove liquidity to the pool
  interface:swap <TYPE_X> <TYPE_Y> <coin_val> <coin_out_min_val> [max_gas]                                         Swap 'X' for 'Y'
  list-pools                                                                                                       List all registered liquidity pools
  help [command]                                                                                                   display help for command