forked from changelly/api-changelly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
62 lines (53 loc) · 1.27 KB
/
index.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
var Changelly = require('./lib.js');
var changelly = new Changelly(
'ApiKey',
'ApiSecret'
);
changelly.getCurrencies(function(err, data) {
if (err){
console.log('Error!', err);
} else {
console.log('getCurrencies', data);
}
});
changelly.createTransaction('eth', 'btc', '1PKYrd9CC4RFB65wBrvaAsTWnp8fXePuj', 10, undefined, function(err, data) {
if (err){
console.log('Error!', err);
} else {
console.log('createTransaction', data);
}
});
changelly.getMinAmount('eth', 'btc', function(err, data) {
if (err){
console.log('Error!', err);
} else {
console.log('getMinAmount', data);
}
});
changelly.getExchangeAmount('btc', 'eth', 1, function(err, data) {
if (err){
console.log('Error!', err);
} else {
console.log('getExchangeAmount', data);
}
});
changelly.getTransactions(10, 0, 'btc', undefined, undefined, function(err, data) {
if (err){
console.log('Error!', err);
} else {
console.log('getTransactions', data);
}
});
changelly.getStatus('1gy2g76', function(err, data) {
if (err){
console.log('Error!', err);
} else {
console.log('getStatus', data);
}
});
changelly.on('payin', function(data) {
console.log('payin', data);
});
changelly.on('payout', function(data) {
console.log('payout', data);
});