crossIsolatedMarginSwitch method
Switch Cross/Isolated; must set leverage value when switching from Cross to Isolated. https://bybit-exchange.github.io/docs/inverse/#t-marginswitch
Implementation
Future<Map<String, dynamic>?> crossIsolatedMarginSwitch({
required String symbol,
required bool isIsolated,
required double buyLeverage,
required double sellLeverage,
}) async {
log.d('ByBitRest.crossIsolatedMarginSwitch');
var parameters = <String, dynamic>{};
parameters['symbol'] = symbol;
parameters['is_isolated'] = isIsolated;
parameters['buy_leverage'] = buyLeverage;
parameters['sell_leverage'] = sellLeverage;
return await request(
path: '/v2/private/position/switch-isolated',
type: 'POST',
parameters: parameters,
withAuthentication: true,
);
}