coinbase/coinbase-node

Buying

Closed this issue · 0 comments

sorry to boughter found the example on https://developers.coinbase.com/api/v2?javascript#commit-a-buy

var Client = require('coinbase').Client;

var client = new Client({'apiKey': 'API KEY',
                         'apiSecret': 'API SECRET'});

client.getAccount('2bbf394c-193b-5b2a-9155-3b4732659ede', function(err, account) {
  account.buy({"amount": "10",
               "currency": "BTC",
               "payment_method": "83562370-3e5c-51db-87da-752af5ab9559"}, function(err, tx) {
    console.log(tx);
  });
});