-
Notifications
You must be signed in to change notification settings - Fork 318
Conversation
Can you add a test for this? |
lib/clients/authenticated.js
Outdated
depositCrypto(params, callback) { | ||
this._requireParams(params, ['currency']) | ||
return new Promise((resolve, reject) => { | ||
this.get(['coinbase-accounts']).then((coinbaseAccounts) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use getCoinbaseAccounts
?
lib/clients/authenticated.js
Outdated
@@ -245,6 +245,17 @@ class AuthenticatedClient extends PublicClient { | |||
return this.post(['deposits/coinbase-account'], { body: params }, callback); | |||
} | |||
|
|||
depositCrypto(params, callback) { | |||
this._requireParams(params, ['currency']) | |||
return new Promise((resolve, reject) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why return a new promise here?
b566ddd
to
4b8f056
Compare
4b8f056
to
4dcd030
Compare
@fb55 fixed |
lib/clients/authenticated.js
Outdated
.then((coinbaseAccounts) => { | ||
let account = coinbaseAccounts.find(a => a.currency === params.currency); | ||
return this.post(['coinbase-accounts', account.id, 'addresses'], callback); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catch errors if there is a callback provided?
lib/clients/authenticated.js
Outdated
depositCrypto(params, callback) { | ||
this._requireParams(params, ['currency']); | ||
return this.getCoinbaseAccounts() | ||
.then((coinbaseAccounts) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier should get rid of these parenthesis
Prettier seems to be skipped. Otherwise lgtm! |
The formatting is still off. Can you please run prettier on these files? |
8a03dff
to
094b067
Compare
094b067
to
ce35101
Compare
Sorry for the pause and thanks a lot! |
Thanks to a hack found by @pcfreak30 and @sagivo in this thread #91