pattern-tech / gateway

Middleware that standardizes DEX API endpoints on different blockchain networks
Apache License 2.0
1 stars 1 forks source link

[BUG]: init method does not work #30

Closed hirotadashi closed 1 month ago

hirotadashi commented 2 months ago

I want to run init method to be able to test further manual tests but init is not working and returning this error:

UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".
    at throwUnhandledRejectionsMode (node:internal/process/promises:389:7)
    at processPromiseRejections (node:internal/process/promises:470:17)
    at processTicksAndRejections (node:internal/process/task_queues:96:32) {
  code: 'ERR_UNHANDLED_REJECTION'
}

this is the core I try to run:

import { Ergo } from './ergo';

const ergo = new Ergo('Testnet');
(async function x() {
  await ergo.init();
})();
hirotadashi commented 2 months ago

there is not any problem with this. Please check your internet connection.

satiparpar commented 2 months ago

thanks, @hirotadashi, you were right! just in case of confidence: Is that AggregateError ok? I will share with you a small part of the output:

AggregateError
    at internalConnectMultiple (node:net:1117:18)
    at internalConnectMultiple (node:net:1185:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1711:5)
    at listOnTimeout (node:internal/timers:575:11)
    at processTimers (node:internal/timers:514:7) {
  code: 'ETIMEDOUT',
  config: {
    url: '/api/v1/boxes/unspent/byErgoTree/1999030f0400040204020404040405feffffffffffffffff0105feffffffffffffffff01050004d00f040004000406050005000580dac409d819d601b2a5730000d602e4c6a70404d603db63087201d604db6308a7d605b27203730100d606b27204730200d607b27203730300d608b27204730400d6099973058c720602d60a999973068c7205027209d60bc17201d60cc1a7d60d99720b720cd60e91720d7307d60f8c720802d6107e720f06d6117e720d06d612998c720702720fd6137e720c06d6147308d6157e721206d6167e720a06d6177e720906d6189c72117217d6199c72157217d1ededededededed93c27201c2a793e4c672010404720293b27203730900b27204730a00938c7205018c720601938c7207018c72080193b17203730b9593720a730c95720e929c9c721072117e7202069c7ef07212069a9c72137e7214067e9c720d7e72020506929c9c721372157e7202069c7ef0720d069a9c72107e7214067e9c72127e7202050695ed720e917212730d907216a19d721872139d72197210ed9272189c721672139272199c7216721091720b730e',
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/0.21.4'
    },
    params: { limit: 100000000000, offset: 100000000000 },
    baseURL: 'https://api.ergoplatform.com/api/v1/',
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [Function: transformResponse],
    timeout: 20000,
    adapter: [Function: httpAdapter],
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    method: 'get',
    data: undefined
  },
  request: <ref *1> Writable {