* Margin account borrow/loan * @param {string} asset - the asset * @param {number} amount - the asset * @param {string} isIsolated - the isolated option * @param {string} symbol - symbol for isolated margin * @return {undefined}
(asset: string, amount: number, isIsolated = 'FALSE', symbol?: string, params: Dict = {})
| 5585 | * @return {undefined} |
| 5586 | */ |
| 5587 | async mgBorrow(asset: string, amount: number, isIsolated = 'FALSE', symbol?: string, params: Dict = {}) { |
| 5588 | const parameters = Object.assign({ asset: asset, amount: amount }); |
| 5589 | if (isIsolated === 'TRUE' && !symbol) throw new Error('If "isIsolated" = "TRUE", "symbol" must be sent'); |
| 5590 | const isolatedObj = isIsolated === 'TRUE' ? { |
| 5591 | isIsolated, |
| 5592 | symbol |
| 5593 | } : {}; |
| 5594 | return await this.privateSapiRequest('v1/margin/loan', this.extend({ ...parameters, ...isolatedObj }, params), 'POST'); |
| 5595 | } |
| 5596 | |
| 5597 | /** |
| 5598 | * Margin account borrow/loan |
nothing calls this directly
no test coverage detected