Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thorswap-lib/cross-chain-api-sdk

Package Overview
Dependencies
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thorswap-lib/cross-chain-api-sdk

Cross-Chain API client SDK

  • 0.1.31
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

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

FAQs

Package last updated on 21 Sep 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc