Coinbase API transferMoney not supporter anymore? Not Found error

Viewed 183

Im currently trying to transfer Bitcoin to ETH through two of my accounts using the official Coinbase NodeJS Library.

Ive basically copied the code from the documentation but included the currency argument which is required.
Heres my code:

for (var currency in accounts) {
        client.getAccount(accounts[currency], function(err, account) 
        {
            if(err) {
                return;
            }           

            if(account.balance.amount > 0) {
                console.log('Trying to convert '+account.balance.amount+' '+account.balance.currency+' ('+accounts[account.balance.currency]+') to ETH ('+accounts['ETH']+')');
                account.transferMoney({'type':'transfer','to': accounts['ETH'],'amount': account.balance.amount,'currency':account.balance.currency}, function(err, tx) {
                    if(err) {
                        console.log(err);
                        return;
                    }
                    console.log(tx);
                });
            }
        });
    }

Accounts is just an object including the account ids of my currencies. Ive checked the values multiple times and the console.log is also giving me correct values however the transferMoney method is giving me the following error:

0|app  | NotFound: Not found <br>
0|app  |     at handleHttpError <br>(/root/app/node_modules/coinbase/lib/errorHandler.js:46:15)<br>
0|app  |     at Request.onPost [as _callback] <br>(/root/app/node_modules/coinbase/lib/ClientBase.js:179:10)<br>
0|app  |     at Request.self.callback <br>(/root/app/node_modules/coinbase/node_modules/request/request.js:186:22)<br>
0|app  |     at Request.emit (events.js:203:13)<br>
0|app  |     at Request.<anonymous> <br>(/root/app/node_modules/coinbase/node_modules/request/request.js:1163:10)<br>
0|app  |     at Request.emit (events.js:203:13)<br>
0|app  |     at IncomingMessage.<anonymous> <br>(/root/app/node_modules/coinbase/node_modules/request/request.js:1085:12)<br>
0|app  |     at Object.onceWrapper (events.js:291:20)<br>
0|app  |     at IncomingMessage.emit (events.js:208:15)<br>
0|app  |     at endReadableNT (_stream_readable.js:1154:12)<br>

The only problem I can imagine is that coinbase doesnt support the transferMoney method anymore which would kinda suck.

Any idea why its giving me the error, is there anything wrong with my code or is it just a problem with the coinbase api?

0 Answers
Related