Skip to content

feat: add Squads smart wallet toolkit for Light Tokens#31

Open
klausundklaus wants to merge 4 commits intoLightprotocol:mainfrom
klausundklaus:feat/squads-smart-wallet
Open

feat: add Squads smart wallet toolkit for Light Tokens#31
klausundklaus wants to merge 4 commits intoLightprotocol:mainfrom
klausundklaus:feat/squads-smart-wallet

Conversation

@klausundklaus
Copy link
Contributor

@klausundklaus klausundklaus commented Mar 12, 2026

Summary

  • Adds toolkits/smart-wallet/ with examples for using Light Tokens with Squads Smart Account programmable wallets
  • Setup flow: SPL mint → wrap to Light Token → transfer to smart wallet
  • Shared setup.ts helper keeps individual scripts focused
  • @sqds/smart-account SDK vendored locally with file: dependency
  • Integration test verified on devnet

Files

File Description
setup.ts Shared setup: SPL mint → wrap → create smart account → fund wallet
fund-wallet.ts Create smart account, fund with Light Tokens
wallet-send-sync.ts Immediate single-tx execution (all signers + timeLock=0)
wallet-send-async.ts Multi-step proposal flow (create → propose → approve → execute)
squads-light-token.test.ts End-to-end test covering all flows

Key implementation details

  • Wallet PDA is off-curve → uses createLightTokenTransferInstruction() for sends from wallet
  • Funding uses transferInterface() (payer is a Signer, destination is explicit ATA)
  • allowOwnerOffCurve=true for wallet associated token account creation
  • @sqds/smart-account SDK vendored in vendor/smart-account/, resolved via file: dependency

Test plan

  • Run npx tsx squads-light-token.test.ts against devnet — all steps pass
  • Verify fund-wallet.ts runs standalone
  • Verify wallet-send-sync.ts runs standalone
  • Verify wallet-send-async.ts runs standalone

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

transferInterface() and createTransferInterfaceInstructions() reject
off-curve PDAs (like Squads vault PDAs) with TokenOwnerOffCurveError.
Switch all examples to createLightTokenTransferInstruction which accepts
any PublicKey. Add confirmTransaction waits between Squads proposal steps
to prevent InvalidProposalStatus errors on devnet.

Integration test verified passing on devnet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

klausundklaus and others added 2 commits March 12, 2026 18:40
Replace legacy Squads v4 multisig/vault approach with the current
Smart Account Program (SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG).

Smart accounts are programmable wallets with two execution modes:
- Sync: immediate execution in a single tx (threshold + timeLock=0)
- Async: full proposal lifecycle (create → propose → approve → execute)

Test passes all 3 flows on devnet:
1. Fund smart wallet with Light Tokens
2. Smart wallet sends LTs via sync execution
3. Smart wallet sends LTs via async proposal flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The @sqds/smart-account SDK is not published on npm. Add our fork
(klausundklaus/smart-account-program) as a git submodule under
vendor/ and wire it into npm workspaces so the toolkit resolves
the dependency via workspace hoisting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tilo-14 tilo-14 changed the title feat: add Squads smart wallet integration toolkit feat: add Squads smart wallet toolkit for Light Tokens Mar 18, 2026
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