@ultrade/ultrade-js-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.2.7 • Public • Published

Ultrade JS SDK

Warning

SDK is under development

Structure of SDK

Three are three classes: AmmClient, TransactionComposer, PendingTxnResponse.

AmmClient contains main and util functions.

main:

  • constructor
  • create a pool for asset a and b
  • bootstrap
  • add liquidity (mint)
  • remove liquidity (burn)
  • swap

a main function returns an instance of TransactionComposer.

utils:

  • get pairs
  • get LP token
  • get pool by assets
  • get pool by LP token
  • get balances of an address
  • get balance of an address per asset
  • check if an address opted in an asset

TransactionComposer sign transactions with secret key or algorand session wallet and send them to blockchain. it has signAndSend public function returns PendingTxnResponse

PendingTxnResponse contains transaction infomation.

Example of Usage

Please checkout unit tests in tests folder.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @ultrade/ultrade-js-sdk

Weekly Downloads

124

Version

0.2.7

License

ISC

Unpacked Size

77.9 kB

Total Files

18

Last publish

Collaborators

  • ruzhukov
  • alekseiby
  • dgoldman