pattern-tech / gateway

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

[BUG]: getAssetBalance method has type error #31

Closed hirotadashi closed 1 month ago

hirotadashi commented 2 months ago

While importing the Ergo class to my test file to start testing, I am facing this error about BigInt:

/home/sati/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/chains/ergo/ergo.ts:494:7 - error TS2322: Type 'bigint' is not assignable to type 'number'.

494       balance = utxos.reduce(
          ~~~~~~~

    at createTSError (/home/sati/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/home/sati/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/home/sati/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/home/sati/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/home/sati/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
    at Object.require.extensions.<computed> [as .ts] (/home/sati/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1249:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1065:12)
    at Module.require (node:internal/modules/cjs/loader:1271:19) {
  diagnosticCodes: [ 2322 ]
}