Skip to content

Update dapp skill to Stellar Wallets Kit v2#74

Merged
kaankacar merged 1 commit into
mainfrom
fix-dapp-wallets-kit-v2
Jul 21, 2026
Merged

Update dapp skill to Stellar Wallets Kit v2#74
kaankacar merged 1 commit into
mainfrom
fix-dapp-wallets-kit-v2

Conversation

@kaankacar

Copy link
Copy Markdown
Contributor

Closes #56.

Rewrites the Wallets Kit integration for v2, grounded in the published package rather than the docs alone: installed @creit-tech/stellar-wallets-kit v2.5.0 from JSR into a sandbox and worked from its type definitions.

  • Install command switches to npx jsr add @creit-tech/stellar-wallets-kit with a note that v2 is distributed on JSR.
  • The hook uses the v2 static-singleton model: StellarWalletsKit.init({ modules: defaultModules(), network: Networks.TESTNET }) once, then static calls. authModal() replaces the v1 openModal({ onWalletSelected }) callback dance (it opens the picker, sets the module, and returns the address in one call), and the hook now wires the real disconnect().
  • defaultModules() is explained per the issue's ask: it loads every wallet needing no extra setup, and modules with prerequisites (WalletConnect, Ledger, Trezor) must be added explicitly.
  • A dated migration note covers v1 → v2: scope change, static model, allowAllModules()defaultModules(), where the wallet ID constants moved, and the maintainers' note that npm parity will eventually stop.

Verification (the issue asked for a compile test of the embedded snippet): the new hook type-checks verbatim against the real package, and a negative control proves the types are strict — the v1 idioms the old skill taught all fail (allowAllModules and WalletNetwork not exported, new StellarWalletsKit({...}) rejected with expected-0-arguments, openModal does not exist).

The skill taught the legacy npm dotted scope and the v1 API. v2 lives
on JSR as @creit-tech/stellar-wallets-kit and the kit is now a static
singleton: StellarWalletsKit.init once, defaultModules() instead of
allowAllModules(), and authModal() replacing the openModal callback
dance (it picks the wallet, sets it active, and returns the address).
The hook now also wires the real disconnect().

The new snippet type-checks verbatim against the published JSR
package (v2.5.0), and a negative control confirms the old idioms are
really gone: allowAllModules and WalletNetwork are not exported, the
constructor takes no arguments, and openModal does not exist.

A dated migration note covers the v1 -> v2 differences, and the
defaultModules() comment explains which modules need explicit setup.

Closes #56.
Copilot AI review requested due to automatic review settings July 20, 2026 19:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-21 12:47 UTC

@kaankacar
kaankacar merged commit e5c7370 into main Jul 21, 2026
6 checks passed
@kaankacar
kaankacar deleted the fix-dapp-wallets-kit-v2 branch July 21, 2026 12:46
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.

dapp skill uses legacy Stellar Wallets Kit package scope and v1 API

2 participants