420 Wallet integration examples¶
These examples describe safe integration sequences without freezing generated ABI/API details that belong in DOC-10.
Read an account safely¶
- validate the intended 420 Integrated network;
- obtain the selected controller/account context from the qualified Wallet connection;
- resolve the canonical
SmartAccount420relationship where applicable; - read balance/account state through a qualified RPC/Indexer path;
- for security-critical authority, verify current canonical account/capability state rather than relying only on cached Wallet UI data.
Request a one-time transaction¶
- resolve the canonical target contract/interface;
- construct the call with explicit target, calldata and value;
- provide human-readable action context;
- request simulation where supported;
- let the Wallet/account boundary obtain explicit authorization;
- submit once;
- track receipt and finality;
- re-read resulting canonical state.
Request reusable capability authority¶
- identify the exact target/action set needed;
- choose the narrowest spend/value limits and expiry;
- bind the request to the intended network/account;
- present scope clearly to the user;
- obtain the canonical grant;
- store only public capability identifiers/metadata needed by the integration;
- before later use, re-check that the capability remains valid and in the current authorization epoch;
- handle revocation/expiry as normal expected state.
Handle a stale session¶
If a previously working session begins failing, do not silently broaden authority or fall back to owner-level execution. Re-read canonical session/capability state, detect expiry/revocation/epoch change, and ask for a new bounded grant only when the workflow still requires it.
Handle uncertain submission¶
If submission returns an ambiguous transport error after signing, first query the known transaction/request identity. Do not create a second economic action until you establish whether the original transaction was accepted or executed.
Avoid these patterns¶
- asking users to paste private keys or recovery phrases into a dApp;
- treating
connected=trueas spending authority; - hard-coding a single frontend URL as canonical application identity;
- trusting a cached capability indefinitely;
- resubmitting a write repeatedly on timeout;
- treating an Indexer event as finalized without finality context;
- requesting owner-level authority for a narrowly scoped recurring action.