Error: NoSpendableInput

Getting below error when making a call simulation in TS-SDK.

call syntax:-
const id = { value: "0x6be7962fda4fa8fb4351ac7ffd1758ead948d79f374cf6edafb8f3861a9df70c" }; const res = await contract.functions.total_supply(id).simulate();

Error:-

Error: NoSpendableInput: {"response":{"data":null,"errors":[{"message":"NoSpendableInput","locations":[{"line":2,"column":3}],"path":["dryRun"]}],"status":200,"headers":{"map":{"content-length":"109","content-type":"application/json"}}},"request":{"query":"mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {\n dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {\n ...receiptFragment\n }\n}\n\nfragment receiptFragment on Receipt {\n contract {\n id\n bytecode\n salt\n }\n pc\n is\n to {\n id\n bytecode\n salt\n }\n toAddress\n amount\n assetId\n gas\n param1\n param2\n val\n ptr\n digest\n reason\n ra\n rb\n rc\n rd\n len\n receiptType\n result\n gasUsed\n data\n sender\n recipient\n nonce\n contractId\n subId\n}","variables":

Hmmm I don’t see why this would be the case because you’re making a read only call in those two lines. Is there a working branch I can take a look at @chappie1998?

1 Like

Worth noting that although @chappie1998 is making a read only call, it must still meet all the requirements of a valid transaction. We’d usually see this error if there was no spendable input on the transaction. As it’s read only, the input will not be spent, however it is still required on the transaction to be deemed valid.

2 Likes

just reading nft contract total_supply.

May I know what other parameters needs to be added. in the example of docs there it’s the same. Quickstart Frontend | Fuel Docs

HI there, does your wallet has funds?
This topic might help you.