mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 01:08:07 +00:00
commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
const ccxt = require ('../../ccxt.js');
|
||||
|
||||
// instantiate the exchange
|
||||
let exchange = new ccxt.coinbasepro ({
|
||||
'apiKey': 'XXXXXXXXXXXXXX',
|
||||
'secret': 'YYYYYYYYYYYYYY',
|
||||
'password': 'ZZZZZZ', // if exchange requires password
|
||||
});
|
||||
|
||||
|
||||
async function checkMyBalance() {
|
||||
try {
|
||||
// fetch account balance from the exchange
|
||||
let myBalance = await exchange.fetchBalance ();
|
||||
|
||||
// output the result
|
||||
console.log (exchange.id, 'fetched balance', myBalance);
|
||||
|
||||
} catch (e) {
|
||||
// fpr advanced error-handling, see the "advanced-error-handling.js" example file
|
||||
console.log ('[' + e.constructor.name + '] ' + e.message);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
checkMyBalance();
|
||||
Reference in New Issue
Block a user