* @method * @name coinbase#fetchTime * @description fetches the current integer timestamp in milliseconds from the exchange server * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/time * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/publ
(params = {})
| 519 | * @returns {int} the current integer timestamp in milliseconds from the exchange server |
| 520 | */ |
| 521 | async fetchTime (params = {}): Promise<Int> { |
| 522 | const defaultMethod = this.safeString (this.options, 'fetchTime', 'v2PublicGetTime'); |
| 523 | const method = this.safeString (params, 'method', defaultMethod); |
| 524 | params = this.omit (params, 'method'); |
| 525 | let response: NullableDict = undefined; |
| 526 | if (method === 'v2PublicGetTime') { |
| 527 | response = await this.v2PublicGetTime (params); |
| 528 | // |
| 529 | // { |
| 530 | // "data": { |
| 531 | // "epoch": 1589295679, |
| 532 | // "iso": "2020-05-12T15:01:19Z" |
| 533 | // } |
| 534 | // } |
| 535 | // |
| 536 | response = this.safeDict (response, 'data', {}); |
| 537 | } else { |
| 538 | response = await this.v3PublicGetBrokerageTime (params); |
| 539 | // |
| 540 | // { |
| 541 | // "iso": "2024-02-27T03:37:14Z", |
| 542 | // "epochSeconds": "1709005034", |
| 543 | // "epochMillis": "1709005034333" |
| 544 | // } |
| 545 | // |
| 546 | } |
| 547 | return this.safeTimestamp2 (response, 'epoch', 'epochSeconds'); |
| 548 | } |
| 549 | |
| 550 | /** |
| 551 | * @method |
nothing calls this directly
no test coverage detected