* @method * @name pacifica#fetchSwapMarkets * @description retrieves data on all swap markets for pacifica * @see https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info * @param {object} [params] extra parameters specific to the exchange API endpoint
(params = {})
| 432 | * @returns {object[]} an array of objects representing market data |
| 433 | */ |
| 434 | async fetchSwapMarkets(params = {}) { |
| 435 | const response = await this.publicGetInfo(params); // meta |
| 436 | // { |
| 437 | // "success": true, |
| 438 | // "data": [ |
| 439 | // { |
| 440 | // "symbol": "ETH", |
| 441 | // "tick_size": "0.1", |
| 442 | // "min_tick": "0", |
| 443 | // "max_tick": "1000000", |
| 444 | // "lot_size": "0.0001", |
| 445 | // "max_leverage": 50, |
| 446 | // "isolated_only": false, |
| 447 | // "min_order_size": "10", |
| 448 | // "max_order_size": "5000000", |
| 449 | // "funding_rate": "0.0000125", |
| 450 | // "next_funding_rate": "0.0000125", |
| 451 | // "created_at": 1748881333944 |
| 452 | // }, |
| 453 | // { |
| 454 | // "symbol": "BTC", |
| 455 | // "tick_size": "1", |
| 456 | // "min_tick": "0", |
| 457 | // "max_tick": "1000000", |
| 458 | // "lot_size": "0.00001", |
| 459 | // "max_leverage": 50, |
| 460 | // "isolated_only": false, |
| 461 | // "min_order_size": "10", |
| 462 | // "max_order_size": "5000000", |
| 463 | // "funding_rate": "0.0000125", |
| 464 | // "next_funding_rate": "0.0000125", |
| 465 | // "created_at": 1748881333944 |
| 466 | // }, |
| 467 | // .... |
| 468 | // ], |
| 469 | // "error": null, |
| 470 | // "code": null |
| 471 | // } |
| 472 | const meta = this.safeList(response, 'data', []); |
| 473 | const results = []; |
| 474 | for (let i = 0; i < meta.length; i++) { |
| 475 | results.push(meta[i]); |
| 476 | } |
| 477 | return this.parseMarkets(results); |
| 478 | } |
| 479 | parseMarket(market) { |
| 480 | // { |
| 481 | // "symbol": "ETH", |
no test coverage detected