Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions node-binance-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,17 @@ declare module "node-binance-api" {

/**
* Withdraws asset to given wallet id
* @param {string} asset - the asset symbol
* @param {string} coin - the coin symbol
* @param {string} network - the coin network
* @param {string} address - the wallet to transfer it to
* @param {number} amount - the amount to transfer
* @param {string} addressTag - and addtional address tag
* @param {long} timestamp - the timestamp
* @param {string} addressTag - and additional address tag
* @param {function} callback - the callback function
* @param {string} name - the name to save the address as. Set falsy to prevent Binance saving to address book
* @return {promise or undefined} - omitting the callback returns a promise
*/
withdraw(asset: string, address: string, amount: number, addressTag?: string, callback?: _callback, name?: string): Promise<any>;
withdraw(coin: string, network: string, address: string, amount: number, timestamp: long, addressTag?: string, callback?: _callback, name?: string): Promise<any>;
withdraw(...args: any): any;

/**
Expand Down
12 changes: 7 additions & 5 deletions node-binance-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3401,16 +3401,18 @@ let api = function Binance( options = {} ) {

/**
* Withdraws asset to given wallet id
* @param {string} asset - the asset symbol
* @param {string} coin - the coin symbol
* @param {string} network - the coin network
* @param {string} address - the wallet to transfer it to
* @param {number} amount - the amount to transfer
* @param {long} timestamp - the timestamp
* @param {string} addressTag - and addtional address tag
* @param {function} callback - the callback function
* @param {string} name - the name to save the address as. Set falsy to prevent Binance saving to address book
* @return {promise or undefined} - omitting the callback returns a promise
*/
withdraw: function ( asset, address, amount, addressTag = false, callback = false, name = false ) {
let params = { asset, address, amount };
withdraw: function ( coin, network, address, amount, timestamp, addressTag = false, callback = false, name = false ) {
let params = { coin, network, address, amount, timestamp };
if ( name ) params.name = name;
if ( addressTag ) params.addressTag = addressTag;
if ( !callback ) {
Expand All @@ -3422,10 +3424,10 @@ let api = function Binance( options = {} ) {
resolve( response );
}
}
signedRequest( wapi + 'v3/withdraw.html', params, callback, 'POST' );
signedRequest( sapi + 'v1/capital/withdraw/apply', params, callback, 'POST' );
} )
} else {
signedRequest( wapi + 'v3/withdraw.html', params, callback, 'POST' );
signedRequest( sapi + 'v1/capital/withdraw/apply', params, callback, 'POST' );
}
},

Expand Down