Skip to content

Commit 5898ef9

Browse files
committed
Update depositAddress to use sapi instead of wapi
1 parent 0d0a4cd commit 5898ef9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

node-binance-api.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,12 @@ declare module "node-binance-api" {
667667
depositHistory(...args: any): any;
668668

669669
/**
670-
* Get the deposit history for given asset
671-
* @param {string} asset - the asset
670+
* Get the deposit history for given asset/coin
671+
* @param {string} coin - the asset/coin
672672
* @param {function} callback - the callback function
673673
* @return {promise or undefined} - omitting the callback returns a promise
674674
*/
675-
depositAddress(asset: string, callback?: _callback): Promise<any>;
675+
depositAddress(coin: string, callback?: _callback): Promise<any>;
676676
depositAddress(...args: any): any;
677677

678678
/**

node-binance-api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3483,7 +3483,7 @@ let api = function Binance( options = {} ) {
34833483
* @param {function} callback - the callback function
34843484
* @return {promise or undefined} - omitting the callback returns a promise
34853485
*/
3486-
depositAddress: function ( asset, callback ) {
3486+
depositAddress: function ( coin, callback ) {
34873487
if ( !callback ) {
34883488
return new Promise( ( resolve, reject ) => {
34893489
callback = ( error, response ) => {
@@ -3493,10 +3493,10 @@ let api = function Binance( options = {} ) {
34933493
resolve( response );
34943494
}
34953495
}
3496-
signedRequest( wapi + 'v3/depositAddress.html', { asset: asset }, callback );
3496+
signedRequest( sapi + 'v1/capital/deposit/address', { coin }, callback );
34973497
} )
34983498
} else {
3499-
signedRequest( wapi + 'v3/depositAddress.html', { asset: asset }, callback );
3499+
signedRequest( sapi + 'v1/capital/deposit/address', { coin }, callback );
35003500
}
35013501
},
35023502

test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,8 @@ describe('Deposit address', function () {
796796
assert(Object.prototype.hasOwnProperty.call(result, 'address'), WARN_SHOULD_HAVE_KEY + 'address');
797797
assert(Object.prototype.hasOwnProperty.call(result, 'success'), WARN_SHOULD_HAVE_KEY + 'success');
798798
assert(Object.prototype.hasOwnProperty.call(result, 'addressTag'), WARN_SHOULD_HAVE_KEY + 'addressTag');
799-
assert(Object.prototype.hasOwnProperty.call(result, 'asset'), WARN_SHOULD_HAVE_KEY + 'asset');
800-
assert(result.asset === 'BTC');
799+
assert(Object.prototype.hasOwnProperty.call(result, 'coin'), WARN_SHOULD_HAVE_KEY + 'coin');
800+
assert(result.coin === 'BTC');
801801
assert(result.success === true);
802802
done();
803803
});
@@ -814,7 +814,7 @@ describe('Deposit address', function () {
814814
assert(Object.prototype.hasOwnProperty.call(result, 'address') === false, WARN_SHOULD_NOT_HAVE_KEY + 'address');
815815
assert(Object.prototype.hasOwnProperty.call(result, 'success'), WARN_SHOULD_NOT_HAVE_KEY + 'success');
816816
assert(Object.prototype.hasOwnProperty.call(result, 'addressTag') === false, WARN_SHOULD_NOT_HAVE_KEY + 'addressTag');
817-
assert(Object.prototype.hasOwnProperty.call(result, 'asset') === false, WARN_SHOULD_NOT_HAVE_KEY + 'asset');
817+
assert(Object.prototype.hasOwnProperty.call(result, 'coin') === false, WARN_SHOULD_NOT_HAVE_KEY + 'coin');
818818
assert(result.success === false);
819819
done();
820820
});

0 commit comments

Comments
 (0)