feat(tvf): collect transaction hashes for stellar_signXDR and stellar_signAndSubmitXDR - #346
Open
jakubuid wants to merge 1 commit into
Open
feat(tvf): collect transaction hashes for stellar_signXDR and stellar_signAndSubmitXDR#346jakubuid wants to merge 1 commit into
jakubuid wants to merge 1 commit into
Conversation
…_signAndSubmitXDR Swift port of WalletConnect/walletconnect-monorepo#7318. - stellar_signAndSubmitXDR: extract tx_hash from the wallet response. - stellar_signXDR: compute the hash dependency-free from the base64 TransactionEnvelope XDR as sha256(network_id || envelope_type || transaction_body) via CryptoKit. Supports V0, V1 and fee-bump envelopes; the trailing DecoratedSignature array is located by a validated scan rather than parsing the full transaction schema. Network passphrase is selected from the request's CAIP-2 chain param (defaults to pubnet). Test vectors are real pubnet/testnet transactions fetched from Horizon, identical to the vectors in the JS and Kotlin PRs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @jakubuid's task in 3m 40s —— View job Code Review CompleteTasks
Review Summary✅ No issues found Automated Checks✅ No external domain URLs detected Reviewed 3 files:
|
|
| static let STELLAR_SIGN_XDR = "stellar_signXDR" | ||
| static let STELLAR_SIGN_AND_SUBMIT_XDR = "stellar_signAndSubmitXDR" | ||
|
|
||
| private static let pubnetPassphrase = "Public Global Stellar Network ; September 2015" |
ignaciosantise
approved these changes
Aug 18, 2026
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.




Description
Swift port of WalletConnect/walletconnect-monorepo#7318 — adds Stellar to TVF transaction-hash collection per the Stellar RPC proposal. Sibling PR: reown-com/reown-kotlin#426.
stellar_signAndSubmitXDRtx_hashstellar_signXDRsignedXDR— hash computed client-sideHash computation (
StellarTVFCollector)sha256(network_id ‖ envelope_type ‖ transaction_body)from the base64TransactionEnvelopeXDR:DecoratedSignature<20>array with a validated scan (fixed 72-byte ed25519 entries) — no full XDR schema parsingchainparam, defaulting to pubnetNo new dependencies — CryptoKit SHA256 + Foundation base64, same as the Cosmos collector.
Tests
8 cases in
StellarTVFCollectorTestsusing real Horizon transactions (byte-identical vectors to the JS/Kotlin PRs): pubnet V1 (QA-verified against Stellar Lab), pubnet fee-bump → canonical hash, testnet, default-to-pubnet,tx_hashextraction (the on-chain hash from the E2E wallet QA run), malformed envelope → nil, error result → nil, method support.xcodebuild test -scheme WalletConnect -only-testing:RelayerTests/StellarTVFCollectorTests→ Executed 8 tests, with 0 failures. TEST SUCCEEDED.QA context
The same algorithm was E2E-verified via react-dapp-v2 → react-wallet-v2 with the JS SDK build:
signAndSubmitXDRhash confirmed on-chain (stellarchain.io),signXDRhash confirmed against Stellar Lab's independent computation.🤖 Generated with Claude Code