Skip to main content
added 2 characters in body
Source Link
Arunjot Singh
  • 847
  • 2
  • 9
  • 34

i have an rpc call that returns an array of structs with multiple fields, one of which is 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<= 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, what can i do to be able to be to parse the structs such that the value of balance is a valid number, possibly a BigInt? Thank you!

i have an rpc call that returns an array of structs with multiple fields, one of which is 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, what can i do to be able to be to parse the structs such that the value of balance is a valid number, possibly a BigInt? Thank you!

i have an rpc call that returns an array of structs with multiple fields, one of which is 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, what can i do to be able to be to parse the structs such that the value of balance is a valid number, possibly a BigInt? Thank you!

Became Hot Network Question
added 116 characters in body
Source Link

i have an rpc call that returns aan array of structs with multiple fields, one of which is 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, howwhat can i castdo to be able to be to parse the returnedstructs such that the value intoof balance is a valid number, possibly a BigInt? Thank you!

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!

i have an rpc call that returns an array of structs with multiple fields, one of which is 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, what can i do to be able to be to parse the structs such that the value of balance is a valid number, possibly a BigInt? Thank you!

Source Link

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!