woodser / monero-ts

TypeScript library for using Monero
http://woodser.github.io/monero-ts/typedocs
MIT License
210 stars 71 forks source link

Cannot convert a BigInt value to a number #211

Closed sharifzadesina closed 2 months ago

sharifzadesina commented 4 months ago

Hello,

It seems there is a bug, we are using Math.max for BigInt numbers, which is not supported.

When using wallet.getNumBlocksToUnlock() I get the following error:

TypeError: Cannot convert a BigInt value to a number
    at Math.max (<anonymous>)
    at MoneroWalletFull.getNumBlocksToUnlock (/home/sina/Projects/pouch-js/node_modules/monero-ts/src/main/ts/wallet/MoneroWallet.ts:448:38)
    at <anonymous> (/home/sina/Projects/pouch-js/test.ts:21:19)
woodser commented 2 months ago

Fixed in 0.9.8 release (txs with unlock time as timestamp are ignored).