-
Notifications
You must be signed in to change notification settings - Fork 20
/
swap.js
137 lines (86 loc) · 1.97 KB
/
swap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
const bitbnsApi = require('./index');
const bitbns = new bitbnsApi({
apiKey : 'your_public_key',
apiSecretKey : 'your_private_key'
});
////// Place limit order on swap
////// type 0 - BUY. type 1 - SELL
bitbns.swapLimitINR({
coin : 'BTC',
quantity : '0.00001',
rate : '3850000',
type : 0
},function(error, data) {
console.log(data)
});
////// Place limit order in USDT market on swap
////// type 0 - BUY. type 1 - SELL
bitbns.swapLimitUSDT({
coin : 'BTC',
quantity : '0.00001',
rate : '45000',
type : 0
},function(error, data) {
console.log(data)
});
////// Cancel limit order swap
////// market 0 - INR market. market 1 - USDT market
bitbns.swapCancelOrder({
order_id : '628919',
market : '1'
},function(error, data) {
console.log(data)
});
////// List swap Open Orders
bitbns.swapListOpenOrders({
page : '0'
},function(error, data) {
console.log(data)
});
////// Place market order on swap with quantity passed
////// type 0 - BUY. type 1 - SELL
bitbns.swapMarketINR({
coin : 'BTC',
quantity : '0.00001',
type : 0
},function(error, data) {
console.log(data)
});
////// Place market order on swap with volume in INR passed
////// type 0 - BUY. type 1 - SELL
bitbns.swapMarketINR({
coin : 'BTC',
volume : '100',
type : 0
},function(error, data) {
console.log(data)
});
////// Place limit order in USDT with quantity market on swap
////// type 0 - BUY. type 1 - SELL
bitbns.swapMarketUSDT({
coin : 'BTC',
quantity : '0.00001',
type : 0
},function(error, data) {
console.log(data)
});
////// Place limit order in USDT with volume market on swap
////// type 0 - BUY. type 1 - SELL
bitbns.swapMarketUSDT({
coin : 'BTC',
volume : 10,
type : 0
},function(error, data) {
console.log(data)
});
////// List Executed orders History
bitbns.swapOrderHistory({
page : '0'
},function(error, data) {
console.log(data)
});
////// All supported coins on swap
bitbns.swapCoinList({
},function(error, data) {
console.log(data)
});