gbangbola-stx-deploy
v1.0.0
Published
Deploy, verify, and manage Stacks L2 smart contracts
Maintainers
Readme
gbangbola-stx-deploy
Deploy, verify, and manage Stacks L2 smart contracts.
| | Link |
|---|------|
| npm | gbangbola-stx-deploy |
| Repository | Gbangbolaoluwagbemiga/gbangbola-stx-deploy |
Install
npm install gbangbola-stx-deployDepends on @stacks/transactions, @stacks/network, and richiey1-stacks-helpers-types.
Usage
import { deployContract, getContractInfo, isContractDeployed } from "gbangbola-stx-deploy";
// Deploy a contract
const result = await deployContract({
contractName: "my-contract",
codeBody: "(define-public (hello) (ok \"world\"))",
senderKey: "your-private-key",
});
// Check if a contract is deployed
const exists = await isContractDeployed("SP...", "contract-name");
// Get contract info
const info = await getContractInfo("SP...", "contract-name");
// Returns: { source, publishHeight, clarityVersion, txId }API
deployContract(options)
Deploy a Clarity contract to mainnet/testnet. Options:
contractName— Name of the contractcodeBody— Clarity source codesenderKey— Deployer's private keynetwork?— Stacks networknonce?— Transaction noncefee?— Transaction fee
getContractInfo(contractAddress, contractName, networkUrl?)
Fetch deployed contract information.
isContractDeployed(contractAddress, contractName, networkUrl?)
Check if a contract exists on-chain.
Development
npm install
npm run buildLicense
MIT
Author
gbangbolaoluwagbemiga
