Skip to content

feat(wallet): Gracefully handle 422 guardian errors for native clients#2799

Open
JCSanPedro wants to merge 2 commits intomainfrom
BSB-10-improve-guardian-sim-dx
Open

feat(wallet): Gracefully handle 422 guardian errors for native clients#2799
JCSanPedro wants to merge 2 commits intomainfrom
BSB-10-improve-guardian-sim-dx

Conversation

@JCSanPedro
Copy link
Contributor

@JCSanPedro JCSanPedro commented Mar 11, 2026

Hi👋, please ensure the PR title follows the below standards:

  • PR is titled with conventional commit style naming: type(scope): message. For example: feat(passport): my new feature
  • If you have introduced modification that necessitates immediate adjustments by this SDK's users to their applications, clients, or integrations to avert disruptions to existing features or functionalities, add a ! after the type(scope), for example feat(passport)!: my new breaking feature

Summary

Native (Unreal/Unity) SDK clients that use the game bridge cannot display the Guardian confirmation screen, so they have historically received a generic TRANSACTION_REJECTED error whenever a transaction needed user approval — including when the transaction would revert on-chain. This gave developers no way to distinguish a definite revert from a transaction that simply needs user approval.

The Guardian API will begin returning a 422 response (instead of 200 confirmationRequired: true) when a simulated transaction will revert, but only for native clients on SDK >= 2.13.0. This SDK change handles that new response:

  • Game bridge clients: A 422 from Guardian throws a new JsonRpcError with code TRANSACTION_REVERTED (-32015) and the simulation revert reason surfaced in the message. Developers can now programmatically distinguish a definite revert from other error conditions.
  • Web SDK clients: a 422 falls back to requiring confirmation, preserving the existing confirmation-screen flow. No behaviour change for web.

New error code: RpcErrorCode.TRANSACTION_REVERTED = -32015 added to JsonRpcError.ts.

@JCSanPedro JCSanPedro requested a review from a team as a code owner March 11, 2026 21:25
@JCSanPedro JCSanPedro changed the title BSB-10(wallet): Gracefully handle 422 guardian errors for native clients feat(wallet): Gracefully handle 422 guardian errors for native clients Mar 11, 2026
@nx-cloud
Copy link

nx-cloud bot commented Mar 11, 2026

View your CI Pipeline Execution ↗ for commit a693f52

Command Status Duration Result
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-11 22:18:59 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant