-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
42 lines (38 loc) · 1.05 KB
/
setup
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
#!/usr/bin/env node
'use strict';
var LamassuConfig = require('lamassu-config');
var promptly = require('promptly');
var config = new LamassuConfig();
console.log('\nSetting up the Coinfloor trading plugin.\n');
console.log('Please enter your API credentials.\n');
promptly.prompt('User ID: ', function(user_idErr, user_id) {
promptly.prompt('Cookie: ', function(cookieErr, cookie) {
promptly.password('Passphrase: ', function(passphraseErr, passphrase) {
updateDb(user_id, cookie, passphrase, function(err) {
if (err) throw err;
console.log('\nSuccess.');
});
});
});
});
function updateDb(user_id, cookie, passphrase, callback) {
var newConfig = {
exchanges: {
plugins: {
settings: {
coinfloor: {
url: '',
user_id: parseInt(user_id),
cookie: cookie,
passphrase: passphrase
}
},
current: {
ticker: 'coinfloor',
trade: 'coinfloor'
}
}
}
};
config.mergeConfig(newConfig, callback);
}