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 🙏

© 2024 – Pkg Stats / Ryan Hefner

dcf-xchain-thorchain-amm

v0.7.3

Published

module that exposes estimating & swappping cryptocurrency assets on thorchain

Downloads

21

Readme

@xchainjs/xchain-thorchain-amm

Modules

Thorchain AMM module

Installation

yarn add @xchainjs/xchain-thorchain-amm

Following peer dependencies have to be installed into your project. These are not included in @xchainjs/xchain-thorchain-amm.

  "dependencies": {
   "@binance-chain/javascript-sdk": "^4.2.0",
    "@cosmos-client/core": "0.46.1",
    "@psf/bitcoincashjs-lib": "^4.0.2",
    "@xchainjs/xchain-binance": "^5.6.6",
    "@xchainjs/xchain-bitcoin": "^0.20.7",
    "@xchainjs/xchain-bitcoincash": "^0.15.6",
    "@xchainjs/xchain-client": "^0.13.5",
    "@xchainjs/xchain-cosmos": "^0.20.6",
    "@xchainjs/xchain-crypto": "^0.2.6",
    "@xchainjs/xchain-doge": "^0.5.6",
    "@xchainjs/xchain-ethereum": "^0.27.6",
    "@xchainjs/xchain-evm": "^0.1.3",
    "@xchainjs/xchain-avax": "^0.1.3",
    "@xchainjs/xchain-litecoin": "^0.10.8",
    "@xchainjs/xchain-midgard": "0.4.1",
    "@xchainjs/xchain-thorchain": "^0.27.7",
    "@xchainjs/xchain-thorchain-query": "^0.1.12",
    "@xchainjs/xchain-thornode": "^0.1.5",
    "@xchainjs/xchain-util": "^0.12.0",
    "axios": "^0.25.0",
    "axios-retry": "^3.2.5",
    "bchaddrjs": "^0.5.2",
    "bech32": "^2.0.0",
    "bech32-buffer": "^0.2.0",
    "bignumber.js": "^9.0.0",
    "bitcoinjs-lib": "^5.2.0",
    "coininfo": "^5.1.0",
    "coinselect": "^3.1.12",
    "ethers": "^5.6.6",
    "wif": "^2.0.6"
  }

For live examples

Do Swap: https://replit.com/@thorchain/doSwap-Single
Add Liquidity: https://replit.com/@thorchain/addLiquidity
Withdraw liquidity: https://replit.com/@thorchain/removeLiquidity
Add Savers & withdraw Savers: https://replit.com/@thorchain/saversTs#index.ts

Documentation

xchain-thorchain-amm
How thorchain-amm works
How to use thorchain-amm

Compiler options

tsconfig compiler options

{
    "compilerOptions": {
        "module":"commonjs",
        "target": "es5",
        "noEmitOnError": true,
        "resolveJsonModule": true,
        "esModuleInterop": true,
        "lib": ["es6", "dom", "es2016", "es2017"]
    }
}

Setting Headers for Nine Realms endpoints

If you plan on using the publically accessible endpoints provided by Nine Realms(listed below), ensure that you add a valid 'x-client-id' to all requests

  • https://midgard.ninerealms.com
  • https://haskoin.ninerealms.com (BTC/BCH/LTC)
  • https://thornode.ninerealms.com

Setting environment variables

SNOWTRACE_API_KEY={YOUR_SNOWTRACE_API_KEY}
COVALENT_API_KEY={YOUR_COVALENT_API_KEY}
BLOCKCYPHER_API_KEY={YOUR_BLOCKCYPHER_API_KEY}
SOCHAIN_API_KEY={YOUR_SOCHAIN_API_KEY}
BSCSCAN_API_KEY={YOUR_BSCSCAN_API_KEY}

//Default config can access.

process.env.SNOWTRACE_API_KEY
process.env.COVALENT_API_KEY
process.env.BLOCKCYPHER_API_KEY
process.env.SOCHAIN_API_KEY
process.env.BSCSCAN_API_KEY

Example

import cosmosclient from '@cosmos-client/core'
import axios from 'axios'
import { register9Rheader } from '@xchainjs/xchain-util'

register9Rheader(axios)
register9Rheader(cosmosclient.config.globalAxios)

For a complete example please see this test