Skip to content

Commit 4dbfd4e

Browse files
author
dadi
committed
documentation
1 parent 0ee2bf7 commit 4dbfd4e

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,49 @@ binance.withdraw("BTC", "1C5gqLRs96Xq4V2ZZAR1347yUCpHie7sa", 0.2);
15811581
let name = 'My Withdrawal Address'
15821582
binance.withdraw("BTC", "1C5gqLRs96Xq4V2ZZAR1347yUCpHie7sa", 0.2, undefined, name)
15831583
```
1584+
# Margin
1585+
Margin is newly implemented and a work in progress.
1586+
For now:
1587+
#### Transfer from Main account to Margin account
1588+
```js
1589+
binance.mgTransferMainToMargin(asset, amount, (error, response) => {
1590+
if (error) {
1591+
// error from Binance endpoint
1592+
} else {
1593+
// should get a tranId
1594+
}
1595+
});
1596+
```
1597+
#### Transfer from Margin account to Main account
1598+
```js
1599+
binance.transferMarginToMain(asset, amount, (error, response) => {
1600+
if (error) {
1601+
// error from Binance endpoint
1602+
} else {
1603+
// should get a tranId
1604+
}
1605+
});
1606+
```
1607+
#### Borrow from margin account
1608+
```js
1609+
binance.mgBorrow(asset, amount, (error, response) => {
1610+
if (error) {
1611+
// error from Binance endpoint
1612+
} else {
1613+
// should get a tranId
1614+
}
1615+
});
1616+
```
1617+
#### Repay margin account
1618+
```js
1619+
binance.mgRepay(asset, amount, (error, response) => {
1620+
if (error) {
1621+
// error from Binance endpoint
1622+
} else {
1623+
// should get a tranId
1624+
}
1625+
});
1626+
```
15841627

15851628
#### [Advanced Examples](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md)
15861629
> [exchangeInfo: Pull minimum order size, quantity, etc](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#exchangeinfo-pull-minimum-order-size-quantity-etc)\

examples/advanced.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ SNM available: 0.76352833 (0.00000000 on order)
163163
```
164164
</details>
165165

166+
167+
168+
169+
#### Margin User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket
170+
This is exactly the same as the ws User Data but calling:
171+
```javascript
172+
binance.websockets.userMarginData(margin_balance_update, margin_execution_update);
173+
```
174+
166175
#### newOrderRespType example when placing orders
167176
```js
168177
// Returns additional information, such as filled orders

0 commit comments

Comments
 (0)