coinbase.account.balance(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('amount');
data.should.have.property('currency', 'BTC');
done();
});
coinbase.account.receiveAddress(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('success', true);
data.should.have.property('address');
data.should.have.property('callback_url');
done();
});
coinbase.account.generateReceiveAddress(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('success', true);
data.should.have.property('address');
data.should.have.property('callback_url');
done();
});
coinbase.account.generateReceiveAddress('https://www.example.com/callback', function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('success', true);
data.should.have.property('address');
data.should.have.property('callback_url'); // TODO: enforce callback value ***api is currently not passing this back. may be a bug in the api
done();
});
var param = {
"button": {
"name": 'test',
"price_string": '1.23',
"price_currency_iso": 'USD',
"custom": 'Order123',
"description": 'Sample description',
"type": 'buy_now',
"style": 'custom_large'
}
};
coinbase.buttons.create(param, function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('success', true);
data.should.have.property('button');
data.button.should.have.property('code');
data.button.should.have.property('type');
data.button.should.have.property('style');
data.button.should.have.property('text');
data.button.should.have.property('name');
data.button.should.have.property('description');
data.button.should.have.property('custom');
data.button.should.have.property('price');
done();
});
coinbase.contacts(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('contacts');
data.should.have.property('total_count');
data.should.have.property('num_pages');
data.should.have.property('current_page');
done();
});
coinbase.currencies.list(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.length.should.be.above(0);
done();
});
coinbase.currencies.exchangeRates(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('btc_to_usd');
data.should.have.property('usd_to_btc');
done();
});
coinbase.orders.list(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('orders');
data.should.have.property('total_count');
data.should.have.property('num_pages');
data.should.have.property('current_page');
done();
});
coinbase.prices.buy(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('amount');
data.should.have.property('currency');
done();
});
coinbase.prices.sell(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('amount');
data.should.have.property('currency');
done();
});
coinbase.transactions.list(function (err, data) {
if (err) throw err;
log('data: ' + util.inspect(data));
data.should.have.property('current_user');
data.should.have.property('balance');
data.should.have.property('total_count');
data.should.have.property('transactions');
done();
});