fetchCallReadOnlyFunction
Usage
import { fetchCallReadOnlyFunction, Cl } from '@stacks/transactions';
const result = await fetchCallReadOnlyFunction({
contractAddress: 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM',
contractName: 'my-contract',
functionName: 'get-balance',
functionArgs: [Cl.standardPrincipal('ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5')],
senderAddress: 'ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5',
network: 'testnet',
});
console.log(result); // ClarityValue — e.g. UIntCV { type: 'uint', value: 1000n }Notes
Signature
Returns
Parameters
opts.contractAddress (required)
opts.contractName (required)
opts.functionName (required)
opts.functionArgs (required)
opts.senderAddress (required)
opts.network (optional)
opts.client (optional)
Last updated
Was this helpful?