@stacks/transactions
Construct, decode transactions and work with Clarity smart contracts on the Stacks blockchain.
callReadOnlyFunction
Read-only contract functions can be called without generating or broadcasting a transaction. Instead it works via a direct API call to a Stacks node.
Properties
contractAddress
Requiredstring
The principal of the contract address you are calling, starts with SP
for mainnet and ST
for testnet.
contractName
Requiredstring
The name of the contract address you are calling, comes after the .
on the contract address.
functionName
Requiredstring
The name of the read-only
function you are calling.
functionArgs
Requiredarray
An array of arguments that need to be passed to the read-only
function. If no arguments are needed, you must pass an empty array.
network
Requiredobject
The network instance that the contract exists on.
Example:new StacksTestnet()
senderAddress
Requiredstring
The principal address that the call is being made from.
postConditions
array
A set of conditions that can optionally be passed along in the transaction to prevent any unwanted asset movement.
Last updated on