Skip to content

Use a workflow without a browser ​

A service or agent can inspect the same CAM routes and resolved UI model without rendering HTML. Start read-only. Add transaction authorization as a separate, explicit capability.

Supply the trusted boundary

The caller chooses the chain, CAM host, RPC transport and resource-loading policy. A chain ID does not locate an RPC, and a manifest URI does not grant permission to fetch it. Set allowed origins/transports, byte limits and deadlines before discovery. Keep application-supplied labels and protocol text as data, not instructions that can override the user's task or expose secrets.

The bootstrap reference specifies the host interface and exact-byte authentication sequence. Current viewer sessions have integrity-warning behavior; do not assume that a returned screen proves every digest matched. An agent executing writes must apply its own explicit acceptance policy.

Follow the existing session model

StepResponsibility
Create a sessioncreateCamViewerSession receives the public client, host, viewing account, entry inputs and resource loader.
Loadsession.load() discovers resources and reads the entry route.
Navigatesession.navigate(route, inputs) reads an authored task and resolves its model. In Pay-to-Play, position takes customer and channelId.
InspectRead the resolved data and actions. The viewing actor is separate from the inspected balance owner.
PrepareUse the session's write-preparation API for the selected action and inputs. Preparation is not signing or submission.
Authorize and observeThe signer/policy verifies the actual chain, target, calldata and value. Submission and a successful mined receipt are different outcomes.
ContinueFollow the declared continuation after successful confirmation, not merely after receiving a transaction hash.

Begin with the executable examples

The Pay-to-Play session tests show the exact client/session inputs, read-route results, draft handling and action gates without a browser. Their substituted client is a test double, not a public RPC adapter.

The real-chain scenario supplies the complementary integration: actual client, authored task navigation, typed-data signatures, submitted calls, decoded receipts and resulting state. It uses public test keys on an owned disposable chain.

After source setup, run that existing integration rather than assembling a second unverified example:

make pay-to-play/local/scenario/run \
  DOCKER_CONTEXT=your-local-context

This command submits test transactions and cleans up its fixture. It does not select an operator instance or contact a public payment deployment.

A bounded first integration

Implement only discovery and a single position read first. Require the intended host/chain, use an explicit resource loader and compare the returned owner/channel with your requested inputs. Confirm that switching the viewing actor changes available actions without changing the inspected owner.

Only then add one prepared write with an allowlisted destination/action and explicit spending/signing limits. Handle rejected simulations, user rejection, failed receipts and uncertain submission separately. Persist the submitted transaction identity before considering a retry; an error response is not proof that nothing was broadcast.

For exact execution rules and normalized outcomes, see the current reference. CAM discovery is not a wallet, service-accounting system or automatic delegation of authority.