Skip to main content

Troubleshooting

InvalidReferenceHash

  • Always hash the final reference string after session tags or relay annotations.
  • Use SDK helpers (createFlexIntent, sendRouterPayment, formatSessionReference).

Permit2 witness mismatch

  • Use /networks to fetch the canonical permit2WitnessTypeString.
  • Ensure your witness uses the same intentHash and schemeId as the router call.

SchemeId mismatch

  • Use getFlexSchemeId('exact:evm:permit2') (or the correct scheme label).
  • Don’t hash ad-hoc scheme strings.

Network mismatch

  • Verify chain ID and router address from /networks.
  • Ensure signer is connected to the same network as the intent.

Permit2 allowance insufficient

  • Use /relay/permit2/bundle for gasless approvals.
  • Confirm allowance against the Permit2 contract for the selected token.

Session spend errors

  • Fetch the latest spendNonce from X402FlexSessionStore.getSessionSpendNonce.
  • Ensure sessionAuth uses the current epoch and expiresAt window.

EIP-3009 nonce mismatch

  • Derive authNonce from the intent hash, router address, and chainId.
  • Use deriveEip3009Nonce({ intentHash, router, chainId }) from the SDK.