@tegro-dex/sdk
v0.1.15
Published
This library is aimed at providing users with a easier interface to use Tegro DEX APIs for use in TypeScript and JavaScript(CJS). It exposes all the different functionalities offered by the REST API through more intuitive means.
Downloads
30
Readme
Tegro DEX Typescript SDK
This library is aimed at providing users with a easier interface to use Tegro DEX APIs for use in TypeScript and JavaScript(CJS). It exposes all the different functionalities offered by the REST API through more intuitive means.
Installing
npm install @tegro-dex/sdk
# or
yarn add @tegro-dex/sdk
Usage
The main class of interest in the library is the TegroDexClient
, which needs to be initialized with the environment of choice and the private wallet key that user wants to use.
import { TegroDexClient, Environment } from '@tegro-dex/sdk'
const client = new TegroDexClient(
ENVIRONMENT.TESTNET,
"wallet private key" // The wallet private key is used to sign the transactions
);
The library also offers a more streamlined experience for receiving realtime events through web sockets. The TegroDexClient
class allows subscription to the events using callback functions.
The functions offered by the TegroDexClient
can be viewed here.