arkade-contract
Installation
SKILL.md
Spend any Arkade contract
This skill is used from a fresh project. The artifact is produced by the writing-arkade-contracts skill (arkadec from a clone of arkade-os/compiler). covenant-viz has already drawn the transactions. This skill spends that committed JSON. The same steps cover any contract. Function names on contract.functions are the function names in the .ark file. Spend the outputs that function checks. If the picture omitted one, regenerate the picture. Do not add an output the function does not check.
Pull the SDK. It is not already in this project.
pnpm add @arkade-os/sdk
@arkade-os/sdk 0.5 is that package. arkade.programFromArtifact reads the arkadec artifact. It is not a separate named export. Do not clone the SDK, and do not pin an older tarball.
Ownership
ContractWatcheremitsvtxo_receivedandvtxo_spent. It does not write repositories and it does not read VTXO state from the indexer.ContractManageris the only writer of contract and VTXO rows. It subscribes to the watcher and fetches fresh VTXOs from the indexer.WalletandReadonlyWalletread balance and VTXOs from repositories. Indexer sync goes through the manager.- Repository interfaces carry
readonly version.ContractRepositoryis version 3. Version 2 addedContract.watch(a row with no value is watched). Version 3 removed the unpagedgetContracts; implementations providegetContractsPage. A new field bumps that version in the interface and every implementation (inMemory,indexedDB,sqlite,realm). - The wallet owns keys. Ask
wallet.getNextSigningDescriptor()andwallet.signerForDescriptor(descriptor). Do not callrandomSecretKey()for a signing key, and do not branch on wallet type.