Skip to content

Commit e86fb8f

Browse files
committed
add more examples
1 parent 0c2960d commit e86fb8f

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

examples/fetch-orderbook.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Binance from 'index'
2+
3+
4+
const client = Binance({
5+
})
6+
7+
async function main() {
8+
const spotOb = await client.book({ symbol: 'BTCUSDT' })
9+
console.log('Spot Orderbook:', spotOb)
10+
11+
const futuresOb = await client.futuresBook({ symbol: 'BTCUSDT' })
12+
console.log('Futures Orderbook:', futuresOb)
13+
}
14+
15+
main()
16+
// node --require @babel/register examples/fetch-orderbook.js

examples/fetch-prices.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Binance from 'index'
2+
3+
4+
const client = Binance({
5+
})
6+
7+
async function main() {
8+
const spotPrices = await client.prices()
9+
console.log('Spot Prices:', spotPrices)
10+
11+
const futuresPrices = await client.futuresPrices()
12+
console.log('Futures Prices:', futuresPrices)
13+
}
14+
15+
main()
16+
// node --require @babel/register examples/fetch-prices.js

0 commit comments

Comments
 (0)