stx_deployContract
Deploy a Clarity smart contract on the Stacks blockchain.
Method name
Parameters
Parameter
Description
Required
Type
Example request
try {
// Deploy contract
const response = await window.LeatherProvider.request("stx_deployContract", {
name: "my-smart-contract",
clarityCode: "(define-public (say-hi) (ok \"Hello, world!\"))",
clarityVersion: 2,
});
console.log("Response:", response);
} catch (error) {
console.log("Request error:", error.error.code, error.error.message);
}Example response
Last updated
Was this helpful?