dexag-sdk

2.2.9 • Public • Published

Documentation

See the DEXAG Docs.
Try trading on DEX.AG or cDAI.io

Installation

Install the package from NPM

npm install dexag-sdk

Usage

import DEXAG from 'dexag-sdk';
const sdk = DEXAG.fromProvider(window.ethereum);

Get the best price for 1 DAI with ETH

// pass trade parameters to get the transaction data
const tx = await sdk.getTrade({to: 'DAI', from: 'ETH', toAmount: 1, dex: 'Best'});

Checkout

Initiate the checkout process to validate the clients balance, set token allowance, wrap ETH, track transaction mining, ect.

const valid = await sdk.validate(tx);
if (valid) {
  // transaction data is valid, trade
  sdk.trade(tx);
}

Status Messages

Receive status messages as the client executes the trade

// get status messages as the client checks out
sdk.registerStatusHandler((status, data)=>{
  console.log(status, data)
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.2.9
    9
    • latest

Version History

Package Sidebar

Install

npm i dexag-sdk

Weekly Downloads

9

Version

2.2.9

License

ISC

Unpacked Size

80.9 kB

Total Files

17

Last publish

Collaborators

  • destiner