fix(examples/secp-ui): use swig wallet address for transfers and airdrops - #137
Open
paulgoleary wants to merge 1 commit into
Open
fix(examples/secp-ui): use swig wallet address for transfers and airdrops#137paulgoleary wants to merge 1 commit into
paulgoleary wants to merge 1 commit into
Conversation
…rops In Swig v3 the swig PDA holds roles/authorities while a separate wallet PDA holds SOL/tokens and is the address the program invoke_signed's for. The example was using the swig PDA as both, so transfers failed with 'from account must sign' — the program correctly signed for the wallet PDA, but the inner SystemProgram::transfer named the swig PDA as 'from'. Adds a useSwigWalletAddress hook that fetches the swig and resolves to the v3 wallet address via getSwigWalletAddress, and routes airdrops, balance reads, and the EVM + passkey transfer flows through it. The card display still shows the swig PDA (informational — that's the control account). Verified end-to-end against swig-wallet@main (v3.0.0): create passkey -> create swig -> airdrop -> transfer 0.1 SOL succeeds.
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.
In Swig v3 the swig PDA holds roles/authorities while a separate wallet PDA holds SOL/tokens and is the address the program invoke_signed's for. The example was using the swig PDA as both, so transfers failed with 'from account must sign' — the program correctly signed for the wallet PDA, but the inner SystemProgram::transfer named the swig PDA as 'from'.
Adds a useSwigWalletAddress hook that fetches the swig and resolves to the v3 wallet address via getSwigWalletAddress, and routes airdrops, balance reads, and the EVM + passkey transfer flows through it. The card display still shows the swig PDA (informational — that's the control account).
Verified end-to-end against swig-wallet@main (v3.0.0): create passkey ->
create swig -> airdrop -> transfer 0.1 SOL succeeds.