* @method * @name pacifica#setLeverage * @description set the level of leverage for a market * @see https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage * @param {float} leverage the rate of leverage * @param {string} symbol unified market symbol
(leverage, symbol = undefined, params = {})
| 2535 | * @returns {object} response from the exchange |
| 2536 | */ |
| 2537 | async setLeverage(leverage, symbol = undefined, params = {}) { |
| 2538 | const operationType = 'update_leverage'; |
| 2539 | if (symbol === undefined) { |
| 2540 | throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument'); |
| 2541 | } |
| 2542 | await this.loadMarkets(); |
| 2543 | const market = this.market(symbol); |
| 2544 | const sigPayload = { |
| 2545 | 'symbol': market['id'], |
| 2546 | 'leverage': leverage, |
| 2547 | }; |
| 2548 | const request = this.postActionRequest(operationType, sigPayload, params); |
| 2549 | params = this.omit(params, ['expiryWindow']); |
| 2550 | const response = await this.privatePostAccountLeverage(request); |
| 2551 | // { |
| 2552 | // "success": true |
| 2553 | // } |
| 2554 | return response; |
| 2555 | } |
| 2556 | /** |
| 2557 | * @method |
| 2558 | * @name pacifica#withdraw |
nothing calls this directly
no test coverage detected