đ´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:
Request parameters | Description |
---|---|
| a string representing the name under which to deploy the contract
Example: |
| a string representing the code of the contract to deploy, in Clarity language |
|
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:
Property | Description |
---|---|
| a hex-encoded string representing the ID of the Stacks contract deployment transaction signed |
| a hex-encoded string representing the Stacks contract deployment transaction signed |