Skip to main content
1 of 3

polkadot js RPC can't get u128

i have an rpc call that returns a balance of an asset for a user, balance type is u128. when the number is large i get this error createType(u128):: Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1. I have tried specifying different types to make it cast to u128 but rpc kept failing. CURL for the rpc works in terminal and returns large numbers. Seems like the problem on JS, how can i cast the returned value into a BigInt? Thank you!