Skip to content

fix(examples/secp-ui): use swig wallet address for transfers and airdrops - #137

Open
paulgoleary wants to merge 1 commit into
anagrambuild:mainfrom
oleary-labs:fix/secp-ui-v3-wallet-address
Open

fix(examples/secp-ui): use swig wallet address for transfers and airdrops#137
paulgoleary wants to merge 1 commit into
anagrambuild:mainfrom
oleary-labs:fix/secp-ui-v3-wallet-address

Conversation

@paulgoleary

Copy link
Copy Markdown

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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant