stx_callContract
Wrapper method for `stx_signTransaction` that calls a Stacks contract
Method name
Parameters
Parameter
Description
Required
Type
Example request
try {
// Call a read-only contract function
const response = await window.LeatherProvider.request("stx_callContract", {
contract: "SP3FBR2AGK5X3Y5D0X6MYB6Z3R9Y3WNRJY9ZTV8PV.my-contract",
functionName: "get-balance",
functionArgs: [],
});
console.log("Response:", response);
} catch (error) {
console.log("Request error:", error.error.code, error.error.message);
}Example response
Last updated
Was this helpful?