Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@jonbru/xchain-thorchain-amm
Advanced tools
module that exposes estimating & swappping cryptocurrency assets on thorchain
@xchainjs/xchain-thorchain-amm
Thorchain AMM module
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"
}
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
xchain-thorchain-amm
How thorchain-amm works
How to use thorchain-amm
tsconfig compiler options
{
"compilerOptions": {
"module":"commonjs",
"target": "es5",
"noEmitOnError": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["es6", "dom", "es2016", "es2017"]
}
}
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
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
FAQs
module that exposes estimating & swappping cryptocurrency assets on thorchain
The npm package @jonbru/xchain-thorchain-amm receives a total of 4 weekly downloads. As such, @jonbru/xchain-thorchain-amm popularity was classified as not popular.
We found that @jonbru/xchain-thorchain-amm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.