| Field | Value |
|---|---|
| Name | prepare |
| Title | Prepare Transaction |
| Description | Prepare a Convex transaction for signing. Returns a hash to pass to 'signAndSubmit' or 'submit'. Common source patterns: - Transfer: (transfer #DEST AMOUNT) - Deploy actor: (deploy '(do (defn greet [x] (str "Hello " x)) (export greet))) - Call actor: (call #ACTOR (function-name arg1 arg2)) - Define value: (def my-var 42) - Set controller: (set-controller #ADDR) - Register CNS: (call #9 (cns-update 'my.name *address*)) Amounts in copper (1 CVM = 1,000,000,000 copper). |
Input Schema
{
"type": "object",
"required": ["source",
"address"],
"properties": {
"sequence": {
"type": "integer",
"description": "Optional explicit sequence number; defaults to current account sequence + 1"
},
"source": {
"type": "string",
"description": "Convex Lisp source code for the transaction. See description for common patterns."
},
"address": {
"type": "string",
"description": "Origin account address (e.g. '#11' or '11'). Transaction executes from this account."
}
}
}Output Schema
{
"type": "object",
"properties": {
"sequence": {
"type": "integer",
"description": "Sequence number used for this transaction"
},
"data": {
"type": "string",
"description": "Hex-encoded transaction bytes"
},
"source": {
"type": "string",
"description": "Original source expression that was prepared"
},
"hash": {
"type": "string",
"description": "Transaction encoding to sign - pass this to signAndSubmit or submit"
},
"address": {
"type": "integer",
"description": "Address that will execute the transaction"
}
}
}