MCPcopy Create free account
hub / github.com/ccxt/ccxt / setMarginMode

Method setMarginMode

js/src/pacifica.js:2506–2525  ·  view source on GitHub ↗

* @method * @name pacifica#setMarginMode * @description set margin mode (symbol) * @see https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode * @param {string} marginMode margin mode must be either [isolated, cross] * @param {string} symbol unifi

(marginMode, symbol = undefined, params = {})

Source from the content-addressed store, hash-verified

2504 * @returns {object} response from the exchange
2505 */
2506 async setMarginMode(marginMode, symbol = undefined, params = {}) {
2507 const operationType = 'update_margin_mode';
2508 if (symbol === undefined) {
2509 throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
2510 }
2511 await this.loadMarkets();
2512 const market = this.market(symbol);
2513 const isIsolated = (marginMode === 'isolated');
2514 const sigPayload = {
2515 'symbol': market['id'],
2516 'is_isolated': isIsolated,
2517 };
2518 const request = this.postActionRequest(operationType, sigPayload, params);
2519 params = this.omit(params, ['expiryWindow']);
2520 const response = await this.privatePostAccountMargin(request);
2521 // {
2522 // "success": true
2523 // }
2524 return response;
2525 }
2526 /**
2527 * @method
2528 * @name pacifica#setLeverage

Callers

nothing calls this directly

Calls 5

postActionRequestMethod · 0.95
loadMarketsMethod · 0.45
marketMethod · 0.45
omitMethod · 0.45

Tested by

no test coverage detected