processBytecode is the required callback for production widget integrations.
It receives bytecode transactions from Deframe and must:
- Ask the wallet to sign and submit transactions.
- Wait for on-chain updates.
- Emit lifecycle statuses back to the widget.
Payload Shape
Required Success Status Path
Emit, in order:HOST_ACKSIGNATURE_PROMPTEDTX_SUBMITTEDTX_CONFIRMEDTX_FINALIZED
txHash should be included on TX_SUBMITTED and TX_CONFIRMED when available.
Required Error Statuses
SIGNATURE_DECLINEDfor user-rejected signatures (4001,ACTION_REJECTED)SIGNATURE_ERRORfor non-rejection failures before tx submissionTX_REVERTEDfor reverted on-chain transactionsTX_FAILEDfor unsupported failure paths where revert reason is unavailable
Optional Advanced Statuses
TX_REPLACEDTX_DROPPEDSWAP_CROSSCHAIN_DESTINATION_CONFIRMED
Minimal Host Implementation
Compatibility Fallback
IfprocessBytecode is not provided, SDK falls back to window.parent.postMessage(...) (REQUEST_SIGNATURE).
Use this only when your host already implements that message bridge. For new integrations, prefer explicit processBytecode.
Operational Recommendations
- Log
clientTxIdand wallet tx hash together in your backend. - Execute bytecodes sequentially in order.
- Enforce chain checks before requesting signatures.
- Persist failures and rejections for support/audit trails.