You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful if the value returned by the /runtime/metadata endpoint was decoded to decimal.
Currently, this is what is returned when querying Polkadot:
"constants": [
{
"name": "ExistentialDeposit",
"type": "6",
"value": "0x00e40b54020000000000000000000000",
"docs": [
" The minimum amount required to keep an account open."
]
},
The alternative to this would be to have the user convert it themselves, but being that this is SCALE encoded, they would need another library and the know-how to do so. Since the goal for Sidecar is to be an abstraction layer between PJS API and the user, I think this would be a good quality of life upgrade.
The text was updated successfully, but these errors were encountered:
Okay so currently this is because the values expected from constants such as ExistentialDeposit are typed as a u128. Which in Javascript cant be greater than 53 bits. In this case it's returned as a hex value with the prototype chain being the following: -> Bytes -> Raw -> Uint8Array -> TypedArray -> Object.
Technically we can just use hexToBn(value, { isLe: true }).toString() when sanitizing. But the trouble I am having currently is how can we generically apply this to the sanitation process without making any assumptions on what the value of the bytes are (Is it a u128, or maybe a very large hex value containing a bunch of information 🤷 ).
It would be useful if the value returned by the
/runtime/metadata
endpoint was decoded to decimal.Currently, this is what is returned when querying Polkadot:
The alternative to this would be to have the user convert it themselves, but being that this is SCALE encoded, they would need another library and the know-how to do so. Since the goal for Sidecar is to be an abstraction layer between PJS API and the user, I think this would be a good quality of life upgrade.
The text was updated successfully, but these errors were encountered: