Skip to content

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

Merged
JCSanPedro merged 2 commits into
mainfrom
BSB-10-improve-guardian-sim-dx
Mar 16, 2026
Merged

feat(wallet): Gracefully handle 422 guardian errors for native clients#2799
JCSanPedro merged 2 commits into
mainfrom
BSB-10-improve-guardian-sim-dx

Conversation

@JCSanPedro

@JCSanPedro JCSanPedro commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

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

nx-cloud Bot commented Mar 11, 2026

Copy link
Copy Markdown

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

@JCSanPedro
JCSanPedro added this pull request to the merge queue Mar 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 16, 2026
@JCSanPedro
JCSanPedro added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit 9cb8149 Mar 16, 2026
10 of 11 checks passed
@JCSanPedro
JCSanPedro deleted the BSB-10-improve-guardian-sim-dx branch March 16, 2026 01:22
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.

2 participants