Conversation
SIGN_POLYGON_TRANSACTION now takes the plain fields of a gasless transfer through the GaslessTransfer contract of NimiqToolbox/gas-abstraction (token, from, to, amount, fee, relay), the token permit nonce and an optional `corrects` for a new version of an earlier payment. It returns the relay submit body (request, signature, authorization). The Keyguard validates everything against its own pins; the Hub checks the shape and forwards only the known fields. - Move the request parsing into SignPolygonTransactionRequestParsing.ts, with unit tests. - Look up Polygon addresses case-insensitively. - Remove the OpenGSN RelayRequest type and USDC/USDT HTLC support from setupSwap and refundSwap (breaking change of @nimiq/hub-api). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKgXoeSB62akioiTzYya6C
Swaps will move to the new gas abstraction separately, so restore the OpenGSN-based swap code in setupSwap, refundSwap and signPolygonTransaction, and only add the gasless transfer variant: - SIGN_POLYGON_TRANSACTION accepts either a gasless transfer (SignPolygonGaslessTransferRequest, parsed and forwarded field by field) or, as before, an OpenGSN relay request for swap related transactions. signPolygonTransaction's result type follows the request variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKgXoeSB62akioiTzYya6C
This was referenced Sep 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKgXoeSB62akioiTzYya6C
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds gasless USDC/USDT0 transfers to
signPolygonTransaction. They use theGaslessTransfercontract and Nimiq relay of NimiqToolbox/gas-abstraction (private) instead of OpenGSN. Swap-related requests (setupSwap,refundSwap, OpenGSN relay requests tosignPolygonTransaction) are unchanged; they move to the new gas abstraction in a follow-up.Part of a coordinated change
@nimiq/keyguard-clienttypes)@nimiq/hub-apitypes)Release order: Keyguard, then Hub, then Wallet.
Changes
@nimiq/hub-api):SignPolygonGaslessTransferRequest:request: { token, from, to, amount, fee, relay },tokenNonce, optionalcorrects(the payment's latest signed version, to re-sign it with the same nonce),recipientLabel.SignedPolygonGaslessTransfer:{ request, signature, authorization }, the relay'sPOST /v1/transferbody.signPolygonTransaction()accepts it besides the existingSignPolygonTransactionRequest. The result type follows the request type.relayDataare parsed by the newSignPolygonTransactionRequestParsing.ts(shape checks only) and forwarded to the Keyguard field by field. The Keyguard validates them against its own pins. OpenGSN requests are passed through as before.findWalletByPolygonAddressand the signer lookup inSignPolygonTransaction.vuecompare addresses case-insensitively.Compatibility
Additive for type consumers. At runtime, the Keyguard (nimiq/keyguard#570) no longer signs the OpenGSN transfer variant (
transferWithPermit/transferWithApproval), so third-party apps that still build it get an error.SIGN_POLYGON_TRANSACTIONstays on the third-party whitelist.Before merging
@nimiq/keyguard-clientto the version released from Gasless USDC/USDT0 transfers (replaces OpenGSN for transfers) keyguard#570. Locally, this was tested withyarn link.@nimiq/hub-api, incl.client/dist.Testing
yarn test:unit: 87 passing, including the newSignPolygonTransactionRequestParsing.spec.ts.tsc,yarn lint, andyarn lint/yarn buildinclient/.yarn build:cifails locally with the same Ledger module parse errors onmaster, so.vuefiles weren't type-checked by the build.🤖 Generated with Claude Code
https://claude.ai/code/session_01AKgXoeSB62akioiTzYya6C