I'm working with NEAR's canonical example of an NFT smart contract, which implements the NEP4 standard API for NFT tokens.
Half of those API calls require a 64-bit integer for the token_id argument.
I'd like to call this API from a web app. But those u64 values can't be normal Javascript numbers on the client side, because Javascript integers are only 53 bits wide
This workaround can work for some cases, but it requires changing the API signature. I think that breaks compatibility with the standard.
I've tried passing the value as a string, and as a BigInt. But I got errors in both cases.
How can I call NEAR contract methods from Javascript if they require 64-bit values? For instance, can I trick the JSON serializer to turn a BigInt on the client into a u64 on the wire?