Work with Runtime Pallets
Read storage and runtime APIs over your configured RPC, and build transactions with metadata and descriptors matching that runtime. Even when a call is present in metadata, dispatch can still fail due to origin checks, account restrictions, or business preconditions.
Choose a pallet guide
Section titled “Choose a pallet guide”| Task | Guide |
|---|---|
| Check balances and transfer D9 or registered assets | Balances & Assets |
| Register a shared account and collect threshold approvals | Multisig Accounts |
| Swap D9/USDT or manage LP shares | AMM Swaps & Liquidity |
| Pay a merchant, subscribe, or redeem merit | Merchant Payments & Merit |
| Inspect referrals, burn D9, withdraw rewards, or delegate votes | Referrals, Burn Mining & Voting |
These guides show Rust pallet call names and parameters. Never pass origin manually—the runtime supplies it during dispatch. Refer to your generated descriptors for exact JavaScript/TypeScript method names and enum shapes.
Submit a pallet call
Section titled “Submit a pallet call”- Verify the genesis hash and load matching runtime metadata. Pin related reads to a single finalized block.
- Check balances, locks, and preconditions, estimate fees, and compute explicit slippage bounds.
- Display the sender, recipient, asset, amount, limits, and estimated fee to the user before requesting approval.
- Sign and submit through your transaction workflow (see Transactions & Finality).
- Wait for block finalization and inspect the emitted events.
Verify the outcome
Section titled “Verify the outcome”Record the extrinsic hash, finalized block hash, and extrinsic index. Decode System::Events filtered by phase ApplyExtrinsic(index) using that block’s metadata:
| Event | Handling |
|---|---|
System::ExtrinsicSuccess |
The outer dispatch succeeded. |
System::ExtrinsicFailed |
Decode the DispatchError with matching metadata. Fees may still apply; rollback depends on the call. |
Multisig::MultisigExecuted |
Inspect result to verify the inner call succeeded. |
Utility batch events |
Check per-item completion or interruption events; a batch can partially succeed before failing. |
D9Merchant::AutoRedemptionDeferred |
Optional auto-redemption was deferred. Verify the payment’s remaining events separately. |
Treat wallet approval, RPC acceptance, and best-block inclusion as pending. Only a finalized block containing the expected events confirms execution.
