Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit e1d8822

Browse files
authored
Advanced examples
1 parent a20e510 commit e1d8822

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

examples/advanced.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,52 @@ binance.historicalTrades("BNBBTC", (error, response)=>{
208208
});
209209
```
210210

211+
#### Withdraw with custom name
212+
```js
213+
// let name = false // Falsy value won't save address to address book
214+
let name = 'My Withdrawal Address'
215+
binance.withdraw("BTC", "1C5gqLRs96Xq4V2ZZAR1347yUCpHie7sa", 0.2, undefined, name)
216+
```
217+
218+
#### Withdraw with Callback
219+
```js
220+
binance.withdraw("ETH", "0x1d2034348c851ea29c7d03731c7968a5bcc91564", 1, false, (error, response) => {
221+
console.log(response);
222+
});
223+
```
224+
225+
### Proxy Support
226+
For the standard REST API the https_proxy or socks_proxy variable is honoured
227+
*NOTE* proxy package has no dns name support, please use proxy IP address
228+
229+
**Linux**
230+
```bash
231+
export https_proxy=http://ip:port
232+
#export socks_proxy=socks://ip:port
233+
# run your app
234+
```
235+
236+
**Windows**
237+
```bash
238+
set https_proxy=http://ip:port
239+
#set socks_proxy=socks://ip:port
240+
# run your app
241+
```
242+
243+
For web sockets currently only the socks method is functional at this time
244+
245+
**linux**
246+
```bash
247+
export socks_proxy=socks://ip:port
248+
# run your app
249+
```
250+
251+
**windows**
252+
```bash
253+
set socks_proxy=socks://ip:port
254+
# run your app
255+
```
256+
211257
#### Asynchronous Syntax Options
212258
> The examples below show three most common syntaxes for asynchronous API calls and their respective methods of error handling. If you do not pass a callback function as an argument, the API call returns a promise instead.
213259

0 commit comments

Comments
 (0)