feat(exmo): fetchMyTrades - margin
diff --git a/ts/src/exmo.ts b/ts/src/exmo.ts
index cc1980fff384..177e15feeb61 100644
--- a/ts/src/exmo.ts
+++ b/ts/src/exmo.ts
@@ -1188,17 +1188,16 @@ export default class exmo extends Exchange {
         //         "commission_percent": "0.2"
         //     }
         //
-        // margin
+        // fetchMyTrades (margin)
         //
         //    {
-        //        "is_maker": false,
-        //        "order_id": "123",
-        //        "pair": "BTC_USD",
-        //        "price": "54122.25",
-        //        "quantity": "0.00069994",
-        //        "trade_dt": "1619069561718824428",
-        //        "trade_id": "692842802860135010",
-        //        "type": "sell"
+        //        "trade_id": "692861757015952517",
+        //        "trade_dt": "1693951853197811824",
+        //        "trade_type": "buy",
+        //        "pair": "ADA_USDT",
+        //        "quantity": "1.96607879",
+        //        "price": "0.2568",
+        //        "amount": "0.50488903"
         //    }
         //
         const timestamp = this.safeTimestamp (trade, 'date');
@@ -1207,7 +1206,7 @@ export default class exmo extends Exchange {
         const priceString = this.safeString (trade, 'price');
         const amountString = this.safeString (trade, 'quantity');
         const costString = this.safeString (trade, 'amount');
-        const side = this.safeString (trade, 'type');
+        const side = this.safeString2 (trade, 'type', 'trade_type');
         const type = undefined;
         const marketId = this.safeString (trade, 'pair');
         market = this.safeMarket (marketId, market, '_');
@@ -1298,37 +1297,89 @@ export default class exmo extends Exchange {
          * @method
          * @name exmo#fetchMyTrades
          * @description fetch all trades made by the user
-         * @param {string} symbol unified market symbol
+         * @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#b8d8d9af-4f46-46a1-939b-ad261d79f452  // spot
+         * @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#f4b1aaf8-399f-403b-ab5e-4926d967a106  // margin
+         * @param {string} symbol a symbol is required but it can be a single string, or a non-empty array
          * @param {int} [since] the earliest time in ms to fetch trades for
-         * @param {int} [limit] the maximum number of trades structures to retrieve
+         * @param {int} [limit] *required for margin orders* the maximum number of trades structures to retrieve
          * @param {object} [params] extra parameters specific to the exmo api endpoint
+         *
+         * EXCHANGE SPECIFIC PARAMETERS
+         * @param {int} [params.offset] last deal offset, default = 0
          * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
          */
-        // a symbol is required but it can be a single string, or a non-empty array
-        if (symbol === undefined) {
-            throw new ArgumentsRequired (this.id + ' fetchMyTrades() requires a symbol argument (a single symbol or an array)');
+        this.checkRequiredSymbol ('fetchMyTrades', symbol);
+        let marginMode = undefined;
+        [ marginMode, params ] = this.handleMarginModeAndParams ('fetchMyTrades', params);
+        if (marginMode === 'cross') {
+            throw new BadRequest (this.id + 'only isolated margin is supported');
         }
         await this.loadMarkets ();
-        let pair = undefined;
-        let market = undefined;
-        if (Array.isArray (symbol)) {
-            const numSymbols = symbol.length;
-            if (numSymbols < 1) {
-                throw new ArgumentsRequired (this.id + ' fetchMyTrades() requires a non-empty symbol array');
-            }
-            const marketIds = this.marketIds (symbol);
-            pair = marketIds.join (',');
+        const market = this.market (symbol);
+        const pair = market['id'];
+        const isSpot = marginMode !== 'isolated';
+        if (limit === undefined) {
+            limit = 100;
+        }
+        const request = {};
+        if (isSpot) {
+            request['pair'] = pair;
         } else {
-            market = this.market (symbol);
-            pair = market['id'];
+            request['pair_name'] = pair;
         }
-        const request = {
-            'pair': pair,
-        };
         if (limit !== undefined) {
             request['limit'] = limit;
         }
-        const response = await this.privatePostUserTrades (this.extend (request, params));
+        const offset = this.safeInteger (params, 'offset', 0);
+        request['offset'] = offset;
+        let response = undefined;
+        if (isSpot) {
+            response = await this.privatePostUserTrades (this.extend (request, params));
+            //
+            //    {
+            //        "BTC_USD": [
+            //            {
+            //                "trade_id": 20056872,
+            //                "client_id": 100500,
+            //                "date": 1435488248,
+            //                "type": "buy",
+            //                "pair": "BTC_USD",
+            //                "quantity": "1",
+            //                "price": "100",
+            //                "amount": "100",
+            //                "order_id": 7,
+            //                "parent_order_id": 117684023830293,
+            //                "exec_type": "taker",
+            //                "commission_amount": "0.02",
+            //                "commission_currency": "BTC",
+            //                "commission_percent": "0.2"
+            //            }
+            //        ],
+            //        ...
+            //    }
+            //
+        } else {
+            const responseFromExchange = await this.privatePostMarginTrades (this.extend (request, params));
+            //
+            //    {
+            //        "trades": {
+            //            "ADA_USDT": [
+            //                {
+            //                    "trade_id": "692861757015952517",
+            //                    "trade_dt": "1693951853197811824",
+            //                    "trade_type": "buy",
+            //                    "pair": "ADA_USDT",
+            //                    "quantity": "1.96607879",
+            //                    "price": "0.2568",
+            //                    "amount": "0.50488903"
+            //                },
+            //            ]
+            //            ...
+            //        }
+            //    }
+            //
+            response = this.safeValue (responseFromExchange, 'trades');
+        }
         let result = [];
         const marketIdsInner = Object.keys (response);
         for (let i = 0; i < marketIdsInner.length; i++) {

```
% exmo fetchMyTrades ADA/USDT undefined 100 '{"marginMode": "isolated"}' | condense
2023-09-05T22:47:47.544Z
Node.js: v18.15.0
CCXT v4.0.83
exmo.fetchMyTrades (ADA/USDT, , 100, [object Object])
2023-09-05T22:47:51.406Z iteration 0 passed in 509 ms
                id | timestamp | datetime |   symbol | order | type | side | takerOrMaker |      price |     amount |        cost | fee | fees
----------------------------------------------------------------------------------------------------------------------------------------------
692861757016564983 |           |          | ADA/USDT |       |      |  buy |              |     0.2571 | 1.96607879 |  0.50547885 |     |   []
...
692861757019668012 |           |          | ADA/USDT |       |      |  buy |              |      0.257 | 1.96607879 |  0.50528224 |     |   []
100 objects
2023-09-05T22:47:51.406Z iteration 1 passed in 509 ms
```

```
Python v3.11.3
CCXT v4.0.83
exmo.fetchMyTrades(ADA/USDT,None,100,{'marginMode': 'isolated'})
[{'amount': 1.96607879,
  'cost': 0.50528224,
  'datetime': None,
  'fee': None,
  'fees': [],
  'id': '692861757016994152',
  'info': {'amount': '0.50528224',
           'pair': 'ADA_USDT',
           'price': '0.257',
           'quantity': '1.96607879',
           'trade_dt': '1693952480723152404',
           'trade_id': '692861757016994152',
           'trade_type': 'buy'},
  'order': None,
  'price': 0.257,
  'side': 'buy',
  'symbol': 'ADA/USDT',
  'takerOrMaker': None,
  'timestamp': None,
  'type': None},
 ...
  {'amount': 28.0,
  'cost': 7.19167988,
  'datetime': None,
  'fee': None,
  'fees': [],
  'id': '692861757020122630',
  'info': {'amount': '7.19167988',
           'pair': 'ADA_USDT',
           'price': '0.25684571',
           'quantity': '28',
           'trade_dt': '1693954337193924899',
           'trade_id': '692861757020122630',
           'trade_type': 'buy'},
  'order': None,
  'price': 0.25684571,
  'side': 'buy',
  'symbol': 'ADA/USDT',
  'takerOrMaker': None,
  'timestamp': None,
  'type': None}]
```