0.1.31 • Published 2 years ago

@thorswap-lib/cross-chain-api-sdk v0.1.31

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Cross-Chain API SDK

BETA and internal-use only. This is not fully tested you may lose funds!

Usage

  1. Import and instantiate
import CrossChainAPI, { Environment } from '../../../lib/index.js';

const api = new CrossChainAPI({ environment: Environment.DEV, port: 3000 });
  1. Get Supported Providers
const providers = await api.getSupportedProviders();
  1. Get Quote & Transaction Detail
const txDetails = await api.quote({
      sellToken: 'ETH.UNI-0x1f9840a85d5af5bf1d1762f925bdaddc4201f984',
      buyToken: 'BTC.BTC',
      sellAmount: '5',
      slippage: 3, // optional
      providers: ['UNISWAPV2', 'SUSHISWAP', 'ZEROX'], // optional
      senderAddress: '0x681B29a3f3230Cb9Ad1247922BAA8E6a983466Eb', // optional
      recipientAddress: 'bc1q24gf7lf88dzlev0cra79lxshsk407xqj3v0npr'
    });

senderAddress & recipientAddress should be matching the sellToken chain and buyToken chain respectively.

Documentation for releases: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository

0.1.30

2 years ago

0.1.31

2 years ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.24

2 years ago

0.1.14

2 years ago

0.1.26

2 years ago

0.1.15

2 years ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.19

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago