Run an action
examples/action.ts is the action machine with nothing around it. Read it
once and the approval screens make sense.
Set up
Section titled “Set up”LocalNet and the keystore daemon, with one funded account:
vibekit localnet startvibekit keystore startvibekit keystore generate ed25519 --name alicevibekit localnet fund <alice's address>Run it
Section titled “Run it”SENDER=<alice's address> bun packages/vibekit/examples/action.tsIt prints one line per stage:
draftedsimulatedinspectedawaiting-approvalsignedconfirmed{ transactionId: '…', confirmedRound: 42 }What each line is
Section titled “What each line is”- drafted —
host.draft('send_payment', args)ran the tool in compose mode and wrapped the unsigned group as a record. The facts an approval shows (sender, amount, fee) were decoded from the bytes, not copied fromargs. - simulated — the exact bytes went to algod’s simulate; the record says whether they would succeed and what they cost.
- inspected, awaiting-approval — the machine has everything a person needs and stops. This is the only place it stops.
- The line between those and signed is
performActionStep({ kind: 'approve' })— in the example, that is you, reading the code. In an app it is a button. - signed — the keystore’s
TransactionSignersigned the drafted bytes;signDraftWithrefused anything else. - confirmed — broadcast, and waited for a round.
Change one thing
Section titled “Change one thing”- A different action: replace
'send_payment'and its args with any action in the tools reference; a swap with a router’s pre-signed leg goes through the same stages. - A different signer:
signDraftWithtakes anyalgosdk.TransactionSigner. See swap the signer. - A browser: the same machine, with the host over HTTP
(
createRemoteActionHost) and the wallet as the signer — that is what the reference app does.