1.0.5 • Published 3 years ago
@sentre/otc v1.0.5
OTC
IMPORTANT!
In this program, we will use strict conventions that
ais the amount of tokenAthat the MAKER wants to sell.bis the amount of tokenBthat the MAKER wants to buy.xis the amount of tokenAthat a TAKER takes out of the treasury.yis the amount of tokenBthat a TAKER puts in of the treasury.maker_feeis always about the tokenB.taker_feeis always about the tokenA.
Installation
npm i @sentre/otcor,
yarn add @sentre/otcUsage
import Otc, { DEFAULT_OTC_PROGRAM_ID, DEFAULT_RPC_ENDPOINT } from '@sentre/otc'
import { Wallet, web3 } from '@project-serum/anchor'
const wallet = new Wallet(web3.Keypair.generate())
const otc = new Otc(wallet, DEFAULT_RPC_ENDPOINT, DEFAULT_OTC_PROGRAM_ID)
const order = await otc.getOrderData(
'9EKdURf9kaR8yeu9sWSiGQaeMz59zfigQe4mcfsGnLW8',
)