(balance)
| 1841 | } |
| 1842 | |
| 1843 | parseSwapBalance (balance): Balances { |
| 1844 | // |
| 1845 | // { |
| 1846 | // "balance": "30.63364672", |
| 1847 | // "availableBalance": "28.85635534", |
| 1848 | // "positionMargin": "4.3421", |
| 1849 | // "orderMargin": "0", |
| 1850 | // "asset": "USDT", |
| 1851 | // "crossUnRealizedPnl": "2.5649" |
| 1852 | // } |
| 1853 | // |
| 1854 | const currencyId = this.safeString (balance, 'asset'); |
| 1855 | const code = this.safeCurrencyCode (currencyId); |
| 1856 | const account = this.account (); |
| 1857 | account['total'] = this.safeString (balance, 'balance'); |
| 1858 | const positionMargin = this.safeString (balance, 'positionMargin'); |
| 1859 | const orderMargin = this.safeString (balance, 'orderMargin'); |
| 1860 | account['used'] = Precise.stringAdd (positionMargin, orderMargin); |
| 1861 | const result: Dict = { |
| 1862 | 'info': balance, |
| 1863 | }; |
| 1864 | result[code] = account; |
| 1865 | return this.safeBalance (result); |
| 1866 | } |
| 1867 | |
| 1868 | /** |
| 1869 | * @method |
no test coverage detected