* @method * @name gate#loadUnifiedStatus * @param {object} [params] extra parameters specific to the exchange API endpoint * @description returns unifiedAccount so the user can check if the unified account is enabled * @see https://www.gate.com/docs/developers/apiv4/#retrieve-use
(params = {})
| 1172 | * @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined |
| 1173 | */ |
| 1174 | async loadUnifiedStatus(params = {}) { |
| 1175 | const unifiedAccount = this.safeBool(this.options, 'unifiedAccount'); |
| 1176 | if (unifiedAccount === undefined) { |
| 1177 | try { |
| 1178 | // |
| 1179 | // { |
| 1180 | // "user_id": 10406147, |
| 1181 | // "ip_whitelist": [], |
| 1182 | // "currency_pairs": [], |
| 1183 | // "key": { |
| 1184 | // "mode": 1 |
| 1185 | // }, |
| 1186 | // "tier": 0, |
| 1187 | // "tier_expire_time": "0001-01-01T00:00:00Z", |
| 1188 | // "copy_trading_role": 0 |
| 1189 | // } |
| 1190 | // |
| 1191 | const response = await this.privateAccountGetDetail(params); |
| 1192 | const result = this.safeDict(response, 'key', {}); |
| 1193 | this.options['unifiedAccount'] = this.safeInteger(result, 'mode') === 2; |
| 1194 | } |
| 1195 | catch (e) { |
| 1196 | // if the request fails, the unifiedAccount is disabled |
| 1197 | this.options['unifiedAccount'] = false; |
| 1198 | } |
| 1199 | } |
| 1200 | return this.options['unifiedAccount']; |
| 1201 | } |
| 1202 | async upgradeUnifiedTradeAccount(params = {}) { |
| 1203 | return await this.privateUnifiedPutUnifiedMode(params); |
| 1204 | } |
no test coverage detected