pi-apps / pi-nodejs

Other
51 stars 13 forks source link

Erron on create payment #7

Closed LeVarez closed 1 year ago

LeVarez commented 1 year ago

Seems it's impossible to create a payment with the current body data... I don't know exactly how the api works but I'm getting this error:

AxiosError: Request failed with status code 401
    at settle (file:///E:/Documents/PiStake-Poker/web/node_modules/axios/lib/core/settle.js:19:12)
    at IncomingMessage.handleStreamEnd (file:///E:/Documents/PiStake-Poker/web/node_modules/axios/lib/adapters/http.js:541:11)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I create an instance of PiNetwork class with the following valid attributes: (apiKey, walletPrivateSeed and options {baseUrl: 'https://api.minepi.com' }).

The payment data is this...

{
   payment: {
      amount: 1,
      memo: 'Refund for apple pie',
      metadata: { productId: 'apple-pie-1' },
      uid: 'bla bla bla bla' (won't share a user uid)
    }
}

This error happens on the following source code: (index.ts)

public createPayment = async (paymentData: PaymentArgs): Promise<string> => {
    this.validatePaymentData(paymentData);
    const axiosClient = getAxiosClient(this.API_KEY, this.axiosOptions);
    const body = { payment: paymentData };
    const response = await axiosClient.post('/v2/payments', body);
    this.currentPayment = response.data;
    return response.data.identifier;
  };

Any ideas?

hklee93 commented 1 year ago

Hi, can you check the error again? 401 is unauthorized. Also you don't need to pass options, and for payment data, please refer to the example again. No need to wrap with payment again as it's already handled by the SDK.

LeVarez commented 1 year ago

The last error happens if i download the source code and use it directly on my app. If i try to use the node package (pi-backend) then the error I've got is this:

Error: connect ECONNREFUSED ::1:8080
    at AxiosError.from (E:\Documents\PiStake-Poker\web\node_modules\axios\dist\node\axios.cjs:823:14)
    at RedirectableRequest.handleRequestError (E:\Documents\PiStake-Poker\web\node_modules\axios\dist\node\axios.cjs:2953:25)
    at RedirectableRequest.emit (node:events:525:35)
    at eventHandlers.<computed> (E:\Documents\PiStake-Poker\web\node_modules\follow-redirects\index.js:14:24)
    at ClientRequest.emit (node:events:513:28)
    at Socket.socketErrorListener (node:_http_client:488:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

In my server:

 const PI = new PiNewtork(PI_API_KEY, PI_WALLET_PRIVATE_SEED);
  const paymentData = {
    amount: 1,
    memo: "Refund for apple pie", // this is just an example
    metadata: { productId: "apple-pie-1" },
    uid: userUid
  }
  const paymentId = await PI.createPayment(paymentData);

The API key and PI private seed are the ones given by the developer portal on Pi browser

hklee93 commented 1 year ago

Not sure what you mean by downloading the source code. Can you confirm that you installed directly with npm? Also can you wrap your code w/ try catch and see what the exact error is? It's hard to tell what's actually causing the issue

LeVarez commented 1 year ago

Yes, I installed directly with npm. And that's the error i get when i wrap with try catch:

 try {
    const paymentData = {
      amount: 1,
      memo: "Refund for apple pie", // this is just an example
      metadata: { productId: "apple-pie-1" },
      uid: userUid
    }
    const PI = new PiNewtork(PI_API_KEY, PI_WALLET_PRIVATE_SEED);
    const paymentId = await PI.createPayment(paymentData);
  }
  catch (e) {
    console.log(e)
  }

error output:


{
  port: 8080,
  address: '::1',
  syscall: 'connect',
  code: 'ECONNREFUSED',
  errno: -4078,
  message: 'connect ECONNREFUSED ::1:8080',
  name: 'Error',
  config: {
    transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false },
    adapter: Array(2) [ 'xhr', 'http' ],
    transformRequest: Array(1) [ 0: λ:transformRequest ],
    transformResponse: Array(1) [ 0: λ:transformResponse ],
    timeout: 20000,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: {},
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      Authorization: 'Key bla bla bla bla',
      'User-Agent': 'axios/1.3.0',
      'Content-Length': '138',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    baseURL: 'http://localhost:8080',
    method: 'post',
    url: '/v2/payments',
    data: 
      '{"payment":{"amount":1,"memo":"Refund for apple pie","metadata":{"productId":"apple-pie-1"},"uid":"bla bla bla bla"}}'
  },
  request: Writable {
    _writableState: WritableState {
      objectMode: false,
      highWaterMark: 16384,
      finalCalled: false,
      needDrain: false,
      ending: false,
      ended: false,
      finished: false,
      destroyed: false,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      length: 0,
      writing: false,
      corked: 0,
      sync: true,
      bufferProcessing: false,
      writecb: null,
      writelen: 0,
      afterWriteTickInfo: null,
      buffered: [],
      bufferedIndex: 0,
      allBuffers: true,
      allNoop: true,
      pendingcb: 0,
      constructed: true,
      prefinished: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      errored: null,
      closed: false,
      closeEmitted: false,
      Symbol(kOnFinished): []
    },
    _events: { socket: Array(2) [ 0: λ:handleRequestSocket, 1: λ:destroyOnTimeout ] },
    _eventsCount: 3,
    _maxListeners: undefined,
    _options: {
      maxRedirects: 21,
      maxBodyLength: Infinity,
      protocol: 'http:',
      path: '/v2/payments',
      method: 'POST',
      headers: {
        Accept: 'application/json, text/plain, */*',
        'Content-Type': 'application/json',
        Authorization: 'Key bla bla bla bla',
        'User-Agent': 'axios/1.3.0',
        'Content-Length': '138',
        'Accept-Encoding': 'gzip, compress, deflate, br'
      },
      agents: { http: undefined, https: undefined },
      auth: undefined,
      beforeRedirects: {},
      hostname: 'localhost',
      port: '8080',
      agent: undefined,
      nativeProtocols: {
        'http:': {
          METHODS: Array(34) [
            'ACL', 'BIND', 'CHECKOUT', 'CONNECT', 'COPY', 'DELETE', 'GET', 'HEAD', 'LINK', 'LOCK', 'M-SEARCH', 'MERGE', 'MKACTIVITY',
            'MKCALENDAR', 'MKCOL', 'MOVE', 'NOTIFY', 'OPTIONS', 'PATCH', 'POST', 'PROPFIND', 'PROPPATCH', 'PURGE', 'PUT',
            'REBIND', 'REPORT', 'SEARCH', 'SOURCE', 'SUBSCRIBE', 'TRACE', 'UNBIND', 'UNLINK', 'UNLOCK', 'UNSUBSCRIBE'
          ],
          STATUS_CODES: {
            100: 'Continue',
            101: 'Switching Protocols',
            102: 'Processing',
            103: 'Early Hints',
            200: 'OK',
            201: 'Created',
            202: 'Accepted',
            203: 'Non-Authoritative Information',
            204: 'No Content',
            205: 'Reset Content',
            206: 'Partial Content',
            207: 'Multi-Status',
            208: 'Already Reported',
            226: 'IM Used',
            300: 'Multiple Choices',
            301: 'Moved Permanently',
            302: 'Found',
            303: 'See Other',
            304: 'Not Modified',
            305: 'Use Proxy',
            307: 'Temporary Redirect',
            308: 'Permanent Redirect',
            400: 'Bad Request',
            401: 'Unauthorized',
            402: 'Payment Required',
            403: 'Forbidden',
            404: 'Not Found',
            405: 'Method Not Allowed',
            406: 'Not Acceptable',
            407: 'Proxy Authentication Required',
            408: 'Request Timeout',
            409: 'Conflict',
            410: 'Gone',
            411: 'Length Required',
            412: 'Precondition Failed',
            413: 'Payload Too Large',
            414: 'URI Too Long',
            415: 'Unsupported Media Type',
            416: 'Range Not Satisfiable',
            417: 'Expectation Failed',
            418: 'I\'m a Teapot',
            421: 'Misdirected Request',
            422: 'Unprocessable Entity',
            423: 'Locked',
            424: 'Failed Dependency',
            425: 'Too Early',
            426: 'Upgrade Required',
            428: 'Precondition Required',
            429: 'Too Many Requests',
            431: 'Request Header Fields Too Large',
            451: 'Unavailable For Legal Reasons',
            500: 'Internal Server Error',
            501: 'Not Implemented',
            502: 'Bad Gateway',
            503: 'Service Unavailable',
            504: 'Gateway Timeout',
            505: 'HTTP Version Not Supported',
            506: 'Variant Also Negotiates',
            507: 'Insufficient Storage',
            508: 'Loop Detected',
            509: 'Bandwidth Limit Exceeded',
            510: 'Not Extended',
            511: 'Network Authentication Required'
          },
          maxHeaderSize: 16384,
          globalAgent: Agent {
            _events: {},
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 80,
            protocol: 'http:',
            options: { keepAlive: true, scheduling: 'lifo', timeout: 5000, noDelay: true, path: null },
            requests: {},
            sockets: {
              'localhost:8080:': Array(1) [
                Socket {
                  connecting: false,
                  _hadError: true,
                  _parent: null,
                  _host: 'localhost',
                  _closeAfterHandlingError: false,
                  _readableState: ReadableState {
                    objectMode: false,
                    highWaterMark: 16384,
                    buffer: BufferList {...},
                    length: 0,
                    pipes: [],
                    flowing: true,
                    ended: false,
                    endEmitted: false,
                    reading: true,
                    constructed: true,
                    sync: false,
                    needReadable: true,
                    emittedReadable: false,
                    readableListening: false,
                    resumeScheduled: false,
                    errorEmitted: true,
                    emitClose: false,
                    autoDestroy: true,
                    destroyed: true,
                    errored: Error {...},
                    closed: true,
                    closeEmitted: true,
                    defaultEncoding: 'utf8',
                    awaitDrainWriters: null,
                    multiAwaitDrain: false,
                    readingMore: false,
                    dataEmitted: false,
                    decoder: null,
                    encoding: null,
                    Symbol(kPaused): false
                  },
                  _events: { connect: Array(3) [...], close: Array(2) [...], timeout: Array(3) [...] },
                  _eventsCount: 8,
                  _maxListeners: undefined,
                  _writableState: WritableState {
                    objectMode: false,
                    highWaterMark: 16384,
                    finalCalled: false,
                    needDrain: false,
                    ending: false,
                    ended: false,
                    finished: false,
                    destroyed: true,
                    decodeStrings: false,
                    defaultEncoding: 'utf8',
                    length: 466,
                    writing: true,
                    corked: 0,
                    sync: false,
                    bufferProcessing: false,
                    writelen: 466,
                    afterWriteTickInfo: null,
                    buffered: [],
                    bufferedIndex: 0,
                    allBuffers: true,
                    allNoop: true,
                    pendingcb: 1,
                    constructed: true,
                    prefinished: false,
                    errorEmitted: true,
                    emitClose: false,
                    autoDestroy: true,
                    errored: Error {...},
                    closed: true,
                    closeEmitted: true,
                    Symbol(kOnFinished): []
                  },
                  allowHalfOpen: false,
                  _sockname: null,
                  _pendingData: Array(2) [ {...}, {...}, allBuffers: false ],
                  _pendingEncoding: '',
                  server: null,
                  _server: null,
                  timeout: 20000,
                  parser: null,
                  _httpMessage: ClientRequest {
                    _events: {...},
                    _eventsCount: 7,
                    _maxListeners: undefined,
                    outputData: [],
                    outputSize: 0,
                    writable: true,
                    destroyed: false,
                    _last: false,
                    chunkedEncoding: false,
                    shouldKeepAlive: true,
                    maxRequestsOnConnectionReached: false,
                    _defaultKeepAlive: true,
                    useChunkedEncodingByDefault: true,
                    sendDate: false,
                    _removedConnection: false,
                    _removedContLen: false,
                    _removedTE: false,
                    strictContentLength: false,
                    _contentLength: '138',
                    _hasBody: true,
                    _trailer: '',
                    finished: false,
                    _headerSent: true,
                    _closed: false,
                    socket: Socket {...},
                    _header: 'POST /v2/payments HTTP/1.1\r\n' +
                      'Accept: application/json, text/plain, */*\r\n' +
                      'Content-Type: application/json\r\n' +
                      'Authorization: Key bla bla bla bla\r\n' +
                      'User-Agent: axios/1.3.0\r\n' +
                      'Content-Length: 138\r\n' +
                      'Accept-Encoding: gzip, compress, deflate, br\r\n' +
                      'Host: localhost:8080\r\n' +
                      'Connection: keep-alive\r\n' +
                      '\r\n' +
                      '',
                    _keepAliveTimeout: 0,
                    agent: Agent {...},
                    socketPath: undefined,
                    method: 'POST',
                    maxHeaderSize: undefined,
                    insecureHTTPParser: undefined,
                    path: '/v2/payments',
                    _ended: false,
                    res: null,
                    aborted: false,
                    upgradeOrConnect: false,
                    parser: null,
                    maxHeadersCount: null,
                    reusedSocket: false,
                    host: 'localhost',
                    protocol: 'http:',
                    _redirectable: Writable {...},
                    headersSent: true,
                    Symbol(kCapture): false,
                    Symbol(kBytesWritten): 0,
                    Symbol(kEndCalled): false,
                    Symbol(kNeedDrain): false,
                    Symbol(corked): 0,
                    Symbol(kOutHeaders): {...},
                    Symbol(kUniqueHeaders): null
                  },
                  bytesRead: 0,
                  remoteAddress: undefined,
                  remoteFamily: undefined,
                  remotePort: undefined,
                  localAddress: undefined,
                  localPort: undefined,
                  localFamily: undefined,
                  _bytesDispatched: 0,
                  bytesWritten: 466,
                  Symbol(async_id_symbol): 4451,
                  Symbol(kHandle): null,
                  Symbol(lastWriteQueueSize): 0,
                  Symbol(timeout): Timeout {
                    _idleTimeout: -1,
                    _idlePrev: null,
                    _idleNext: null,
                    _idleStart: 165913,
                    _onTimeout: null,
                    _timerArgs: undefined,
                    _repeat: null,
                    _destroyed: true,
                    Symbol(refed): false,
                    Symbol(kHasPrimitive): false,
                    Symbol(asyncId): 4460,
                    Symbol(triggerId): 4453
                  },
                  Symbol(kBuffer): null,
                  Symbol(kBufferCb): null,
                  Symbol(kBufferGen): null,
                  Symbol(kCapture): false,
                  Symbol(kSetNoDelay): true,
                  Symbol(kSetKeepAlive): true,
                  Symbol(kSetKeepAliveInitialDelay): 60,
                  Symbol(kBytesRead): 0,
                  Symbol(kBytesWritten): 0
                }
              ]
            },
            freeSockets: {},
            keepAliveMsecs: 1000,
            keepAlive: true,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 1,
            Symbol(kCapture): false
          }
        },
        'https:': {
          globalAgent: Agent {
            _events: {},
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 443,
            protocol: 'https:',
            options: { keepAlive: true, scheduling: 'lifo', timeout: 5000, noDelay: true, path: null },
            requests: {},
            sockets: {},
            freeSockets: {},
            keepAliveMsecs: 1000,
            keepAlive: true,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 0,
            maxCachedSessions: 100,
            _sessionCache: { map: {}, list: [] },
            Symbol(kCapture): false
          }
        }
      },
      pathname: '/v2/payments'
    },
    _ended: false,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 138,
    _requestBodyBuffers: Array(1) [ { data: Buffer {}, encoding: undefined } ],
    _currentRequest: ClientRequest {
      _events: {},
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: false,
      chunkedEncoding: false,
      shouldKeepAlive: true,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: '138',
      _hasBody: true,
      _trailer: '',
      finished: false,
      _headerSent: true,
      _closed: false,
      socket: Socket {
        connecting: false,
        _hadError: true,
        _parent: null,
        _host: 'localhost',
        _closeAfterHandlingError: false,
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: true,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: true,
          emitClose: false,
          autoDestroy: true,
          destroyed: true,
          errored: Error {
            errno: -4078,
            code: 'ECONNREFUSED',
            syscall: 'connect',
            address: '::1',
            port: 8080,
            stack: 'Error: connect ECONNREFUSED ::1:8080\n' +
              '    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1283:16)',
            message: 'connect ECONNREFUSED ::1:8080'
          },
          closed: true,
          closeEmitted: true,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: false,
          decoder: null,
          encoding: null,
          Symbol(kPaused): false
        },
        _events: {
          connect: Array(3) [ 0: λ:bound onceWrapper, 1: λ:bound onceWrapper, 2: λ:bound onceWrapper ],
          close: Array(2) [ 0: λ:onClose, 1: λ:socketCloseListener ],
          timeout: Array(3) [ 0: λ:onTimeout, 1: λ:bound onceWrapper, 2: λ:destroy ]
        },
        _eventsCount: 8,
        _maxListeners: undefined,
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: false,
          needDrain: false,
          ending: false,
          ended: false,
          finished: false,
          destroyed: true,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 466,
          writing: true,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          writelen: 466,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: true,
          emitClose: false,
          autoDestroy: true,
          errored: Error {
            errno: -4078,
            code: 'ECONNREFUSED',
            syscall: 'connect',
            address: '::1',
            port: 8080,
            stack: 'Error: connect ECONNREFUSED ::1:8080\n' +
              '    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1283:16)',
            message: 'connect ECONNREFUSED ::1:8080'
          },
          closed: true,
          closeEmitted: true,
          Symbol(kOnFinished): []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: Array(2) [
          {
            chunk: 'POST /v2/payments HTTP/1.1\r\n' +
              'Accept: application/json, text/plain, */*\r\n' +
              'Content-Type: application/json\r\n' +
              'Authorization: Key bla bla bla bla\r\n' +
              'User-Agent: axios/1.3.0\r\n' +
              'Content-Length: 138\r\n' +
              'Accept-Encoding: gzip, compress, deflate, br\r\n' +
              'Host: localhost:8080\r\n' +
              'Connection: keep-alive\r\n' +
              '\r\n' +
              '',
            encoding: 'latin1'
          }, { chunk: Buffer {}, encoding: 'buffer' },
          allBuffers: false
        ],
        _pendingEncoding: '',
        server: null,
        _server: null,
        timeout: 20000,
        parser: null,
        _httpMessage: ClientRequest {...},
        bytesRead: 0,
        remoteAddress: undefined,
        remoteFamily: undefined,
        remotePort: undefined,
        localAddress: undefined,
        localPort: undefined,
        localFamily: undefined,
        _bytesDispatched: 0,
        bytesWritten: 466,
        Symbol(async_id_symbol): 4451,
        Symbol(kHandle): null,
        Symbol(lastWriteQueueSize): 0,
        Symbol(timeout): Timeout {
          _idleTimeout: -1,
          _idlePrev: null,
          _idleNext: null,
          _idleStart: 165913,
          _onTimeout: null,
          _timerArgs: undefined,
          _repeat: null,
          _destroyed: true,
          Symbol(refed): false,
          Symbol(kHasPrimitive): false,
          Symbol(asyncId): 4460,
          Symbol(triggerId): 4453
        },
        Symbol(kBuffer): null,
        Symbol(kBufferCb): null,
        Symbol(kBufferGen): null,
        Symbol(kCapture): false,
        Symbol(kSetNoDelay): true,
        Symbol(kSetKeepAlive): true,
        Symbol(kSetKeepAliveInitialDelay): 60,
        Symbol(kBytesRead): 0,
        Symbol(kBytesWritten): 0
      },
      _header: 'POST /v2/payments HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'Authorization: Key bla bla bla bla\r\n' +
        'User-Agent: axios/1.3.0\r\n' +
        'Content-Length: 138\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'Host: localhost:8080\r\n' +
        'Connection: keep-alive\r\n' +
        '\r\n' +
        '',
      _keepAliveTimeout: 0,
      agent: Agent {
        _events: {},
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 80,
        protocol: 'http:',
        options: { keepAlive: true, scheduling: 'lifo', timeout: 5000, noDelay: true, path: null },
        requests: {},
        sockets: {
          'localhost:8080:': Array(1) [
            Socket {
              connecting: false,
              _hadError: true,
              _parent: null,
              _host: 'localhost',
              _closeAfterHandlingError: false,
              _readableState: ReadableState {
                objectMode: false,
                highWaterMark: 16384,
                buffer: BufferList { head: null, tail: null, length: 0 },
                length: 0,
                pipes: [],
                flowing: true,
                ended: false,
                endEmitted: false,
                reading: true,
                constructed: true,
                sync: false,
                needReadable: true,
                emittedReadable: false,
                readableListening: false,
                resumeScheduled: false,
                errorEmitted: true,
                emitClose: false,
                autoDestroy: true,
                destroyed: true,
                errored: Error {
                  errno: -4078,
                  code: 'ECONNREFUSED',
                  syscall: 'connect',
                  address: '::1',
                  port: 8080,
                  stack: 'Error: connect ECONNREFUSED ::1:8080\n' +
                    '    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1283:16)',
                  message: 'connect ECONNREFUSED ::1:8080'
                },
                closed: true,
                closeEmitted: true,
                defaultEncoding: 'utf8',
                awaitDrainWriters: null,
                multiAwaitDrain: false,
                readingMore: false,
                dataEmitted: false,
                decoder: null,
                encoding: null,
                Symbol(kPaused): false
              },
              _events: {
                connect: Array(3) [ 0: λ:bound onceWrapper, 1: λ:bound onceWrapper, 2: λ:bound onceWrapper ],
                close: Array(2) [ 0: λ:onClose, 1: λ:socketCloseListener ],
                timeout: Array(3) [ 0: λ:onTimeout, 1: λ:bound onceWrapper, 2: λ:destroy ]
              },
              _eventsCount: 8,
              _maxListeners: undefined,
              _writableState: WritableState {
                objectMode: false,
                highWaterMark: 16384,
                finalCalled: false,
                needDrain: false,
                ending: false,
                ended: false,
                finished: false,
                destroyed: true,
                decodeStrings: false,
                defaultEncoding: 'utf8',
                length: 466,
                writing: true,
                corked: 0,
                sync: false,
                bufferProcessing: false,
                writelen: 466,
                afterWriteTickInfo: null,
                buffered: [],
                bufferedIndex: 0,
                allBuffers: true,
                allNoop: true,
                pendingcb: 1,
                constructed: true,
                prefinished: false,
                errorEmitted: true,
                emitClose: false,
                autoDestroy: true,
                errored: Error {
                  errno: -4078,
                  code: 'ECONNREFUSED',
                  syscall: 'connect',
                  address: '::1',
                  port: 8080,
                  stack: 'Error: connect ECONNREFUSED ::1:8080\n' +
                    '    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1283:16)',
                  message: 'connect ECONNREFUSED ::1:8080'
                },
                closed: true,
                closeEmitted: true,
                Symbol(kOnFinished): []
              },
              allowHalfOpen: false,
              _sockname: null,
              _pendingData: Array(2) [
                {
                  chunk: 'POST /v2/payments HTTP/1.1\r\n' +
                    'Accept: application/json, text/plain, */*\r\n' +
                    'Content-Type: application/json\r\n' +
                    'Authorization: Key bla bla bla bla\r\n' +
                    'User-Agent: axios/1.3.0\r\n' +
                    'Content-Length: 138\r\n' +
                    'Accept-Encoding: gzip, compress, deflate, br\r\n' +
                    'Host: localhost:8080\r\n' +
                    'Connection: keep-alive\r\n' +
                    '\r\n' +
                    '',
                  encoding: 'latin1'
                }, { chunk: Buffer {}, encoding: 'buffer' },
                allBuffers: false
              ],
              _pendingEncoding: '',
              server: null,
              _server: null,
              timeout: 20000,
              parser: null,
              _httpMessage: ClientRequest {...},
              bytesRead: 0,
              remoteAddress: undefined,
              remoteFamily: undefined,
              remotePort: undefined,
              localAddress: undefined,
              localPort: undefined,
              localFamily: undefined,
              _bytesDispatched: 0,
              bytesWritten: 466,
              Symbol(async_id_symbol): 4451,
              Symbol(kHandle): null,
              Symbol(lastWriteQueueSize): 0,
              Symbol(timeout): Timeout {
                _idleTimeout: -1,
                _idlePrev: null,
                _idleNext: null,
                _idleStart: 165913,
                _onTimeout: null,
                _timerArgs: undefined,
                _repeat: null,
                _destroyed: true,
                Symbol(refed): false,
                Symbol(kHasPrimitive): false,
                Symbol(asyncId): 4460,
                Symbol(triggerId): 4453
              },
              Symbol(kBuffer): null,
              Symbol(kBufferCb): null,
              Symbol(kBufferGen): null,
              Symbol(kCapture): false,
              Symbol(kSetNoDelay): true,
              Symbol(kSetKeepAlive): true,
              Symbol(kSetKeepAliveInitialDelay): 60,
              Symbol(kBytesRead): 0,
              Symbol(kBytesWritten): 0
            }
          ]
        },
        freeSockets: {},
        keepAliveMsecs: 1000,
        keepAlive: true,
        maxSockets: Infinity,
        maxFreeSockets: 256,
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 1,
        Symbol(kCapture): false
      },
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v2/payments',
      _ended: false,
      res: null,
      aborted: false,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'localhost',
      protocol: 'http:',
      _redirectable: Writable {...},
      headersSent: true,
      Symbol(kCapture): false,
      Symbol(kBytesWritten): 0,
      Symbol(kEndCalled): false,
      Symbol(kNeedDrain): false,
      Symbol(corked): 0,
      Symbol(kOutHeaders): {
        accept: Array(2) [ 'Accept', 'application/json, text/plain, */*' ],
        'content-type': Array(2) [ 'Content-Type', 'application/json' ],
        authorization: Array(2) [ 'Authorization', 'Key bla bla bla bla' ],
        'user-agent': Array(2) [ 'User-Agent', 'axios/1.3.0' ],
        'content-length': Array(2) [ 'Content-Length', '138' ],
        'accept-encoding': Array(2) [ 'Accept-Encoding', 'gzip, compress, deflate, br' ],
        host: Array(2) [ 'Host', 'localhost:8080' ]
      },
      Symbol(kUniqueHeaders): null
    },
    _currentUrl: 'http://localhost:8080/v2/payments',
    _timeout: null,
    _writev: null,
    Symbol(kCapture): false
  },
  cause: Error {
    errno: -4078,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '::1',
    port: 8080,
    stack: 'Error: connect ECONNREFUSED ::1:8080\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1283:16)',
    message: 'connect ECONNREFUSED ::1:8080'
  },
  stack: 'Error: connect ECONNREFUSED ::1:8080\n' +
    '    at AxiosError.from (E:\Documents\PiStake-Poker\web\node_modules\axios\dist\node\axios.cjs:823:14)\n' +
    '    at RedirectableRequest.handleRequestError (E:\Documents\PiStake-Poker\web\node_modules\axios\dist\node\axios.cjs:2953:25)\n' +
    '    at RedirectableRequest.emit (node:events:525:35)\n' +
    '    at eventHandlers.<computed> (E:\Documents\PiStake-Poker\web\node_modules\follow-redirects\index.js:14:24)\n' +
    '    at ClientRequest.emit (node:events:513:28)\n' +
    '    at Socket.socketErrorListener (node:_http_client:488:9)\n' +
    '    at Socket.emit (node:events:513:28)\n' +
    '    at emitErrorNT (node:internal/streams/destroy:151:8)\n' +
    '    at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'
}
hklee93 commented 1 year ago

Have you updated the baseUrl? Your error says the baseUrl is http://localhost:8080. It should be pointing to https://api.minepi.com by default.

LeVarez commented 1 year ago

No i didn't change the base URL. The unique steps I do are the ones you can see in my last comment and my project doesn't run on localhost:8080

Wormhole-Pi commented 1 year ago

I have changed the baseURL but now I get this error (see full error log below. This particular part of the error got my attention. What does this mean? _data: { error: 'missing_scope', error_message: User hasn't authorized "wallet_address" scope for you to access the public key. }_

    reject(new AxiosError(
           ^
AxiosError: Request failed with status code 401
    at settle (C:\........\node_modules\pi-backend\node_modules\axios\dist\node\axios.cjs:1894:12)
    at IncomingMessage.handleStreamEnd (C:\.........\node_modules\pi-backend\node_modules\axios\dist\node\axios.cjs:2932:11)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ERR_BAD_REQUEST',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 20000,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: {
      FormData: [Function: FormData] {
        LINE_BREAK: '\r\n',
        DEFAULT_CONTENT_TYPE: 'application/octet-stream'
      },
      Blob: [class Blob]
    },
    validateStatus: [Function: validateStatus],
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      Authorization: 'Key [used my key here]',
      'User-Agent': 'axios/1.3.0',
      'Content-Length': '138',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    baseURL: 'https://api.minepi.com',
    method: 'post',
    url: '/v2/payments',
    data: '{"payment":{"amount":1,"memo":"Refund for apple pie","metadata":{"productId":"apple-pie-1"},"uid":"[used a uid here]"}}'
  },
  request: <ref *2> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      finish: [Function: requestOnFinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    strictContentLength: false,
    _contentLength: '138',
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: <ref *1> TLSSocket {
      _tlsOptions: {
        allowHalfOpen: undefined,
        pipe: false,
        secureContext: SecureContext { context: SecureContext {} },
        isServer: false,
        requestCert: true,
        rejectUnauthorized: true,
        session: undefined,
        ALPNProtocols: undefined,
        requestOCSP: undefined,
        enableTrace: undefined,
        pskCallback: undefined,
        highWaterMark: undefined,
        onread: undefined,
        signal: undefined
      },
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'api.minepi.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype] {
        close: [
          [Function: onSocketCloseDestroySSL],
          [Function: bound onceWrapper] {
            listener: [Function (anonymous)]
          },
          [Function: onClose],
          [Function: socketCloseListener]
        ],
        end: [Function: onReadableStreamEnd],
        newListener: [Function: keylogNewListener],
        secure: [Function: onConnectSecure],
        session: [Function (anonymous)],
        free: [Function: onFree],
        timeout: [ [Function: onTimeout], [Function: destroy] ],
        agentRemove: [Function: onRemove],
        error: [Function: socketErrorListener],
        finish: [Function: bound onceWrapper] { listener: [Function: destroy] }
      },
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'api.minepi.com',
      _closeAfterHandlingError: false,
      _readableState: ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: BufferList { head: null, tail: null, length: 0 },
        length: 0,
        pipes: [],
        flowing: true,
        ended: false,
        endEmitted: false,
        reading: true,
        constructed: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        errorEmitted: false,
        emitClose: false,
        autoDestroy: true,
        destroyed: false,
        errored: null,
        closed: false,
        closeEmitted: false,
        defaultEncoding: 'utf8',
        awaitDrainWriters: null,
        multiAwaitDrain: false,
        readingMore: false,
        dataEmitted: true,
        decoder: null,
        encoding: null,
        [Symbol(kPaused)]: false
      },
      _maxListeners: undefined,
      _writableState: WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: true,
        needDrain: false,
        ending: true,
        ended: true,
        finished: false,
        destroyed: false,
        decodeStrings: false,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        afterWriteTickInfo: null,
        buffered: [],
        bufferedIndex: 0,
        allBuffers: true,
        allNoop: true,
        pendingcb: 1,
        constructed: true,
        prefinished: false,
        errorEmitted: false,
        emitClose: false,
        autoDestroy: true,
        errored: null,
        closed: false,
        closeEmitted: false,
        [Symbol(kOnFinished)]: []
      },
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: TLSWrap {
        _parent: TCP {
          reading: [Getter/Setter],
          onconnection: null,
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _parentWrap: undefined,
        _secureContext: SecureContext { context: SecureContext {} },
        reading: true,
        onkeylog: [Function: onkeylog],
        onhandshakestart: {},
        onhandshakedone: [Function (anonymous)],
        onocspresponse: [Function: onocspresponse],
        onnewsession: [Function: onnewsessionclient],
        onerror: [Function: onerror],
        [Symbol(owner_symbol)]: [Circular *1]
      },
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *2],
      timeout: 20000,
      [Symbol(res)]: TLSWrap {
        _parent: TCP {
          reading: [Getter/Setter],
          onconnection: null,
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _parentWrap: undefined,
        _secureContext: SecureContext { context: SecureContext {} },
        reading: true,
        onkeylog: [Function: onkeylog],
        onhandshakestart: {},
        onhandshakedone: [Function (anonymous)],
        onocspresponse: [Function: onocspresponse],
        onnewsession: [Function: onnewsessionclient],
        onerror: [Function: onerror],
        [Symbol(owner_symbol)]: [Circular *1]
      },
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 598,
      [Symbol(kHandle)]: TLSWrap {
        _parent: TCP {
          reading: [Getter/Setter],
          onconnection: null,
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _parentWrap: undefined,
        _secureContext: SecureContext { context: SecureContext {} },
        reading: true,
        onkeylog: [Function: onkeylog],
        onhandshakestart: {},
        onhandshakedone: [Function (anonymous)],
        onocspresponse: [Function: onocspresponse],
        onnewsession: [Function: onnewsessionclient],
        onerror: [Function: onerror],
        [Symbol(owner_symbol)]: [Circular *1]
      },
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: <ref *3> Timeout {
        _idleTimeout: 20000,
        _idlePrev: TimersList {
          _idleNext: [Circular *3],
          _idlePrev: [Circular *3],
          expiry: 20599,
          id: -9007199254740989,
          msecs: 20000,
          priorityQueuePosition: 1
        },
        _idleNext: TimersList {
          _idleNext: [Circular *3],
          _idlePrev: [Circular *3],
          expiry: 20599,
          id: -9007199254740989,
          msecs: 20000,
          priorityQueuePosition: 1
        },
        _idleStart: 2216,
        _onTimeout: [Function: bound ],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: false,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 607,
        [Symbol(triggerId)]: 602
      },
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: true,
      [Symbol(kSetKeepAliveInitialDelay)]: 60,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: {
        rejectUnauthorized: true,
        ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
        checkServerIdentity: [Function: checkServerIdentity],
        minDHSize: 1024,
        maxRedirects: 21,
        maxBodyLength: Infinity,
        protocol: 'https:',
        path: null,
        method: 'POST',
        headers: [Object: null prototype] {
          Accept: 'application/json, text/plain, */*',
          'Content-Type': 'application/json',
          Authorization: 'Key [used my key here]',
          'User-Agent': 'axios/1.3.0',
          'Content-Length': '138',
          'Accept-Encoding': 'gzip, compress, deflate, br'
        },
        agents: { http: undefined, https: undefined },
        auth: undefined,
        beforeRedirect: [Function: dispatchBeforeRedirect],
        beforeRedirects: { proxy: [Function: beforeRedirect] },
        hostname: 'api.minepi.com',
        port: 443,
        agent: undefined,
        nativeProtocols: {
          'http:': {
            _connectionListener: [Function: connectionListener],
            METHODS: [Array],
            STATUS_CODES: [Object],
            Agent: [Function],
            ClientRequest: [Function: ClientRequest],
            IncomingMessage: [Function: IncomingMessage],
            OutgoingMessage: [Function: OutgoingMessage],
            Server: [Function: Server],
            ServerResponse: [Function: ServerResponse],
            createServer: [Function: createServer],
            validateHeaderName: [Function: __node_internal_],
            validateHeaderValue: [Function: __node_internal_],
            get: [Function: get],
            request: [Function: request],
            setMaxIdleHTTPParsers: [Function: setMaxIdleHTTPParsers],
            maxHeaderSize: [Getter],
            globalAgent: [Getter/Setter]
          },
          'https:': {
            Agent: [Function: Agent],
            globalAgent: [Agent],
            Server: [Function: Server],
            createServer: [Function: createServer],
            get: [Function: get],
            request: [Function: request]
          }
        },
        pathname: '/v2/payments',
        _defaultAgent: Agent {
          _events: [Object: null prototype] {
            free: [Function (anonymous)],
            newListener: [Function: maybeEnableKeylog]
          },
          _eventsCount: 2,
          _maxListeners: undefined,
          defaultPort: 443,
          protocol: 'https:',
          options: [Object: null prototype] { noDelay: true, path: null },
          requests: [Object: null prototype] {},
          sockets: [Object: null prototype] {
            'api.minepi.com:443:::::::::::::::::::::': [Array]
          },
          freeSockets: [Object: null prototype] {},
          keepAliveMsecs: 1000,
          keepAlive: false,
          maxSockets: Infinity,
          maxFreeSockets: 256,
          scheduling: 'lifo',
          maxTotalSockets: Infinity,
          totalSocketCount: 1,
          maxCachedSessions: 100,
          _sessionCache: { map: [Object], list: [Array] },
          [Symbol(kCapture)]: false
        },
        host: 'api.minepi.com',
        noDelay: true,
        servername: 'api.minepi.com',
        _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
        encoding: null,
        singleUse: true
      }
    },
    _header: 'POST /v2/payments HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'Authorization: Key [my key goes here]\r\n' +
      'User-Agent: axios/1.3.0\r\n' +
      'Content-Length: 138\r\n' +
      'Accept-Encoding: gzip, compress, deflate, br\r\n' +
      'Host: api.minepi.com\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype] {
        free: [Function (anonymous)],
        newListener: [Function: maybeEnableKeylog]
      },
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype] { noDelay: true, path: null },
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype] {
        'api.minepi.com:443:::::::::::::::::::::': [
          <ref *1> TLSSocket {
            _tlsOptions: [Object],
            _secureEstablished: true,
            _securePending: false,
            _newSessionPending: false,
            _controlReleased: true,
            secureConnecting: false,
            _SNICallback: null,
            servername: 'api.minepi.com',
            alpnProtocol: false,
            authorized: true,
            authorizationError: null,
            encrypted: true,
            _events: [Object: null prototype],
            _eventsCount: 10,
            connecting: false,
            _hadError: false,
            _parent: null,
            _host: 'api.minepi.com',
            _closeAfterHandlingError: false,
            _readableState: [ReadableState],
            _maxListeners: undefined,
            _writableState: [WritableState],
            allowHalfOpen: false,
            _sockname: null,
            _pendingData: null,
            _pendingEncoding: '',
            server: undefined,
            _server: null,
            ssl: [TLSWrap],
            _requestCert: true,
            _rejectUnauthorized: true,
            parser: null,
            _httpMessage: [Circular *2],
            timeout: 20000,
            [Symbol(res)]: [TLSWrap],
            [Symbol(verified)]: true,
            [Symbol(pendingSession)]: null,
            [Symbol(async_id_symbol)]: 598,
            [Symbol(kHandle)]: [TLSWrap],
            [Symbol(lastWriteQueueSize)]: 0,
            [Symbol(timeout)]: [Timeout],
            [Symbol(kBuffer)]: null,
            [Symbol(kBufferCb)]: null,
            [Symbol(kBufferGen)]: null,
            [Symbol(kCapture)]: false,
            [Symbol(kSetNoDelay)]: false,
            [Symbol(kSetKeepAlive)]: true,
            [Symbol(kSetKeepAliveInitialDelay)]: 60,
            [Symbol(kBytesRead)]: 0,
            [Symbol(kBytesWritten)]: 0,
            [Symbol(connect-options)]: [Object]
          }
        ]
      },
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: {
        map: {
          'api.minepi.com:443:::::::::::::::::::::': Buffer(1707) [Uint8Array] [
             48, 130,   6, 167,   2,   1,   1,   2,   2,   3,   4,   4,
              2,  19,   2,   4,  32,  26,  47, 255, 212, 227, 150,  60,
             43,  24,  53, 117, 197,  76,  85,  76,  31, 176, 160, 237,
             90,  29, 206, 164,  53, 128,  50, 187,  89,   2, 214, 167,
             16,   4,  48,  39, 245,  37, 167, 184,  34, 185,  66, 153,
            162,  64,  93,  42,  67,  52, 184, 181, 143, 171, 113,  91,
             17, 235, 204,  42, 239,  68, 154, 219,   3, 119, 140, 252,
            133, 161,  62, 151,  97, 141,  87, 133, 193,  23, 191, 231,
            160, 106, 214, 161,
            ... 1607 more items
          ]
        },
        list: [ 'api.minepi.com:443:::::::::::::::::::::' ]
      },
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/v2/payments',
    _ended: true,
    res: IncomingMessage {
      _readableState: ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: BufferList { head: null, tail: null, length: 0 },
        length: 0,
        pipes: [],
        flowing: true,
        ended: true,
        endEmitted: true,
        reading: false,
        constructed: true,
        sync: true,
        needReadable: false,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        errorEmitted: false,
        emitClose: true,
        autoDestroy: true,
        destroyed: true,
        errored: null,
        closed: true,
        closeEmitted: true,
        defaultEncoding: 'utf8',
        awaitDrainWriters: null,
        multiAwaitDrain: false,
        readingMore: true,
        dataEmitted: true,
        decoder: null,
        encoding: null,
        [Symbol(kPaused)]: false
      },
      _events: [Object: null prototype] {
        end: [ [Function: responseOnEnd], [Function: handleStreamEnd] ],
        error: [Function: handleStreamError],
        data: [Function: handleStreamData],
        aborted: [Function: handlerStreamAborted]
      },
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: <ref *1> TLSSocket {
        _tlsOptions: {
          allowHalfOpen: undefined,
          pipe: false,
          secureContext: SecureContext { context: SecureContext {} },
          isServer: false,
          requestCert: true,
          rejectUnauthorized: true,
          session: undefined,
          ALPNProtocols: undefined,
          requestOCSP: undefined,
          enableTrace: undefined,
          pskCallback: undefined,
          highWaterMark: undefined,
          onread: undefined,
          signal: undefined
        },
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        secureConnecting: false,
        _SNICallback: null,
        servername: 'api.minepi.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object: null prototype] {
          close: [
            [Function: onSocketCloseDestroySSL],
            [Function],
            [Function: onClose],
            [Function: socketCloseListener]
          ],
          end: [Function: onReadableStreamEnd],
          newListener: [Function: keylogNewListener],
          secure: [Function: onConnectSecure],
          session: [Function (anonymous)],
          free: [Function: onFree],
          timeout: [ [Function: onTimeout], [Function: destroy] ],
          agentRemove: [Function: onRemove],
          error: [Function: socketErrorListener],
          finish: [Function: bound onceWrapper] {
            listener: [Function: destroy]
          }
        },
        _eventsCount: 10,
        connecting: false,
        _hadError: false,
        _parent: null,
        _host: 'api.minepi.com',
        _closeAfterHandlingError: false,
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: true,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          destroyed: false,
          errored: null,
          closed: false,
          closeEmitted: false,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _maxListeners: undefined,
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: true,
          needDrain: false,
          ending: true,
          ended: true,
          finished: false,
          destroyed: false,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular *2],
        timeout: 20000,
        [Symbol(res)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(verified)]: true,
        [Symbol(pendingSession)]: null,
        [Symbol(async_id_symbol)]: 598,
        [Symbol(kHandle)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: <ref *3> Timeout {
          _idleTimeout: 20000,
          _idlePrev: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleNext: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleStart: 2216,
          _onTimeout: [Function: bound ],
          _timerArgs: undefined,
          _repeat: null,
          _destroyed: false,
          [Symbol(refed)]: false,
          [Symbol(kHasPrimitive)]: false,
          [Symbol(asyncId)]: 607,
          [Symbol(triggerId)]: 602
        },
        [Symbol(kBuffer)]: null,
        [Symbol(kBufferCb)]: null,
        [Symbol(kBufferGen)]: null,
        [Symbol(kCapture)]: false,
        [Symbol(kSetNoDelay)]: false,
        [Symbol(kSetKeepAlive)]: true,
        [Symbol(kSetKeepAliveInitialDelay)]: 60,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: {
          rejectUnauthorized: true,
          ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
          checkServerIdentity: [Function: checkServerIdentity],
          minDHSize: 1024,
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: null,
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: 443,
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments',
          _defaultAgent: Agent {
            _events: [Object: null prototype],
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 443,
            protocol: 'https:',
            options: [Object: null prototype],
            requests: [Object: null prototype] {},
            sockets: [Object: null prototype],
            freeSockets: [Object: null prototype] {},
            keepAliveMsecs: 1000,
            keepAlive: false,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 1,
            maxCachedSessions: 100,
            _sessionCache: [Object],
            [Symbol(kCapture)]: false
          },
          host: 'api.minepi.com',
          noDelay: true,
          servername: 'api.minepi.com',
          _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
          encoding: null,
          singleUse: true
        }
      },
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [
        'content-type',
        'application/json; charset=utf-8',
        'transfer-encoding',
        'chunked',
        'status',
        '401 Unauthorized',
        'cache-control',
        'no-cache',
        'vary',
        'Origin',
        'referrer-policy',
        'strict-origin-when-cross-origin',
        'x-permitted-cross-domain-policies',
        'none',
        'x-xss-protection',
        '1; mode=block',
        'x-request-id',
        '82cf999d-3436-48ed-aae0-acd552833649',
        'x-download-options',
        'noopen',
        'x-runtime',
        '0.133066',
        'x-frame-options',
        'SAMEORIGIN',
        'x-content-type-options',
        'nosniff',
        'date',
        'Fri, 03 Feb 2023 07:24:47 GMT',
        'x-powered-by',
        'Phusion Passenger(R)',
        'server',
        'nginx/1.18.0 + Phusion Passenger(R)',
        'connection',
        'close'
      ],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 401,
      statusMessage: 'Unauthorized',
      client: <ref *1> TLSSocket {
        _tlsOptions: {
          allowHalfOpen: undefined,
          pipe: false,
          secureContext: SecureContext { context: SecureContext {} },
          isServer: false,
          requestCert: true,
          rejectUnauthorized: true,
          session: undefined,
          ALPNProtocols: undefined,
          requestOCSP: undefined,
          enableTrace: undefined,
          pskCallback: undefined,
          highWaterMark: undefined,
          onread: undefined,
          signal: undefined
        },
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        secureConnecting: false,
        _SNICallback: null,
        servername: 'api.minepi.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object: null prototype] {
          close: [
            [Function: onSocketCloseDestroySSL],
            [Function],
            [Function: onClose],
            [Function: socketCloseListener]
          ],
          end: [Function: onReadableStreamEnd],
          newListener: [Function: keylogNewListener],
          secure: [Function: onConnectSecure],
          session: [Function (anonymous)],
          free: [Function: onFree],
          timeout: [ [Function: onTimeout], [Function: destroy] ],
          agentRemove: [Function: onRemove],
          error: [Function: socketErrorListener],
          finish: [Function: bound onceWrapper] {
            listener: [Function: destroy]
          }
        },
        _eventsCount: 10,
        connecting: false,
        _hadError: false,
        _parent: null,
        _host: 'api.minepi.com',
        _closeAfterHandlingError: false,
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: true,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          destroyed: false,
          errored: null,
          closed: false,
          closeEmitted: false,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _maxListeners: undefined,
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: true,
          needDrain: false,
          ending: true,
          ended: true,
          finished: false,
          destroyed: false,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular *2],
        timeout: 20000,
        [Symbol(res)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(verified)]: true,
        [Symbol(pendingSession)]: null,
        [Symbol(async_id_symbol)]: 598,
        [Symbol(kHandle)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: <ref *3> Timeout {
          _idleTimeout: 20000,
          _idlePrev: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleNext: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleStart: 2216,
          _onTimeout: [Function: bound ],
          _timerArgs: undefined,
          _repeat: null,
          _destroyed: false,
          [Symbol(refed)]: false,
          [Symbol(kHasPrimitive)]: false,
          [Symbol(asyncId)]: 607,
          [Symbol(triggerId)]: 602
        },
        [Symbol(kBuffer)]: null,
        [Symbol(kBufferCb)]: null,
        [Symbol(kBufferGen)]: null,
        [Symbol(kCapture)]: false,
        [Symbol(kSetNoDelay)]: false,
        [Symbol(kSetKeepAlive)]: true,
        [Symbol(kSetKeepAliveInitialDelay)]: 60,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: {
          rejectUnauthorized: true,
          ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
          checkServerIdentity: [Function: checkServerIdentity],
          minDHSize: 1024,
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: null,
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: 443,
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments',
          _defaultAgent: Agent {
            _events: [Object: null prototype],
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 443,
            protocol: 'https:',
            options: [Object: null prototype],
            requests: [Object: null prototype] {},
            sockets: [Object: null prototype],
            freeSockets: [Object: null prototype] {},
            keepAliveMsecs: 1000,
            keepAlive: false,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 1,
            maxCachedSessions: 100,
            _sessionCache: [Object],
            [Symbol(kCapture)]: false
          },
          host: 'api.minepi.com',
          noDelay: true,
          servername: 'api.minepi.com',
          _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
          encoding: null,
          singleUse: true
        }
      },
      _consuming: false,
      _dumped: false,
      req: [Circular *2],
      responseUrl: 'https://api.minepi.com/v2/payments',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: {
        'content-type': 'application/json; charset=utf-8',
        'transfer-encoding': 'chunked',
        status: '401 Unauthorized',
        'cache-control': 'no-cache',
        vary: 'Origin',
        'referrer-policy': 'strict-origin-when-cross-origin',
        'x-permitted-cross-domain-policies': 'none',
        'x-xss-protection': '1; mode=block',
        'x-request-id': '82cf999d-3436-48ed-aae0-acd552833649',
        'x-download-options': 'noopen',
        'x-runtime': '0.133066',
        'x-frame-options': 'SAMEORIGIN',
        'x-content-type-options': 'nosniff',
        date: 'Fri, 03 Feb 2023 07:24:47 GMT',
        'x-powered-by': 'Phusion Passenger(R)',
        server: 'nginx/1.18.0 + Phusion Passenger(R)',
        connection: 'close'
      },
      [Symbol(kHeadersCount)]: 34,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'api.minepi.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: false,
        needDrain: false,
        ending: false,
        ended: false,
        finished: false,
        destroyed: false,
        decodeStrings: true,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: true,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        afterWriteTickInfo: null,
        buffered: [],
        bufferedIndex: 0,
        allBuffers: true,
        allNoop: true,
        pendingcb: 0,
        constructed: true,
        prefinished: false,
        errorEmitted: false,
        emitClose: true,
        autoDestroy: true,
        errored: null,
        closed: false,
        closeEmitted: false,
        [Symbol(kOnFinished)]: []
      },
      _events: [Object: null prototype] {
        response: [Function: handleResponse],
        error: [Function: handleRequestError],
        socket: [
          [Function: handleRequestSocket],
          [Function: destroyOnTimeout]
        ]
      },
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: {
        maxRedirects: 21,
        maxBodyLength: Infinity,
        protocol: 'https:',
        path: '/v2/payments',
        method: 'POST',
        headers: [Object: null prototype] {
          Accept: 'application/json, text/plain, */*',
          'Content-Type': 'application/json',
          Authorization: 'Key [used my key here]',
          'User-Agent': 'axios/1.3.0',
          'Content-Length': '138',
          'Accept-Encoding': 'gzip, compress, deflate, br'
        },
        agents: { http: undefined, https: undefined },
        auth: undefined,
        beforeRedirect: [Function: dispatchBeforeRedirect],
        beforeRedirects: { proxy: [Function: beforeRedirect] },
        hostname: 'api.minepi.com',
        port: '',
        agent: undefined,
        nativeProtocols: {
          'http:': {
            _connectionListener: [Function: connectionListener],
            METHODS: [Array],
            STATUS_CODES: [Object],
            Agent: [Function],
            ClientRequest: [Function: ClientRequest],
            IncomingMessage: [Function: IncomingMessage],
            OutgoingMessage: [Function: OutgoingMessage],
            Server: [Function: Server],
            ServerResponse: [Function: ServerResponse],
            createServer: [Function: createServer],
            validateHeaderName: [Function: __node_internal_],
            validateHeaderValue: [Function: __node_internal_],
            get: [Function: get],
            request: [Function: request],
            setMaxIdleHTTPParsers: [Function: setMaxIdleHTTPParsers],
            maxHeaderSize: [Getter],
            globalAgent: [Getter/Setter]
          },
          'https:': {
            Agent: [Function: Agent],
            globalAgent: [Agent],
            Server: [Function: Server],
            createServer: [Function: createServer],
            get: [Function: get],
            request: [Function: request]
          }
        },
        pathname: '/v2/payments'
      },
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 138,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *2],
      _currentUrl: 'https://api.minepi.com/v2/payments',
      _timeout: null,
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(kEndCalled)]: true,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [ 'Accept', 'application/json, text/plain, */*' ],
      'content-type': [ 'Content-Type', 'application/json' ],
      authorization: [
        'Authorization',
        'Key [used my key here]'
      ],
      'user-agent': [ 'User-Agent', 'axios/1.3.0' ],
      'content-length': [ 'Content-Length', '138' ],
      'accept-encoding': [ 'Accept-Encoding', 'gzip, compress, deflate, br' ],
      host: [ 'Host', 'api.minepi.com' ]
    },
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 401,
    statusText: 'Unauthorized',
    headers: AxiosHeaders {
      'content-type': 'application/json; charset=utf-8',
      'transfer-encoding': 'chunked',
      status: '401 Unauthorized',
      'cache-control': 'no-cache',
      vary: 'Origin',
      'referrer-policy': 'strict-origin-when-cross-origin',
      'x-permitted-cross-domain-policies': 'none',
      'x-xss-protection': '1; mode=block',
      'x-request-id': '82cf999d-3436-48ed-aae0-acd552833649',
      'x-download-options': 'noopen',
      'x-runtime': '0.133066',
      'x-frame-options': 'SAMEORIGIN',
      'x-content-type-options': 'nosniff',
      date: 'Fri, 03 Feb 2023 07:24:47 GMT',
      'x-powered-by': 'Phusion Passenger(R)',
      server: 'nginx/1.18.0 + Phusion Passenger(R)',
      connection: 'close'
    },
    config: {
      transitional: {
        silentJSONParsing: true,
        forcedJSONParsing: true,
        clarifyTimeoutError: false
      },
      adapter: [ 'xhr', 'http' ],
      transformRequest: [ [Function: transformRequest] ],
      transformResponse: [ [Function: transformResponse] ],
      timeout: 20000,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: {
        FormData: [Function: FormData] {
          LINE_BREAK: '\r\n',
          DEFAULT_CONTENT_TYPE: 'application/octet-stream'
        },
        Blob: [class Blob]
      },
      validateStatus: [Function: validateStatus],
      headers: AxiosHeaders {
        Accept: 'application/json, text/plain, */*',
        'Content-Type': 'application/json',
        Authorization: 'Key[used my key here]',
        'User-Agent': 'axios/1.3.0',
        'Content-Length': '138',
        'Accept-Encoding': 'gzip, compress, deflate, br'
      },
      baseURL: 'https://api.minepi.com',
      method: 'post',
      url: '/v2/payments',
      data: '{"payment":{"amount":1,"memo":"Refund for apple pie","metadata":{"productId":"apple-pie-1"},"user id went here"}}'
    },
    request: <ref *2> ClientRequest {
      _events: [Object: null prototype] {
        abort: [Function (anonymous)],
        aborted: [Function (anonymous)],
        connect: [Function (anonymous)],
        error: [Function (anonymous)],
        socket: [Function (anonymous)],
        timeout: [Function (anonymous)],
        finish: [Function: requestOnFinish]
      },
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: '138',
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: <ref *1> TLSSocket {
        _tlsOptions: {
          allowHalfOpen: undefined,
          pipe: false,
          secureContext: SecureContext { context: SecureContext {} },
          isServer: false,
          requestCert: true,
          rejectUnauthorized: true,
          session: undefined,
          ALPNProtocols: undefined,
          requestOCSP: undefined,
          enableTrace: undefined,
          pskCallback: undefined,
          highWaterMark: undefined,
          onread: undefined,
          signal: undefined
        },
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        secureConnecting: false,
        _SNICallback: null,
        servername: 'api.minepi.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object: null prototype] {
          close: [
            [Function: onSocketCloseDestroySSL],
            [Function],
            [Function: onClose],
            [Function: socketCloseListener]
          ],
          end: [Function: onReadableStreamEnd],
          newListener: [Function: keylogNewListener],
          secure: [Function: onConnectSecure],
          session: [Function (anonymous)],
          free: [Function: onFree],
          timeout: [ [Function: onTimeout], [Function: destroy] ],
          agentRemove: [Function: onRemove],
          error: [Function: socketErrorListener],
          finish: [Function: bound onceWrapper] {
            listener: [Function: destroy]
          }
        },
        _eventsCount: 10,
        connecting: false,
        _hadError: false,
        _parent: null,
        _host: 'api.minepi.com',
        _closeAfterHandlingError: false,
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: true,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          destroyed: false,
          errored: null,
          closed: false,
          closeEmitted: false,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _maxListeners: undefined,
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: true,
          needDrain: false,
          ending: true,
          ended: true,
          finished: false,
          destroyed: false,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular *2],
        timeout: 20000,
        [Symbol(res)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(verified)]: true,
        [Symbol(pendingSession)]: null,
        [Symbol(async_id_symbol)]: 598,
        [Symbol(kHandle)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: <ref *3> Timeout {
          _idleTimeout: 20000,
          _idlePrev: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleNext: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleStart: 2216,
          _onTimeout: [Function: bound ],
          _timerArgs: undefined,
          _repeat: null,
          _destroyed: false,
          [Symbol(refed)]: false,
          [Symbol(kHasPrimitive)]: false,
          [Symbol(asyncId)]: 607,
          [Symbol(triggerId)]: 602
        },
        [Symbol(kBuffer)]: null,
        [Symbol(kBufferCb)]: null,
        [Symbol(kBufferGen)]: null,
        [Symbol(kCapture)]: false,
        [Symbol(kSetNoDelay)]: false,
        [Symbol(kSetKeepAlive)]: true,
        [Symbol(kSetKeepAliveInitialDelay)]: 60,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: {
          rejectUnauthorized: true,
          ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
          checkServerIdentity: [Function: checkServerIdentity],
          minDHSize: 1024,
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: null,
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: 443,
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments',
          _defaultAgent: Agent {
            _events: [Object: null prototype],
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 443,
            protocol: 'https:',
            options: [Object: null prototype],
            requests: [Object: null prototype] {},
            sockets: [Object: null prototype],
            freeSockets: [Object: null prototype] {},
            keepAliveMsecs: 1000,
            keepAlive: false,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 1,
            maxCachedSessions: 100,
            _sessionCache: [Object],
            [Symbol(kCapture)]: false
          },
          host: 'api.minepi.com',
          noDelay: true,
          servername: 'api.minepi.com',
          _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
          encoding: null,
          singleUse: true
        }
      },
      _header: 'POST /v2/payments HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'Authorization: Key [used my key here]\r\n' +
        'User-Agent: axios/1.3.0\r\n' +
        'Content-Length: 138\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'Host: api.minepi.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: Agent {
        _events: [Object: null prototype] {
          free: [Function (anonymous)],
          newListener: [Function: maybeEnableKeylog]
        },
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object: null prototype] { noDelay: true, path: null },
        requests: [Object: null prototype] {},
        sockets: [Object: null prototype] {
          'api.minepi.com:443:::::::::::::::::::::': [ [TLSSocket] ]
        },
        freeSockets: [Object: null prototype] {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 256,
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 1,
        maxCachedSessions: 100,
        _sessionCache: {
          map: {
            'api.minepi.com:443:::::::::::::::::::::': [Buffer [Uint8Array]]
          },
          list: [ 'api.minepi.com:443:::::::::::::::::::::' ]
        },
        [Symbol(kCapture)]: false
      },
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v2/payments',
      _ended: true,
      res: IncomingMessage {
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: true,
          endEmitted: true,
          reading: false,
          constructed: true,
          sync: true,
          needReadable: false,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: true,
          autoDestroy: true,
          destroyed: true,
          errored: null,
          closed: true,
          closeEmitted: true,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: true,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _events: [Object: null prototype] {
          end: [ [Function: responseOnEnd], [Function: handleStreamEnd] ],
          error: [Function: handleStreamError],
          data: [Function: handleStreamData],
          aborted: [Function: handlerStreamAborted]
        },
        _eventsCount: 4,
        _maxListeners: undefined,
        socket: <ref *1> TLSSocket {
          _tlsOptions: {
            allowHalfOpen: undefined,
            pipe: false,
            secureContext: [SecureContext],
            isServer: false,
            requestCert: true,
            rejectUnauthorized: true,
            session: undefined,
            ALPNProtocols: undefined,
            requestOCSP: undefined,
            enableTrace: undefined,
            pskCallback: undefined,
            highWaterMark: undefined,
            onread: undefined,
            signal: undefined
          },
          _secureEstablished: true,
          _securePending: false,
          _newSessionPending: false,
          _controlReleased: true,
          secureConnecting: false,
          _SNICallback: null,
          servername: 'api.minepi.com',
          alpnProtocol: false,
          authorized: true,
          authorizationError: null,
          encrypted: true,
          _events: [Object: null prototype] {
            close: [Array],
            end: [Function: onReadableStreamEnd],
            newListener: [Function: keylogNewListener],
            secure: [Function: onConnectSecure],
            session: [Function (anonymous)],
            free: [Function: onFree],
            timeout: [Array],
            agentRemove: [Function: onRemove],
            error: [Function: socketErrorListener],
            finish: [Function]
          },
          _eventsCount: 10,
          connecting: false,
          _hadError: false,
          _parent: null,
          _host: 'api.minepi.com',
          _closeAfterHandlingError: false,
          _readableState: ReadableState {
            objectMode: false,
            highWaterMark: 16384,
            buffer: [BufferList],
            length: 0,
            pipes: [],
            flowing: true,
            ended: false,
            endEmitted: false,
            reading: true,
            constructed: true,
            sync: false,
            needReadable: true,
            emittedReadable: false,
            readableListening: false,
            resumeScheduled: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            destroyed: false,
            errored: null,
            closed: false,
            closeEmitted: false,
            defaultEncoding: 'utf8',
            awaitDrainWriters: null,
            multiAwaitDrain: false,
            readingMore: false,
            dataEmitted: true,
            decoder: null,
            encoding: null,
            [Symbol(kPaused)]: false
          },
          _maxListeners: undefined,
          _writableState: WritableState {
            objectMode: false,
            highWaterMark: 16384,
            finalCalled: true,
            needDrain: false,
            ending: true,
            ended: true,
            finished: false,
            destroyed: false,
            decodeStrings: false,
            defaultEncoding: 'utf8',
            length: 0,
            writing: false,
            corked: 0,
            sync: false,
            bufferProcessing: false,
            onwrite: [Function: bound onwrite],
            writecb: null,
            writelen: 0,
            afterWriteTickInfo: null,
            buffered: [],
            bufferedIndex: 0,
            allBuffers: true,
            allNoop: true,
            pendingcb: 1,
            constructed: true,
            prefinished: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            errored: null,
            closed: false,
            closeEmitted: false,
            [Symbol(kOnFinished)]: []
          },
          allowHalfOpen: false,
          _sockname: null,
          _pendingData: null,
          _pendingEncoding: '',
          server: undefined,
          _server: null,
          ssl: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _requestCert: true,
          _rejectUnauthorized: true,
          parser: null,
          _httpMessage: [Circular *2],
          timeout: 20000,
          [Symbol(res)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(verified)]: true,
          [Symbol(pendingSession)]: null,
          [Symbol(async_id_symbol)]: 598,
          [Symbol(kHandle)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(lastWriteQueueSize)]: 0,
          [Symbol(timeout)]: <ref *3> Timeout {
            _idleTimeout: 20000,
            _idlePrev: [TimersList],
            _idleNext: [TimersList],
            _idleStart: 2216,
            _onTimeout: [Function: bound ],
            _timerArgs: undefined,
            _repeat: null,
            _destroyed: false,
            [Symbol(refed)]: false,
            [Symbol(kHasPrimitive)]: false,
            [Symbol(asyncId)]: 607,
            [Symbol(triggerId)]: 602
          },
          [Symbol(kBuffer)]: null,
          [Symbol(kBufferCb)]: null,
          [Symbol(kBufferGen)]: null,
          [Symbol(kCapture)]: false,
          [Symbol(kSetNoDelay)]: false,
          [Symbol(kSetKeepAlive)]: true,
          [Symbol(kSetKeepAliveInitialDelay)]: 60,
          [Symbol(kBytesRead)]: 0,
          [Symbol(kBytesWritten)]: 0,
          [Symbol(connect-options)]: {
            rejectUnauthorized: true,
            ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
            checkServerIdentity: [Function: checkServerIdentity],
            minDHSize: 1024,
            maxRedirects: 21,
            maxBodyLength: Infinity,
            protocol: 'https:',
            path: null,
            method: 'POST',
            headers: [Object: null prototype],
            agents: [Object],
            auth: undefined,
            beforeRedirect: [Function: dispatchBeforeRedirect],
            beforeRedirects: [Object],
            hostname: 'api.minepi.com',
            port: 443,
            agent: undefined,
            nativeProtocols: [Object],
            pathname: '/v2/payments',
            _defaultAgent: [Agent],
            host: 'api.minepi.com',
            noDelay: true,
            servername: 'api.minepi.com',
            _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
            encoding: null,
            singleUse: true
          }
        },
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        rawHeaders: [
          'content-type',
          'application/json; charset=utf-8',
          'transfer-encoding',
          'chunked',
          'status',
          '401 Unauthorized',
          'cache-control',
          'no-cache',
          'vary',
          'Origin',
          'referrer-policy',
          'strict-origin-when-cross-origin',
          'x-permitted-cross-domain-policies',
          'none',
          'x-xss-protection',
          '1; mode=block',
          'x-request-id',
          '82cf999d-3436-48ed-aae0-acd552833649',
          'x-download-options',
          'noopen',
          'x-runtime',
          '0.133066',
          'x-frame-options',
          'SAMEORIGIN',
          'x-content-type-options',
          'nosniff',
          'date',
          'Fri, 03 Feb 2023 07:24:47 GMT',
          'x-powered-by',
          'Phusion Passenger(R)',
          'server',
          'nginx/1.18.0 + Phusion Passenger(R)',
          'connection',
          'close'
        ],
        rawTrailers: [],
        aborted: false,
        upgrade: false,
        url: '',
        method: null,
        statusCode: 401,
        statusMessage: 'Unauthorized',
        client: <ref *1> TLSSocket {
          _tlsOptions: {
            allowHalfOpen: undefined,
            pipe: false,
            secureContext: [SecureContext],
            isServer: false,
            requestCert: true,
            rejectUnauthorized: true,
            session: undefined,
            ALPNProtocols: undefined,
            requestOCSP: undefined,
            enableTrace: undefined,
            pskCallback: undefined,
            highWaterMark: undefined,
            onread: undefined,
            signal: undefined
          },
          _secureEstablished: true,
          _securePending: false,
          _newSessionPending: false,
          _controlReleased: true,
          secureConnecting: false,
          _SNICallback: null,
          servername: 'api.minepi.com',
          alpnProtocol: false,
          authorized: true,
          authorizationError: null,
          encrypted: true,
          _events: [Object: null prototype] {
            close: [Array],
            end: [Function: onReadableStreamEnd],
            newListener: [Function: keylogNewListener],
            secure: [Function: onConnectSecure],
            session: [Function (anonymous)],
            free: [Function: onFree],
            timeout: [Array],
            agentRemove: [Function: onRemove],
            error: [Function: socketErrorListener],
            finish: [Function]
          },
          _eventsCount: 10,
          connecting: false,
          _hadError: false,
          _parent: null,
          _host: 'api.minepi.com',
          _closeAfterHandlingError: false,
          _readableState: ReadableState {
            objectMode: false,
            highWaterMark: 16384,
            buffer: [BufferList],
            length: 0,
            pipes: [],
            flowing: true,
            ended: false,
            endEmitted: false,
            reading: true,
            constructed: true,
            sync: false,
            needReadable: true,
            emittedReadable: false,
            readableListening: false,
            resumeScheduled: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            destroyed: false,
            errored: null,
            closed: false,
            closeEmitted: false,
            defaultEncoding: 'utf8',
            awaitDrainWriters: null,
            multiAwaitDrain: false,
            readingMore: false,
            dataEmitted: true,
            decoder: null,
            encoding: null,
            [Symbol(kPaused)]: false
          },
          _maxListeners: undefined,
          _writableState: WritableState {
            objectMode: false,
            highWaterMark: 16384,
            finalCalled: true,
            needDrain: false,
            ending: true,
            ended: true,
            finished: false,
            destroyed: false,
            decodeStrings: false,
            defaultEncoding: 'utf8',
            length: 0,
            writing: false,
            corked: 0,
            sync: false,
            bufferProcessing: false,
            onwrite: [Function: bound onwrite],
            writecb: null,
            writelen: 0,
            afterWriteTickInfo: null,
            buffered: [],
            bufferedIndex: 0,
            allBuffers: true,
            allNoop: true,
            pendingcb: 1,
            constructed: true,
            prefinished: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            errored: null,
            closed: false,
            closeEmitted: false,
            [Symbol(kOnFinished)]: []
          },
          allowHalfOpen: false,
          _sockname: null,
          _pendingData: null,
          _pendingEncoding: '',
          server: undefined,
          _server: null,
          ssl: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _requestCert: true,
          _rejectUnauthorized: true,
          parser: null,
          _httpMessage: [Circular *2],
          timeout: 20000,
          [Symbol(res)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(verified)]: true,
          [Symbol(pendingSession)]: null,
          [Symbol(async_id_symbol)]: 598,
          [Symbol(kHandle)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(lastWriteQueueSize)]: 0,
          [Symbol(timeout)]: <ref *3> Timeout {
            _idleTimeout: 20000,
            _idlePrev: [TimersList],
            _idleNext: [TimersList],
            _idleStart: 2216,
            _onTimeout: [Function: bound ],
            _timerArgs: undefined,
            _repeat: null,
            _destroyed: false,
            [Symbol(refed)]: false,
            [Symbol(kHasPrimitive)]: false,
            [Symbol(asyncId)]: 607,
            [Symbol(triggerId)]: 602
          },
          [Symbol(kBuffer)]: null,
          [Symbol(kBufferCb)]: null,
          [Symbol(kBufferGen)]: null,
          [Symbol(kCapture)]: false,
          [Symbol(kSetNoDelay)]: false,
          [Symbol(kSetKeepAlive)]: true,
          [Symbol(kSetKeepAliveInitialDelay)]: 60,
          [Symbol(kBytesRead)]: 0,
          [Symbol(kBytesWritten)]: 0,
          [Symbol(connect-options)]: {
            rejectUnauthorized: true,
            ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
            checkServerIdentity: [Function: checkServerIdentity],
            minDHSize: 1024,
            maxRedirects: 21,
            maxBodyLength: Infinity,
            protocol: 'https:',
            path: null,
            method: 'POST',
            headers: [Object: null prototype],
            agents: [Object],
            auth: undefined,
            beforeRedirect: [Function: dispatchBeforeRedirect],
            beforeRedirects: [Object],
            hostname: 'api.minepi.com',
            port: 443,
            agent: undefined,
            nativeProtocols: [Object],
            pathname: '/v2/payments',
            _defaultAgent: [Agent],
            host: 'api.minepi.com',
            noDelay: true,
            servername: 'api.minepi.com',
            _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
            encoding: null,
            singleUse: true
          }
        },
        _consuming: false,
        _dumped: false,
        req: [Circular *2],
        responseUrl: 'https://api.minepi.com/v2/payments',
        redirects: [],
        [Symbol(kCapture)]: false,
        [Symbol(kHeaders)]: {
          'content-type': 'application/json; charset=utf-8',
          'transfer-encoding': 'chunked',
          status: '401 Unauthorized',
          'cache-control': 'no-cache',
          vary: 'Origin',
          'referrer-policy': 'strict-origin-when-cross-origin',
          'x-permitted-cross-domain-policies': 'none',
          'x-xss-protection': '1; mode=block',
          'x-request-id': '82cf999d-3436-48ed-aae0-acd552833649',
          'x-download-options': 'noopen',
          'x-runtime': '0.133066',
          'x-frame-options': 'SAMEORIGIN',
          'x-content-type-options': 'nosniff',
          date: 'Fri, 03 Feb 2023 07:24:47 GMT',
          'x-powered-by': 'Phusion Passenger(R)',
          server: 'nginx/1.18.0 + Phusion Passenger(R)',
          connection: 'close'
        },
        [Symbol(kHeadersCount)]: 34,
        [Symbol(kTrailers)]: null,
        [Symbol(kTrailersCount)]: 0
      },
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.minepi.com',
      protocol: 'https:',
      _redirectable: Writable {
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: false,
          needDrain: false,
          ending: false,
          ended: false,
          finished: false,
          destroyed: false,
          decodeStrings: true,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: true,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 0,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: true,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        _events: [Object: null prototype] {
          response: [Function: handleResponse],
          error: [Function: handleRequestError],
          socket: [
            [Function: handleRequestSocket],
            [Function: destroyOnTimeout]
          ]
        },
        _eventsCount: 3,
        _maxListeners: undefined,
        _options: {
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: '/v2/payments',
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: '',
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments'
        },
        _ended: true,
        _ending: true,
        _redirectCount: 0,
        _redirects: [],
        _requestBodyLength: 138,
        _requestBodyBuffers: [],
        _onNativeResponse: [Function (anonymous)],
        _currentRequest: [Circular *2],
        _currentUrl: 'https://api.minepi.com/v2/payments',
        _timeout: null,
        [Symbol(kCapture)]: false
      },
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kEndCalled)]: true,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype] {
        accept: [ 'Accept', 'application/json, text/plain, */*' ],
        'content-type': [ 'Content-Type', 'application/json' ],
        authorization: [
          'Authorization',
          'Key [used my key here]'
        ],
        'user-agent': [ 'User-Agent', 'axios/1.3.0' ],
        'content-length': [ 'Content-Length', '138' ],
        'accept-encoding': [ 'Accept-Encoding', 'gzip, compress, deflate, br' ],
        host: [ 'Host', 'api.minepi.com' ]
      },
      [Symbol(kUniqueHeaders)]: null
    },
    **_data: {
      error: 'missing_scope',
      error_message: `User hasn't authorized "wallet_address" scope for you to access the public key.`
    }_**
  }
}

Node.js v18.12.1
[nodemon] app crashed - waiting for file changes before starting...
LeVarez commented 1 year ago

I have changed the baseURL but now I get this error (see full error log below. This particular part of the error got my attention. What does this mean? _data: { error: 'missing_scope', error_message: User hasn't authorized "wallet_address" scope for you to access the public key. }_

True, the installed package has defined localhost as a base URL on file \node_modules\pi-backend\dist\utils.js.

var getAxiosClient = function (apiKey) {
    var axiosClient = axios_1.default.create({
        baseURL: "http://localhost:8080",
        timeout: 20000,
        headers: { Authorization: "Key ".concat(apiKey), "Content-Type": "application/json" },
    });
    return axiosClient;
};
hklee93 commented 1 year ago

I have changed the baseURL but now I get this error (see full error log below. This particular part of the error got my attention. What does this mean? _data: { error: 'missing_scope', error_message: User hasn't authorized "wallet_address" scope for you to access the public key. }_

    reject(new AxiosError(
           ^
AxiosError: Request failed with status code 401
    at settle (C:\........\node_modules\pi-backend\node_modules\axios\dist\node\axios.cjs:1894:12)
    at IncomingMessage.handleStreamEnd (C:\.........\node_modules\pi-backend\node_modules\axios\dist\node\axios.cjs:2932:11)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ERR_BAD_REQUEST',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 20000,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: {
      FormData: [Function: FormData] {
        LINE_BREAK: '\r\n',
        DEFAULT_CONTENT_TYPE: 'application/octet-stream'
      },
      Blob: [class Blob]
    },
    validateStatus: [Function: validateStatus],
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      Authorization: 'Key [used my key here]',
      'User-Agent': 'axios/1.3.0',
      'Content-Length': '138',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    baseURL: 'https://api.minepi.com',
    method: 'post',
    url: '/v2/payments',
    data: '{"payment":{"amount":1,"memo":"Refund for apple pie","metadata":{"productId":"apple-pie-1"},"uid":"[used a uid here]"}}'
  },
  request: <ref *2> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      finish: [Function: requestOnFinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    strictContentLength: false,
    _contentLength: '138',
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: <ref *1> TLSSocket {
      _tlsOptions: {
        allowHalfOpen: undefined,
        pipe: false,
        secureContext: SecureContext { context: SecureContext {} },
        isServer: false,
        requestCert: true,
        rejectUnauthorized: true,
        session: undefined,
        ALPNProtocols: undefined,
        requestOCSP: undefined,
        enableTrace: undefined,
        pskCallback: undefined,
        highWaterMark: undefined,
        onread: undefined,
        signal: undefined
      },
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'api.minepi.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype] {
        close: [
          [Function: onSocketCloseDestroySSL],
          [Function: bound onceWrapper] {
            listener: [Function (anonymous)]
          },
          [Function: onClose],
          [Function: socketCloseListener]
        ],
        end: [Function: onReadableStreamEnd],
        newListener: [Function: keylogNewListener],
        secure: [Function: onConnectSecure],
        session: [Function (anonymous)],
        free: [Function: onFree],
        timeout: [ [Function: onTimeout], [Function: destroy] ],
        agentRemove: [Function: onRemove],
        error: [Function: socketErrorListener],
        finish: [Function: bound onceWrapper] { listener: [Function: destroy] }
      },
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'api.minepi.com',
      _closeAfterHandlingError: false,
      _readableState: ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: BufferList { head: null, tail: null, length: 0 },
        length: 0,
        pipes: [],
        flowing: true,
        ended: false,
        endEmitted: false,
        reading: true,
        constructed: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        errorEmitted: false,
        emitClose: false,
        autoDestroy: true,
        destroyed: false,
        errored: null,
        closed: false,
        closeEmitted: false,
        defaultEncoding: 'utf8',
        awaitDrainWriters: null,
        multiAwaitDrain: false,
        readingMore: false,
        dataEmitted: true,
        decoder: null,
        encoding: null,
        [Symbol(kPaused)]: false
      },
      _maxListeners: undefined,
      _writableState: WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: true,
        needDrain: false,
        ending: true,
        ended: true,
        finished: false,
        destroyed: false,
        decodeStrings: false,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        afterWriteTickInfo: null,
        buffered: [],
        bufferedIndex: 0,
        allBuffers: true,
        allNoop: true,
        pendingcb: 1,
        constructed: true,
        prefinished: false,
        errorEmitted: false,
        emitClose: false,
        autoDestroy: true,
        errored: null,
        closed: false,
        closeEmitted: false,
        [Symbol(kOnFinished)]: []
      },
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: TLSWrap {
        _parent: TCP {
          reading: [Getter/Setter],
          onconnection: null,
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _parentWrap: undefined,
        _secureContext: SecureContext { context: SecureContext {} },
        reading: true,
        onkeylog: [Function: onkeylog],
        onhandshakestart: {},
        onhandshakedone: [Function (anonymous)],
        onocspresponse: [Function: onocspresponse],
        onnewsession: [Function: onnewsessionclient],
        onerror: [Function: onerror],
        [Symbol(owner_symbol)]: [Circular *1]
      },
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *2],
      timeout: 20000,
      [Symbol(res)]: TLSWrap {
        _parent: TCP {
          reading: [Getter/Setter],
          onconnection: null,
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _parentWrap: undefined,
        _secureContext: SecureContext { context: SecureContext {} },
        reading: true,
        onkeylog: [Function: onkeylog],
        onhandshakestart: {},
        onhandshakedone: [Function (anonymous)],
        onocspresponse: [Function: onocspresponse],
        onnewsession: [Function: onnewsessionclient],
        onerror: [Function: onerror],
        [Symbol(owner_symbol)]: [Circular *1]
      },
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 598,
      [Symbol(kHandle)]: TLSWrap {
        _parent: TCP {
          reading: [Getter/Setter],
          onconnection: null,
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _parentWrap: undefined,
        _secureContext: SecureContext { context: SecureContext {} },
        reading: true,
        onkeylog: [Function: onkeylog],
        onhandshakestart: {},
        onhandshakedone: [Function (anonymous)],
        onocspresponse: [Function: onocspresponse],
        onnewsession: [Function: onnewsessionclient],
        onerror: [Function: onerror],
        [Symbol(owner_symbol)]: [Circular *1]
      },
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: <ref *3> Timeout {
        _idleTimeout: 20000,
        _idlePrev: TimersList {
          _idleNext: [Circular *3],
          _idlePrev: [Circular *3],
          expiry: 20599,
          id: -9007199254740989,
          msecs: 20000,
          priorityQueuePosition: 1
        },
        _idleNext: TimersList {
          _idleNext: [Circular *3],
          _idlePrev: [Circular *3],
          expiry: 20599,
          id: -9007199254740989,
          msecs: 20000,
          priorityQueuePosition: 1
        },
        _idleStart: 2216,
        _onTimeout: [Function: bound ],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: false,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 607,
        [Symbol(triggerId)]: 602
      },
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: true,
      [Symbol(kSetKeepAliveInitialDelay)]: 60,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: {
        rejectUnauthorized: true,
        ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
        checkServerIdentity: [Function: checkServerIdentity],
        minDHSize: 1024,
        maxRedirects: 21,
        maxBodyLength: Infinity,
        protocol: 'https:',
        path: null,
        method: 'POST',
        headers: [Object: null prototype] {
          Accept: 'application/json, text/plain, */*',
          'Content-Type': 'application/json',
          Authorization: 'Key [used my key here]',
          'User-Agent': 'axios/1.3.0',
          'Content-Length': '138',
          'Accept-Encoding': 'gzip, compress, deflate, br'
        },
        agents: { http: undefined, https: undefined },
        auth: undefined,
        beforeRedirect: [Function: dispatchBeforeRedirect],
        beforeRedirects: { proxy: [Function: beforeRedirect] },
        hostname: 'api.minepi.com',
        port: 443,
        agent: undefined,
        nativeProtocols: {
          'http:': {
            _connectionListener: [Function: connectionListener],
            METHODS: [Array],
            STATUS_CODES: [Object],
            Agent: [Function],
            ClientRequest: [Function: ClientRequest],
            IncomingMessage: [Function: IncomingMessage],
            OutgoingMessage: [Function: OutgoingMessage],
            Server: [Function: Server],
            ServerResponse: [Function: ServerResponse],
            createServer: [Function: createServer],
            validateHeaderName: [Function: __node_internal_],
            validateHeaderValue: [Function: __node_internal_],
            get: [Function: get],
            request: [Function: request],
            setMaxIdleHTTPParsers: [Function: setMaxIdleHTTPParsers],
            maxHeaderSize: [Getter],
            globalAgent: [Getter/Setter]
          },
          'https:': {
            Agent: [Function: Agent],
            globalAgent: [Agent],
            Server: [Function: Server],
            createServer: [Function: createServer],
            get: [Function: get],
            request: [Function: request]
          }
        },
        pathname: '/v2/payments',
        _defaultAgent: Agent {
          _events: [Object: null prototype] {
            free: [Function (anonymous)],
            newListener: [Function: maybeEnableKeylog]
          },
          _eventsCount: 2,
          _maxListeners: undefined,
          defaultPort: 443,
          protocol: 'https:',
          options: [Object: null prototype] { noDelay: true, path: null },
          requests: [Object: null prototype] {},
          sockets: [Object: null prototype] {
            'api.minepi.com:443:::::::::::::::::::::': [Array]
          },
          freeSockets: [Object: null prototype] {},
          keepAliveMsecs: 1000,
          keepAlive: false,
          maxSockets: Infinity,
          maxFreeSockets: 256,
          scheduling: 'lifo',
          maxTotalSockets: Infinity,
          totalSocketCount: 1,
          maxCachedSessions: 100,
          _sessionCache: { map: [Object], list: [Array] },
          [Symbol(kCapture)]: false
        },
        host: 'api.minepi.com',
        noDelay: true,
        servername: 'api.minepi.com',
        _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
        encoding: null,
        singleUse: true
      }
    },
    _header: 'POST /v2/payments HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'Authorization: Key [my key goes here]\r\n' +
      'User-Agent: axios/1.3.0\r\n' +
      'Content-Length: 138\r\n' +
      'Accept-Encoding: gzip, compress, deflate, br\r\n' +
      'Host: api.minepi.com\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype] {
        free: [Function (anonymous)],
        newListener: [Function: maybeEnableKeylog]
      },
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype] { noDelay: true, path: null },
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype] {
        'api.minepi.com:443:::::::::::::::::::::': [
          <ref *1> TLSSocket {
            _tlsOptions: [Object],
            _secureEstablished: true,
            _securePending: false,
            _newSessionPending: false,
            _controlReleased: true,
            secureConnecting: false,
            _SNICallback: null,
            servername: 'api.minepi.com',
            alpnProtocol: false,
            authorized: true,
            authorizationError: null,
            encrypted: true,
            _events: [Object: null prototype],
            _eventsCount: 10,
            connecting: false,
            _hadError: false,
            _parent: null,
            _host: 'api.minepi.com',
            _closeAfterHandlingError: false,
            _readableState: [ReadableState],
            _maxListeners: undefined,
            _writableState: [WritableState],
            allowHalfOpen: false,
            _sockname: null,
            _pendingData: null,
            _pendingEncoding: '',
            server: undefined,
            _server: null,
            ssl: [TLSWrap],
            _requestCert: true,
            _rejectUnauthorized: true,
            parser: null,
            _httpMessage: [Circular *2],
            timeout: 20000,
            [Symbol(res)]: [TLSWrap],
            [Symbol(verified)]: true,
            [Symbol(pendingSession)]: null,
            [Symbol(async_id_symbol)]: 598,
            [Symbol(kHandle)]: [TLSWrap],
            [Symbol(lastWriteQueueSize)]: 0,
            [Symbol(timeout)]: [Timeout],
            [Symbol(kBuffer)]: null,
            [Symbol(kBufferCb)]: null,
            [Symbol(kBufferGen)]: null,
            [Symbol(kCapture)]: false,
            [Symbol(kSetNoDelay)]: false,
            [Symbol(kSetKeepAlive)]: true,
            [Symbol(kSetKeepAliveInitialDelay)]: 60,
            [Symbol(kBytesRead)]: 0,
            [Symbol(kBytesWritten)]: 0,
            [Symbol(connect-options)]: [Object]
          }
        ]
      },
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: {
        map: {
          'api.minepi.com:443:::::::::::::::::::::': Buffer(1707) [Uint8Array] [
             48, 130,   6, 167,   2,   1,   1,   2,   2,   3,   4,   4,
              2,  19,   2,   4,  32,  26,  47, 255, 212, 227, 150,  60,
             43,  24,  53, 117, 197,  76,  85,  76,  31, 176, 160, 237,
             90,  29, 206, 164,  53, 128,  50, 187,  89,   2, 214, 167,
             16,   4,  48,  39, 245,  37, 167, 184,  34, 185,  66, 153,
            162,  64,  93,  42,  67,  52, 184, 181, 143, 171, 113,  91,
             17, 235, 204,  42, 239,  68, 154, 219,   3, 119, 140, 252,
            133, 161,  62, 151,  97, 141,  87, 133, 193,  23, 191, 231,
            160, 106, 214, 161,
            ... 1607 more items
          ]
        },
        list: [ 'api.minepi.com:443:::::::::::::::::::::' ]
      },
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/v2/payments',
    _ended: true,
    res: IncomingMessage {
      _readableState: ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: BufferList { head: null, tail: null, length: 0 },
        length: 0,
        pipes: [],
        flowing: true,
        ended: true,
        endEmitted: true,
        reading: false,
        constructed: true,
        sync: true,
        needReadable: false,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        errorEmitted: false,
        emitClose: true,
        autoDestroy: true,
        destroyed: true,
        errored: null,
        closed: true,
        closeEmitted: true,
        defaultEncoding: 'utf8',
        awaitDrainWriters: null,
        multiAwaitDrain: false,
        readingMore: true,
        dataEmitted: true,
        decoder: null,
        encoding: null,
        [Symbol(kPaused)]: false
      },
      _events: [Object: null prototype] {
        end: [ [Function: responseOnEnd], [Function: handleStreamEnd] ],
        error: [Function: handleStreamError],
        data: [Function: handleStreamData],
        aborted: [Function: handlerStreamAborted]
      },
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: <ref *1> TLSSocket {
        _tlsOptions: {
          allowHalfOpen: undefined,
          pipe: false,
          secureContext: SecureContext { context: SecureContext {} },
          isServer: false,
          requestCert: true,
          rejectUnauthorized: true,
          session: undefined,
          ALPNProtocols: undefined,
          requestOCSP: undefined,
          enableTrace: undefined,
          pskCallback: undefined,
          highWaterMark: undefined,
          onread: undefined,
          signal: undefined
        },
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        secureConnecting: false,
        _SNICallback: null,
        servername: 'api.minepi.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object: null prototype] {
          close: [
            [Function: onSocketCloseDestroySSL],
            [Function],
            [Function: onClose],
            [Function: socketCloseListener]
          ],
          end: [Function: onReadableStreamEnd],
          newListener: [Function: keylogNewListener],
          secure: [Function: onConnectSecure],
          session: [Function (anonymous)],
          free: [Function: onFree],
          timeout: [ [Function: onTimeout], [Function: destroy] ],
          agentRemove: [Function: onRemove],
          error: [Function: socketErrorListener],
          finish: [Function: bound onceWrapper] {
            listener: [Function: destroy]
          }
        },
        _eventsCount: 10,
        connecting: false,
        _hadError: false,
        _parent: null,
        _host: 'api.minepi.com',
        _closeAfterHandlingError: false,
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: true,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          destroyed: false,
          errored: null,
          closed: false,
          closeEmitted: false,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _maxListeners: undefined,
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: true,
          needDrain: false,
          ending: true,
          ended: true,
          finished: false,
          destroyed: false,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular *2],
        timeout: 20000,
        [Symbol(res)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(verified)]: true,
        [Symbol(pendingSession)]: null,
        [Symbol(async_id_symbol)]: 598,
        [Symbol(kHandle)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: <ref *3> Timeout {
          _idleTimeout: 20000,
          _idlePrev: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleNext: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleStart: 2216,
          _onTimeout: [Function: bound ],
          _timerArgs: undefined,
          _repeat: null,
          _destroyed: false,
          [Symbol(refed)]: false,
          [Symbol(kHasPrimitive)]: false,
          [Symbol(asyncId)]: 607,
          [Symbol(triggerId)]: 602
        },
        [Symbol(kBuffer)]: null,
        [Symbol(kBufferCb)]: null,
        [Symbol(kBufferGen)]: null,
        [Symbol(kCapture)]: false,
        [Symbol(kSetNoDelay)]: false,
        [Symbol(kSetKeepAlive)]: true,
        [Symbol(kSetKeepAliveInitialDelay)]: 60,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: {
          rejectUnauthorized: true,
          ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
          checkServerIdentity: [Function: checkServerIdentity],
          minDHSize: 1024,
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: null,
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: 443,
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments',
          _defaultAgent: Agent {
            _events: [Object: null prototype],
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 443,
            protocol: 'https:',
            options: [Object: null prototype],
            requests: [Object: null prototype] {},
            sockets: [Object: null prototype],
            freeSockets: [Object: null prototype] {},
            keepAliveMsecs: 1000,
            keepAlive: false,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 1,
            maxCachedSessions: 100,
            _sessionCache: [Object],
            [Symbol(kCapture)]: false
          },
          host: 'api.minepi.com',
          noDelay: true,
          servername: 'api.minepi.com',
          _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
          encoding: null,
          singleUse: true
        }
      },
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [
        'content-type',
        'application/json; charset=utf-8',
        'transfer-encoding',
        'chunked',
        'status',
        '401 Unauthorized',
        'cache-control',
        'no-cache',
        'vary',
        'Origin',
        'referrer-policy',
        'strict-origin-when-cross-origin',
        'x-permitted-cross-domain-policies',
        'none',
        'x-xss-protection',
        '1; mode=block',
        'x-request-id',
        '82cf999d-3436-48ed-aae0-acd552833649',
        'x-download-options',
        'noopen',
        'x-runtime',
        '0.133066',
        'x-frame-options',
        'SAMEORIGIN',
        'x-content-type-options',
        'nosniff',
        'date',
        'Fri, 03 Feb 2023 07:24:47 GMT',
        'x-powered-by',
        'Phusion Passenger(R)',
        'server',
        'nginx/1.18.0 + Phusion Passenger(R)',
        'connection',
        'close'
      ],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 401,
      statusMessage: 'Unauthorized',
      client: <ref *1> TLSSocket {
        _tlsOptions: {
          allowHalfOpen: undefined,
          pipe: false,
          secureContext: SecureContext { context: SecureContext {} },
          isServer: false,
          requestCert: true,
          rejectUnauthorized: true,
          session: undefined,
          ALPNProtocols: undefined,
          requestOCSP: undefined,
          enableTrace: undefined,
          pskCallback: undefined,
          highWaterMark: undefined,
          onread: undefined,
          signal: undefined
        },
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        secureConnecting: false,
        _SNICallback: null,
        servername: 'api.minepi.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object: null prototype] {
          close: [
            [Function: onSocketCloseDestroySSL],
            [Function],
            [Function: onClose],
            [Function: socketCloseListener]
          ],
          end: [Function: onReadableStreamEnd],
          newListener: [Function: keylogNewListener],
          secure: [Function: onConnectSecure],
          session: [Function (anonymous)],
          free: [Function: onFree],
          timeout: [ [Function: onTimeout], [Function: destroy] ],
          agentRemove: [Function: onRemove],
          error: [Function: socketErrorListener],
          finish: [Function: bound onceWrapper] {
            listener: [Function: destroy]
          }
        },
        _eventsCount: 10,
        connecting: false,
        _hadError: false,
        _parent: null,
        _host: 'api.minepi.com',
        _closeAfterHandlingError: false,
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: true,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          destroyed: false,
          errored: null,
          closed: false,
          closeEmitted: false,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _maxListeners: undefined,
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: true,
          needDrain: false,
          ending: true,
          ended: true,
          finished: false,
          destroyed: false,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular *2],
        timeout: 20000,
        [Symbol(res)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(verified)]: true,
        [Symbol(pendingSession)]: null,
        [Symbol(async_id_symbol)]: 598,
        [Symbol(kHandle)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: <ref *3> Timeout {
          _idleTimeout: 20000,
          _idlePrev: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleNext: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleStart: 2216,
          _onTimeout: [Function: bound ],
          _timerArgs: undefined,
          _repeat: null,
          _destroyed: false,
          [Symbol(refed)]: false,
          [Symbol(kHasPrimitive)]: false,
          [Symbol(asyncId)]: 607,
          [Symbol(triggerId)]: 602
        },
        [Symbol(kBuffer)]: null,
        [Symbol(kBufferCb)]: null,
        [Symbol(kBufferGen)]: null,
        [Symbol(kCapture)]: false,
        [Symbol(kSetNoDelay)]: false,
        [Symbol(kSetKeepAlive)]: true,
        [Symbol(kSetKeepAliveInitialDelay)]: 60,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: {
          rejectUnauthorized: true,
          ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
          checkServerIdentity: [Function: checkServerIdentity],
          minDHSize: 1024,
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: null,
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: 443,
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments',
          _defaultAgent: Agent {
            _events: [Object: null prototype],
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 443,
            protocol: 'https:',
            options: [Object: null prototype],
            requests: [Object: null prototype] {},
            sockets: [Object: null prototype],
            freeSockets: [Object: null prototype] {},
            keepAliveMsecs: 1000,
            keepAlive: false,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 1,
            maxCachedSessions: 100,
            _sessionCache: [Object],
            [Symbol(kCapture)]: false
          },
          host: 'api.minepi.com',
          noDelay: true,
          servername: 'api.minepi.com',
          _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
          encoding: null,
          singleUse: true
        }
      },
      _consuming: false,
      _dumped: false,
      req: [Circular *2],
      responseUrl: 'https://api.minepi.com/v2/payments',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: {
        'content-type': 'application/json; charset=utf-8',
        'transfer-encoding': 'chunked',
        status: '401 Unauthorized',
        'cache-control': 'no-cache',
        vary: 'Origin',
        'referrer-policy': 'strict-origin-when-cross-origin',
        'x-permitted-cross-domain-policies': 'none',
        'x-xss-protection': '1; mode=block',
        'x-request-id': '82cf999d-3436-48ed-aae0-acd552833649',
        'x-download-options': 'noopen',
        'x-runtime': '0.133066',
        'x-frame-options': 'SAMEORIGIN',
        'x-content-type-options': 'nosniff',
        date: 'Fri, 03 Feb 2023 07:24:47 GMT',
        'x-powered-by': 'Phusion Passenger(R)',
        server: 'nginx/1.18.0 + Phusion Passenger(R)',
        connection: 'close'
      },
      [Symbol(kHeadersCount)]: 34,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'api.minepi.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: false,
        needDrain: false,
        ending: false,
        ended: false,
        finished: false,
        destroyed: false,
        decodeStrings: true,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: true,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        afterWriteTickInfo: null,
        buffered: [],
        bufferedIndex: 0,
        allBuffers: true,
        allNoop: true,
        pendingcb: 0,
        constructed: true,
        prefinished: false,
        errorEmitted: false,
        emitClose: true,
        autoDestroy: true,
        errored: null,
        closed: false,
        closeEmitted: false,
        [Symbol(kOnFinished)]: []
      },
      _events: [Object: null prototype] {
        response: [Function: handleResponse],
        error: [Function: handleRequestError],
        socket: [
          [Function: handleRequestSocket],
          [Function: destroyOnTimeout]
        ]
      },
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: {
        maxRedirects: 21,
        maxBodyLength: Infinity,
        protocol: 'https:',
        path: '/v2/payments',
        method: 'POST',
        headers: [Object: null prototype] {
          Accept: 'application/json, text/plain, */*',
          'Content-Type': 'application/json',
          Authorization: 'Key [used my key here]',
          'User-Agent': 'axios/1.3.0',
          'Content-Length': '138',
          'Accept-Encoding': 'gzip, compress, deflate, br'
        },
        agents: { http: undefined, https: undefined },
        auth: undefined,
        beforeRedirect: [Function: dispatchBeforeRedirect],
        beforeRedirects: { proxy: [Function: beforeRedirect] },
        hostname: 'api.minepi.com',
        port: '',
        agent: undefined,
        nativeProtocols: {
          'http:': {
            _connectionListener: [Function: connectionListener],
            METHODS: [Array],
            STATUS_CODES: [Object],
            Agent: [Function],
            ClientRequest: [Function: ClientRequest],
            IncomingMessage: [Function: IncomingMessage],
            OutgoingMessage: [Function: OutgoingMessage],
            Server: [Function: Server],
            ServerResponse: [Function: ServerResponse],
            createServer: [Function: createServer],
            validateHeaderName: [Function: __node_internal_],
            validateHeaderValue: [Function: __node_internal_],
            get: [Function: get],
            request: [Function: request],
            setMaxIdleHTTPParsers: [Function: setMaxIdleHTTPParsers],
            maxHeaderSize: [Getter],
            globalAgent: [Getter/Setter]
          },
          'https:': {
            Agent: [Function: Agent],
            globalAgent: [Agent],
            Server: [Function: Server],
            createServer: [Function: createServer],
            get: [Function: get],
            request: [Function: request]
          }
        },
        pathname: '/v2/payments'
      },
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 138,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *2],
      _currentUrl: 'https://api.minepi.com/v2/payments',
      _timeout: null,
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(kEndCalled)]: true,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [ 'Accept', 'application/json, text/plain, */*' ],
      'content-type': [ 'Content-Type', 'application/json' ],
      authorization: [
        'Authorization',
        'Key [used my key here]'
      ],
      'user-agent': [ 'User-Agent', 'axios/1.3.0' ],
      'content-length': [ 'Content-Length', '138' ],
      'accept-encoding': [ 'Accept-Encoding', 'gzip, compress, deflate, br' ],
      host: [ 'Host', 'api.minepi.com' ]
    },
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 401,
    statusText: 'Unauthorized',
    headers: AxiosHeaders {
      'content-type': 'application/json; charset=utf-8',
      'transfer-encoding': 'chunked',
      status: '401 Unauthorized',
      'cache-control': 'no-cache',
      vary: 'Origin',
      'referrer-policy': 'strict-origin-when-cross-origin',
      'x-permitted-cross-domain-policies': 'none',
      'x-xss-protection': '1; mode=block',
      'x-request-id': '82cf999d-3436-48ed-aae0-acd552833649',
      'x-download-options': 'noopen',
      'x-runtime': '0.133066',
      'x-frame-options': 'SAMEORIGIN',
      'x-content-type-options': 'nosniff',
      date: 'Fri, 03 Feb 2023 07:24:47 GMT',
      'x-powered-by': 'Phusion Passenger(R)',
      server: 'nginx/1.18.0 + Phusion Passenger(R)',
      connection: 'close'
    },
    config: {
      transitional: {
        silentJSONParsing: true,
        forcedJSONParsing: true,
        clarifyTimeoutError: false
      },
      adapter: [ 'xhr', 'http' ],
      transformRequest: [ [Function: transformRequest] ],
      transformResponse: [ [Function: transformResponse] ],
      timeout: 20000,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: {
        FormData: [Function: FormData] {
          LINE_BREAK: '\r\n',
          DEFAULT_CONTENT_TYPE: 'application/octet-stream'
        },
        Blob: [class Blob]
      },
      validateStatus: [Function: validateStatus],
      headers: AxiosHeaders {
        Accept: 'application/json, text/plain, */*',
        'Content-Type': 'application/json',
        Authorization: 'Key[used my key here]',
        'User-Agent': 'axios/1.3.0',
        'Content-Length': '138',
        'Accept-Encoding': 'gzip, compress, deflate, br'
      },
      baseURL: 'https://api.minepi.com',
      method: 'post',
      url: '/v2/payments',
      data: '{"payment":{"amount":1,"memo":"Refund for apple pie","metadata":{"productId":"apple-pie-1"},"user id went here"}}'
    },
    request: <ref *2> ClientRequest {
      _events: [Object: null prototype] {
        abort: [Function (anonymous)],
        aborted: [Function (anonymous)],
        connect: [Function (anonymous)],
        error: [Function (anonymous)],
        socket: [Function (anonymous)],
        timeout: [Function (anonymous)],
        finish: [Function: requestOnFinish]
      },
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: '138',
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: <ref *1> TLSSocket {
        _tlsOptions: {
          allowHalfOpen: undefined,
          pipe: false,
          secureContext: SecureContext { context: SecureContext {} },
          isServer: false,
          requestCert: true,
          rejectUnauthorized: true,
          session: undefined,
          ALPNProtocols: undefined,
          requestOCSP: undefined,
          enableTrace: undefined,
          pskCallback: undefined,
          highWaterMark: undefined,
          onread: undefined,
          signal: undefined
        },
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        secureConnecting: false,
        _SNICallback: null,
        servername: 'api.minepi.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object: null prototype] {
          close: [
            [Function: onSocketCloseDestroySSL],
            [Function],
            [Function: onClose],
            [Function: socketCloseListener]
          ],
          end: [Function: onReadableStreamEnd],
          newListener: [Function: keylogNewListener],
          secure: [Function: onConnectSecure],
          session: [Function (anonymous)],
          free: [Function: onFree],
          timeout: [ [Function: onTimeout], [Function: destroy] ],
          agentRemove: [Function: onRemove],
          error: [Function: socketErrorListener],
          finish: [Function: bound onceWrapper] {
            listener: [Function: destroy]
          }
        },
        _eventsCount: 10,
        connecting: false,
        _hadError: false,
        _parent: null,
        _host: 'api.minepi.com',
        _closeAfterHandlingError: false,
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: true,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          destroyed: false,
          errored: null,
          closed: false,
          closeEmitted: false,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _maxListeners: undefined,
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: true,
          needDrain: false,
          ending: true,
          ended: true,
          finished: false,
          destroyed: false,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular *2],
        timeout: 20000,
        [Symbol(res)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(verified)]: true,
        [Symbol(pendingSession)]: null,
        [Symbol(async_id_symbol)]: 598,
        [Symbol(kHandle)]: TLSWrap {
          _parent: TCP {
            reading: [Getter/Setter],
            onconnection: null,
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _parentWrap: undefined,
          _secureContext: SecureContext { context: SecureContext {} },
          reading: true,
          onkeylog: [Function: onkeylog],
          onhandshakestart: {},
          onhandshakedone: [Function (anonymous)],
          onocspresponse: [Function: onocspresponse],
          onnewsession: [Function: onnewsessionclient],
          onerror: [Function: onerror],
          [Symbol(owner_symbol)]: [Circular *1]
        },
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: <ref *3> Timeout {
          _idleTimeout: 20000,
          _idlePrev: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleNext: TimersList {
            _idleNext: [Circular *3],
            _idlePrev: [Circular *3],
            expiry: 20599,
            id: -9007199254740989,
            msecs: 20000,
            priorityQueuePosition: 1
          },
          _idleStart: 2216,
          _onTimeout: [Function: bound ],
          _timerArgs: undefined,
          _repeat: null,
          _destroyed: false,
          [Symbol(refed)]: false,
          [Symbol(kHasPrimitive)]: false,
          [Symbol(asyncId)]: 607,
          [Symbol(triggerId)]: 602
        },
        [Symbol(kBuffer)]: null,
        [Symbol(kBufferCb)]: null,
        [Symbol(kBufferGen)]: null,
        [Symbol(kCapture)]: false,
        [Symbol(kSetNoDelay)]: false,
        [Symbol(kSetKeepAlive)]: true,
        [Symbol(kSetKeepAliveInitialDelay)]: 60,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: {
          rejectUnauthorized: true,
          ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
          checkServerIdentity: [Function: checkServerIdentity],
          minDHSize: 1024,
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: null,
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: 443,
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments',
          _defaultAgent: Agent {
            _events: [Object: null prototype],
            _eventsCount: 2,
            _maxListeners: undefined,
            defaultPort: 443,
            protocol: 'https:',
            options: [Object: null prototype],
            requests: [Object: null prototype] {},
            sockets: [Object: null prototype],
            freeSockets: [Object: null prototype] {},
            keepAliveMsecs: 1000,
            keepAlive: false,
            maxSockets: Infinity,
            maxFreeSockets: 256,
            scheduling: 'lifo',
            maxTotalSockets: Infinity,
            totalSocketCount: 1,
            maxCachedSessions: 100,
            _sessionCache: [Object],
            [Symbol(kCapture)]: false
          },
          host: 'api.minepi.com',
          noDelay: true,
          servername: 'api.minepi.com',
          _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
          encoding: null,
          singleUse: true
        }
      },
      _header: 'POST /v2/payments HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'Authorization: Key [used my key here]\r\n' +
        'User-Agent: axios/1.3.0\r\n' +
        'Content-Length: 138\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'Host: api.minepi.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: Agent {
        _events: [Object: null prototype] {
          free: [Function (anonymous)],
          newListener: [Function: maybeEnableKeylog]
        },
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object: null prototype] { noDelay: true, path: null },
        requests: [Object: null prototype] {},
        sockets: [Object: null prototype] {
          'api.minepi.com:443:::::::::::::::::::::': [ [TLSSocket] ]
        },
        freeSockets: [Object: null prototype] {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 256,
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 1,
        maxCachedSessions: 100,
        _sessionCache: {
          map: {
            'api.minepi.com:443:::::::::::::::::::::': [Buffer [Uint8Array]]
          },
          list: [ 'api.minepi.com:443:::::::::::::::::::::' ]
        },
        [Symbol(kCapture)]: false
      },
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v2/payments',
      _ended: true,
      res: IncomingMessage {
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: true,
          endEmitted: true,
          reading: false,
          constructed: true,
          sync: true,
          needReadable: false,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: true,
          autoDestroy: true,
          destroyed: true,
          errored: null,
          closed: true,
          closeEmitted: true,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: true,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _events: [Object: null prototype] {
          end: [ [Function: responseOnEnd], [Function: handleStreamEnd] ],
          error: [Function: handleStreamError],
          data: [Function: handleStreamData],
          aborted: [Function: handlerStreamAborted]
        },
        _eventsCount: 4,
        _maxListeners: undefined,
        socket: <ref *1> TLSSocket {
          _tlsOptions: {
            allowHalfOpen: undefined,
            pipe: false,
            secureContext: [SecureContext],
            isServer: false,
            requestCert: true,
            rejectUnauthorized: true,
            session: undefined,
            ALPNProtocols: undefined,
            requestOCSP: undefined,
            enableTrace: undefined,
            pskCallback: undefined,
            highWaterMark: undefined,
            onread: undefined,
            signal: undefined
          },
          _secureEstablished: true,
          _securePending: false,
          _newSessionPending: false,
          _controlReleased: true,
          secureConnecting: false,
          _SNICallback: null,
          servername: 'api.minepi.com',
          alpnProtocol: false,
          authorized: true,
          authorizationError: null,
          encrypted: true,
          _events: [Object: null prototype] {
            close: [Array],
            end: [Function: onReadableStreamEnd],
            newListener: [Function: keylogNewListener],
            secure: [Function: onConnectSecure],
            session: [Function (anonymous)],
            free: [Function: onFree],
            timeout: [Array],
            agentRemove: [Function: onRemove],
            error: [Function: socketErrorListener],
            finish: [Function]
          },
          _eventsCount: 10,
          connecting: false,
          _hadError: false,
          _parent: null,
          _host: 'api.minepi.com',
          _closeAfterHandlingError: false,
          _readableState: ReadableState {
            objectMode: false,
            highWaterMark: 16384,
            buffer: [BufferList],
            length: 0,
            pipes: [],
            flowing: true,
            ended: false,
            endEmitted: false,
            reading: true,
            constructed: true,
            sync: false,
            needReadable: true,
            emittedReadable: false,
            readableListening: false,
            resumeScheduled: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            destroyed: false,
            errored: null,
            closed: false,
            closeEmitted: false,
            defaultEncoding: 'utf8',
            awaitDrainWriters: null,
            multiAwaitDrain: false,
            readingMore: false,
            dataEmitted: true,
            decoder: null,
            encoding: null,
            [Symbol(kPaused)]: false
          },
          _maxListeners: undefined,
          _writableState: WritableState {
            objectMode: false,
            highWaterMark: 16384,
            finalCalled: true,
            needDrain: false,
            ending: true,
            ended: true,
            finished: false,
            destroyed: false,
            decodeStrings: false,
            defaultEncoding: 'utf8',
            length: 0,
            writing: false,
            corked: 0,
            sync: false,
            bufferProcessing: false,
            onwrite: [Function: bound onwrite],
            writecb: null,
            writelen: 0,
            afterWriteTickInfo: null,
            buffered: [],
            bufferedIndex: 0,
            allBuffers: true,
            allNoop: true,
            pendingcb: 1,
            constructed: true,
            prefinished: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            errored: null,
            closed: false,
            closeEmitted: false,
            [Symbol(kOnFinished)]: []
          },
          allowHalfOpen: false,
          _sockname: null,
          _pendingData: null,
          _pendingEncoding: '',
          server: undefined,
          _server: null,
          ssl: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _requestCert: true,
          _rejectUnauthorized: true,
          parser: null,
          _httpMessage: [Circular *2],
          timeout: 20000,
          [Symbol(res)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(verified)]: true,
          [Symbol(pendingSession)]: null,
          [Symbol(async_id_symbol)]: 598,
          [Symbol(kHandle)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(lastWriteQueueSize)]: 0,
          [Symbol(timeout)]: <ref *3> Timeout {
            _idleTimeout: 20000,
            _idlePrev: [TimersList],
            _idleNext: [TimersList],
            _idleStart: 2216,
            _onTimeout: [Function: bound ],
            _timerArgs: undefined,
            _repeat: null,
            _destroyed: false,
            [Symbol(refed)]: false,
            [Symbol(kHasPrimitive)]: false,
            [Symbol(asyncId)]: 607,
            [Symbol(triggerId)]: 602
          },
          [Symbol(kBuffer)]: null,
          [Symbol(kBufferCb)]: null,
          [Symbol(kBufferGen)]: null,
          [Symbol(kCapture)]: false,
          [Symbol(kSetNoDelay)]: false,
          [Symbol(kSetKeepAlive)]: true,
          [Symbol(kSetKeepAliveInitialDelay)]: 60,
          [Symbol(kBytesRead)]: 0,
          [Symbol(kBytesWritten)]: 0,
          [Symbol(connect-options)]: {
            rejectUnauthorized: true,
            ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
            checkServerIdentity: [Function: checkServerIdentity],
            minDHSize: 1024,
            maxRedirects: 21,
            maxBodyLength: Infinity,
            protocol: 'https:',
            path: null,
            method: 'POST',
            headers: [Object: null prototype],
            agents: [Object],
            auth: undefined,
            beforeRedirect: [Function: dispatchBeforeRedirect],
            beforeRedirects: [Object],
            hostname: 'api.minepi.com',
            port: 443,
            agent: undefined,
            nativeProtocols: [Object],
            pathname: '/v2/payments',
            _defaultAgent: [Agent],
            host: 'api.minepi.com',
            noDelay: true,
            servername: 'api.minepi.com',
            _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
            encoding: null,
            singleUse: true
          }
        },
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        rawHeaders: [
          'content-type',
          'application/json; charset=utf-8',
          'transfer-encoding',
          'chunked',
          'status',
          '401 Unauthorized',
          'cache-control',
          'no-cache',
          'vary',
          'Origin',
          'referrer-policy',
          'strict-origin-when-cross-origin',
          'x-permitted-cross-domain-policies',
          'none',
          'x-xss-protection',
          '1; mode=block',
          'x-request-id',
          '82cf999d-3436-48ed-aae0-acd552833649',
          'x-download-options',
          'noopen',
          'x-runtime',
          '0.133066',
          'x-frame-options',
          'SAMEORIGIN',
          'x-content-type-options',
          'nosniff',
          'date',
          'Fri, 03 Feb 2023 07:24:47 GMT',
          'x-powered-by',
          'Phusion Passenger(R)',
          'server',
          'nginx/1.18.0 + Phusion Passenger(R)',
          'connection',
          'close'
        ],
        rawTrailers: [],
        aborted: false,
        upgrade: false,
        url: '',
        method: null,
        statusCode: 401,
        statusMessage: 'Unauthorized',
        client: <ref *1> TLSSocket {
          _tlsOptions: {
            allowHalfOpen: undefined,
            pipe: false,
            secureContext: [SecureContext],
            isServer: false,
            requestCert: true,
            rejectUnauthorized: true,
            session: undefined,
            ALPNProtocols: undefined,
            requestOCSP: undefined,
            enableTrace: undefined,
            pskCallback: undefined,
            highWaterMark: undefined,
            onread: undefined,
            signal: undefined
          },
          _secureEstablished: true,
          _securePending: false,
          _newSessionPending: false,
          _controlReleased: true,
          secureConnecting: false,
          _SNICallback: null,
          servername: 'api.minepi.com',
          alpnProtocol: false,
          authorized: true,
          authorizationError: null,
          encrypted: true,
          _events: [Object: null prototype] {
            close: [Array],
            end: [Function: onReadableStreamEnd],
            newListener: [Function: keylogNewListener],
            secure: [Function: onConnectSecure],
            session: [Function (anonymous)],
            free: [Function: onFree],
            timeout: [Array],
            agentRemove: [Function: onRemove],
            error: [Function: socketErrorListener],
            finish: [Function]
          },
          _eventsCount: 10,
          connecting: false,
          _hadError: false,
          _parent: null,
          _host: 'api.minepi.com',
          _closeAfterHandlingError: false,
          _readableState: ReadableState {
            objectMode: false,
            highWaterMark: 16384,
            buffer: [BufferList],
            length: 0,
            pipes: [],
            flowing: true,
            ended: false,
            endEmitted: false,
            reading: true,
            constructed: true,
            sync: false,
            needReadable: true,
            emittedReadable: false,
            readableListening: false,
            resumeScheduled: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            destroyed: false,
            errored: null,
            closed: false,
            closeEmitted: false,
            defaultEncoding: 'utf8',
            awaitDrainWriters: null,
            multiAwaitDrain: false,
            readingMore: false,
            dataEmitted: true,
            decoder: null,
            encoding: null,
            [Symbol(kPaused)]: false
          },
          _maxListeners: undefined,
          _writableState: WritableState {
            objectMode: false,
            highWaterMark: 16384,
            finalCalled: true,
            needDrain: false,
            ending: true,
            ended: true,
            finished: false,
            destroyed: false,
            decodeStrings: false,
            defaultEncoding: 'utf8',
            length: 0,
            writing: false,
            corked: 0,
            sync: false,
            bufferProcessing: false,
            onwrite: [Function: bound onwrite],
            writecb: null,
            writelen: 0,
            afterWriteTickInfo: null,
            buffered: [],
            bufferedIndex: 0,
            allBuffers: true,
            allNoop: true,
            pendingcb: 1,
            constructed: true,
            prefinished: false,
            errorEmitted: false,
            emitClose: false,
            autoDestroy: true,
            errored: null,
            closed: false,
            closeEmitted: false,
            [Symbol(kOnFinished)]: []
          },
          allowHalfOpen: false,
          _sockname: null,
          _pendingData: null,
          _pendingEncoding: '',
          server: undefined,
          _server: null,
          ssl: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          _requestCert: true,
          _rejectUnauthorized: true,
          parser: null,
          _httpMessage: [Circular *2],
          timeout: 20000,
          [Symbol(res)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(verified)]: true,
          [Symbol(pendingSession)]: null,
          [Symbol(async_id_symbol)]: 598,
          [Symbol(kHandle)]: TLSWrap {
            _parent: [TCP],
            _parentWrap: undefined,
            _secureContext: [SecureContext],
            reading: true,
            onkeylog: [Function: onkeylog],
            onhandshakestart: {},
            onhandshakedone: [Function (anonymous)],
            onocspresponse: [Function: onocspresponse],
            onnewsession: [Function: onnewsessionclient],
            onerror: [Function: onerror],
            [Symbol(owner_symbol)]: [Circular *1]
          },
          [Symbol(lastWriteQueueSize)]: 0,
          [Symbol(timeout)]: <ref *3> Timeout {
            _idleTimeout: 20000,
            _idlePrev: [TimersList],
            _idleNext: [TimersList],
            _idleStart: 2216,
            _onTimeout: [Function: bound ],
            _timerArgs: undefined,
            _repeat: null,
            _destroyed: false,
            [Symbol(refed)]: false,
            [Symbol(kHasPrimitive)]: false,
            [Symbol(asyncId)]: 607,
            [Symbol(triggerId)]: 602
          },
          [Symbol(kBuffer)]: null,
          [Symbol(kBufferCb)]: null,
          [Symbol(kBufferGen)]: null,
          [Symbol(kCapture)]: false,
          [Symbol(kSetNoDelay)]: false,
          [Symbol(kSetKeepAlive)]: true,
          [Symbol(kSetKeepAliveInitialDelay)]: 60,
          [Symbol(kBytesRead)]: 0,
          [Symbol(kBytesWritten)]: 0,
          [Symbol(connect-options)]: {
            rejectUnauthorized: true,
            ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
            checkServerIdentity: [Function: checkServerIdentity],
            minDHSize: 1024,
            maxRedirects: 21,
            maxBodyLength: Infinity,
            protocol: 'https:',
            path: null,
            method: 'POST',
            headers: [Object: null prototype],
            agents: [Object],
            auth: undefined,
            beforeRedirect: [Function: dispatchBeforeRedirect],
            beforeRedirects: [Object],
            hostname: 'api.minepi.com',
            port: 443,
            agent: undefined,
            nativeProtocols: [Object],
            pathname: '/v2/payments',
            _defaultAgent: [Agent],
            host: 'api.minepi.com',
            noDelay: true,
            servername: 'api.minepi.com',
            _agentKey: 'api.minepi.com:443:::::::::::::::::::::',
            encoding: null,
            singleUse: true
          }
        },
        _consuming: false,
        _dumped: false,
        req: [Circular *2],
        responseUrl: 'https://api.minepi.com/v2/payments',
        redirects: [],
        [Symbol(kCapture)]: false,
        [Symbol(kHeaders)]: {
          'content-type': 'application/json; charset=utf-8',
          'transfer-encoding': 'chunked',
          status: '401 Unauthorized',
          'cache-control': 'no-cache',
          vary: 'Origin',
          'referrer-policy': 'strict-origin-when-cross-origin',
          'x-permitted-cross-domain-policies': 'none',
          'x-xss-protection': '1; mode=block',
          'x-request-id': '82cf999d-3436-48ed-aae0-acd552833649',
          'x-download-options': 'noopen',
          'x-runtime': '0.133066',
          'x-frame-options': 'SAMEORIGIN',
          'x-content-type-options': 'nosniff',
          date: 'Fri, 03 Feb 2023 07:24:47 GMT',
          'x-powered-by': 'Phusion Passenger(R)',
          server: 'nginx/1.18.0 + Phusion Passenger(R)',
          connection: 'close'
        },
        [Symbol(kHeadersCount)]: 34,
        [Symbol(kTrailers)]: null,
        [Symbol(kTrailersCount)]: 0
      },
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.minepi.com',
      protocol: 'https:',
      _redirectable: Writable {
        _writableState: WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: false,
          needDrain: false,
          ending: false,
          ended: false,
          finished: false,
          destroyed: false,
          decodeStrings: true,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: true,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: null,
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 0,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: true,
          autoDestroy: true,
          errored: null,
          closed: false,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        _events: [Object: null prototype] {
          response: [Function: handleResponse],
          error: [Function: handleRequestError],
          socket: [
            [Function: handleRequestSocket],
            [Function: destroyOnTimeout]
          ]
        },
        _eventsCount: 3,
        _maxListeners: undefined,
        _options: {
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'https:',
          path: '/v2/payments',
          method: 'POST',
          headers: [Object: null prototype] {
            Accept: 'application/json, text/plain, */*',
            'Content-Type': 'application/json',
            Authorization: 'Key [used my key here]',
            'User-Agent': 'axios/1.3.0',
            'Content-Length': '138',
            'Accept-Encoding': 'gzip, compress, deflate, br'
          },
          agents: { http: undefined, https: undefined },
          auth: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: { proxy: [Function: beforeRedirect] },
          hostname: 'api.minepi.com',
          port: '',
          agent: undefined,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/payments'
        },
        _ended: true,
        _ending: true,
        _redirectCount: 0,
        _redirects: [],
        _requestBodyLength: 138,
        _requestBodyBuffers: [],
        _onNativeResponse: [Function (anonymous)],
        _currentRequest: [Circular *2],
        _currentUrl: 'https://api.minepi.com/v2/payments',
        _timeout: null,
        [Symbol(kCapture)]: false
      },
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kEndCalled)]: true,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype] {
        accept: [ 'Accept', 'application/json, text/plain, */*' ],
        'content-type': [ 'Content-Type', 'application/json' ],
        authorization: [
          'Authorization',
          'Key [used my key here]'
        ],
        'user-agent': [ 'User-Agent', 'axios/1.3.0' ],
        'content-length': [ 'Content-Length', '138' ],
        'accept-encoding': [ 'Accept-Encoding', 'gzip, compress, deflate, br' ],
        host: [ 'Host', 'api.minepi.com' ]
      },
      [Symbol(kUniqueHeaders)]: null
    },
    **_data: {
      error: 'missing_scope',
      error_message: `User hasn't authorized "wallet_address" scope for you to access the public key.`
    }_**
  }
}

Node.js v18.12.1
[nodemon] app crashed - waiting for file changes before starting...

Please wrap your error with code block when posting. For your case, the error message is straightforward. You're missing wallet_address scope. Please refer to the doc.

hklee93 commented 1 year ago

I have changed the baseURL but now I get this error (see full error log below. This particular part of the error got my attention. What does this mean? _data: { error: 'missing_scope', error_message: User hasn't authorized "wallet_address" scope for you to access the public key. }_

True, the installed package has defined localhost as a base URL on file \node_modules\pi-backend\dist\utils.js.

var getAxiosClient = function (apiKey) {
    var axiosClient = axios_1.default.create({
        baseURL: "http://localhost:8080",
        timeout: 20000,
        headers: { Authorization: "Key ".concat(apiKey), "Content-Type": "application/json" },
    });
    return axiosClient;
};

Looks like we have some issue with the published package. We'll have it updated soon.

aurelienshz commented 1 year ago

Hi! The build for v0.1.2 was faulty and was causing this issue. Please upgrade to 0.1.3 and test again, and feel free to reopen a new issue if the problem still exists. Thanks and sorry about that!