Gathering detailed insights and metrics for smxt
Gathering detailed insights and metrics for smxt
Gathering detailed insights and metrics for smxt
Gathering detailed insights and metrics for smxt
npm install smxt
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
A JavaScript library for cryptocurrency trading.
We aim to easily link multiple exchanges with one strategy code.
1npm install smxt
1//cjs 2var smxt = require('smxt') 3console.log(smxt) // print all available exchanges
1var smxt = require('smxt') 2 3let binance = new smxt.Binance( 4 apiKey = "YOUR_API_KEY", 5 apiSecret = "YOUR_API_SECERT" 6) 7 8let bitget = new smxt.Bitget( 9 apiKey = "YOUR_API_KEY", 10 apiSecret = "YOUR_API_SECERT", 11 passphrase = "YOUR_PASSPHRASE" 12) 13 14let bybit = new smxt.Bybit( 15 apiKey = "YOUR_API_KEY", 16 apiSecret = "YOUR_API_SECERT" 17) 18 19let okx = new smxt.Okx( 20 apiKey = "YOUR_API_KEY", 21 apiSecret = "YOUR_API_SECERT", 22 passphrase = "YOUR_PASSPHRASE" 23) 24 25let gateIo = new smxt.GateIo( 26 apiKey = "YOUR_API_KEY", 27 apiSecret = "YOUR_API_SECERT" 28) 29 30let orderly = new smxt.Orderly( 31 accountId = "YOUR_ACCOUNT_ID", 32 apiSecret = "YOUR_API_SECERT" 33) 34 35let upbit = new smxt.Upbit( 36 apiKey = "YOUR_API_KEY", 37 apiSecret = "YOUR_API_SECERT" 38)
1let totalEquity = await bybit.getTotalEquity() 2console.log(totalEquity) // 1000.0 3 4let symbolBalance = await bybit.getSymbolBalance("USDT") 5console.log(symbolBalance) // 700.0 6 7let allBalance = await bybit.getAllBalance() 8console.log(allBalance) // {USDT: { amount: 3000 }, BTC: { amount: 0.1 }} 9
1// init symbol info (tick step, qty step, min qty) 2await bybit.initSymbolInfo() 3console.log(bybit.symbolInfo) 4// { 5// BTCUSDT: { amountTick: 0.001, priceTick: 0.1, minValue: 0.001, maxOrderSize: 100, contractValue: 1} 6// ETHUSDT: { amountTick: 1, priceTick: 0.0001, minValue: 1, maxOrderSize: 10000, contractValue: 1} 7// } 8 9let timeframe = "1d" // or 4h, 1h, 30m, 15m, 5m, 1m 10let kline = await bybit.getKline("ETHUSDT", timeframe) 11console.log(kline) 12// [ 13// { 14// open: 3138.75, 15// high: 3169.63, 16// low: 3126.45, 17// close: 3135.52, 18// volume: 10228.3683, 19// timestamp: 1714003200000 20// }, 21// { 22// open: 3219.37, 23// high: 3292.7, 24// low: 3103.04, 25// close: 3138.74, 26// volume: 53623.2576, 27// timestamp: 1713916800000 28// } 29// ]
1let orderType = "limit" // or market
2let side = "buy" // or sell
3let amount = 10
4let price = 0.4
5let orderId = await bybit.postOrder(
6 "XRPUSDT",
7 orderType,
8 side,
9 amount,
10 price
11)
12console.log(orderId)
13
14let position = await bybit.getPosition("XRPUSDT")
15console.log(position) // 10.0(long) or -10.0(short)
16
17await bybit.cancelAllOrders("XRPUSDT")
For business inquiries: dev@tradingtau.com
No vulnerabilities found.
No security vulnerabilities found.