Repository navigation
Conversation
Co-authored-by: Copilot <copilot@github.com>
…k and oid4vcAgentProviderMock
…o Wallet module and controller
Require a manager-issued `fee-sponsorship-credential` SD-JWT VC on POST /wallet/transactions/sponsor/. CredentialAuthGuard now resolves the required vct from @RequiredCredential route metadata (defaulting to device-attestation-credential, so existing routes are unchanged). Possession of the credential is the entitlement — the manager only issues it to users allowed to use sponsored-fee routes. The sponsor route additionally requires every user transaction in the group to be sent from the Algorand address bound to the presented credential's did:key, so fees are only sponsored for the credential holder's own transactions. - Replace the credential-gated GET /wallet/sponsor/ with a public unauthenticated GET /wallet/manager/address so wallets can learn the Sponsor address before building a group; drop SponsorDetailDto and getSponsorInfo - Add unit specs for CredentialAuthGuard (default and metadata-selected vct, cross-rejections, issuer/binding failures) - Add e2e coverage for the full journey: register the custom configuration, issue and redeem the VC over OID4VCI, present it, and get the group sponsored — plus rejection of absent credentials, device-attestation credentials, and groups sent by other wallets Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Coverage report
Show new covered files 🐣
Test suite run success363 tests passing in 29 suites. Report generated by 🧪jest coverage report action from 99dad50 |
Reject sponsor transactions that set rekeyTo or payment.closeRemainderTo, validate transactions array elements are base64 strings, and fix the manager address doc path to include the /v1 prefix.
bwmx
marked this pull request as ready for review
September 22, 2026 12:05
Resolved conflicts in wallet.service.ts and wallet.service.spec.ts: kept both sponsorship and master's PQ/account-type changes; sponsor test now passes the ManagerVaultTokenProvider constructor arg.
- Detect Falcon (pqsig) signed companions from the raw msgpack, since algokit's decodeSignedTransaction drops pqsig, and require 3x the minimum fee for each. Previously such groups passed validation at 1x and were then rejected by the network. - Accept unsigned transactions with or without the "TX" prefix. - Collapse the three group-id checks into one: every transaction must carry the group id recomputed from the submitted transactions. - Rely on the request DTO (2..16 base64 entries) instead of re-checking array length in the service. - Sign the re-encoded sponsor transaction directly; drop the per-envelope unsignedEncoded copy and the dead try/catch around groupTransactions. - Use new Address(...) like the rest of the service instead of encodeAddress. - Deduplicate sponsorship test fixtures and table-drive the sponsor field checks; add a DTO validation test. - Add on-chain e2e coverage: sponsored ed25519 (2x) and Falcon (4x) payments confirm with the user paying no fee, and a Falcon group 1 µALGO short is rejected by both the endpoint and algod simulation.
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.
Summary
Adds
POST /v1/wallet/transactions/sponsor/, allowing the authenticated manager to sign a fee-pooling transaction without submitting the group.Transaction group
payfrom manager → manager, amount0, with enough fee to cover the group, and norekeyToorcloseRemainderTo.pqsig) or unsigned transactions, each withfee = 0. Unsigned transactions may be sent with or without theTXprefix.Required fee
minFee × (N + 2 × pqsig-signed companions), since a Falcon-signed transaction costs 3× the minimum fee. An unsigned companion the caller will Falcon-sign later is counted at 1×, so the caller must add the extra 2× themselves.The response contains only the base64-encoded
transactionsarray. The manager address remains available throughGET /v1/wallet/manager/.No existing endpoints changed.
Validation