đ´stx_deployContract
You can use the stx_deployContract
method to request the signature of any contract deployment transaction from the user's wallet. The method lets you specify the contract code and the contract name:
name
a string representing the name under which to deploy the contract
Example: ST000000000000000000002AMW42H.pox-3
clarityCode
a string representing the code of the contract to deploy, in Clarity language
clarityVersion
âšī¸ Optional
The Clarity version used for the contract code. Will default to the latest Clarity version if undefined
You can use any Stacks library to construct these transaction. See examples using helpers from the @stacks/transactions
package
The user will see a Stacks contract deployment transaction signing request prompt in the wallet.
The transaction will be signed and broadcasted upon user approval.
The stx_deployContract
method returns a Promise that resolves to the DeployContractResult
object:
txid
a hex-encoded string representing the ID of the Stacks contract deployment transaction signed
transaction
a hex-encoded string representing the Stacks contract deployment transaction signed
Last updated