npm install @ton/core @ton/crypto @ton/ton @storm-trade/sdk
Using Yarn:
yarn add @ton/core @ton/crypto @ton/ton @storm-trade/sdk
Check out the following examples in the project examples folder:
increase-position.ts
: Init sdk and prepare an increase (open) position tx.
npm run increase-position
close-position.ts
: Init sdk, fetch actual position data and prepare a close position tx.
npm run close-position
create-limit-order.ts
: Set up SDK and prepare a limit or stop-limit order for sending to the blockchain.
npm run create-limit-order
sync-methods.ts
: More performant sdk usage with a synchronous tx preparation.
npm run sync-methods
market.ts
: Fetching an actual market's data, funding, prices.
npm run market
position-manager.ts
: Getting trader's position data: long/short positions, orders, pnl, marginRatio etc.
npm run position-manager
send-with-mnemonic.ts
: Prepare increase position tx, set up sdk and wallet with mnemonic, sing and send tx to the blockchain.
npm run send-with-mnemonic
ton-connect.ts
: Prepare increase position tx, and send tx to the blockchain via TON Connect.
npm run ton-connect