Skip to content

Upgrade @creit.tech/stellar-wallets-kit to v2.0.1#1958

Open
Copilot wants to merge 15 commits intomainfrom
copilot/upgrade-stellar-wallet-kits
Open

Upgrade @creit.tech/stellar-wallets-kit to v2.0.1#1958
Copilot wants to merge 15 commits intomainfrom
copilot/upgrade-stellar-wallet-kits

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

Upgrades Stellar Wallets Kit from v1.9.3 to v2.0.1. This release resolves the React hydration error caused by the library injecting inline styles that conflicted with Next.js SSR.

Breaking API Changes Addressed

Static class modelStellarWalletsKit is no longer instantiated; all methods are now static:

// Before
const kit = new StellarWalletsKit({ network, modules, ... });
kit.openModal({ onWalletSelected: async (option) => { ... } });

// After
StellarWalletsKit.init({ network, modules, ... });
const { address } = await StellarWalletsKit.authModal();

Module imports — wallet modules moved from the main package to individual sub-paths:

// Before
import { AlbedoModule, FreighterModule } from "@creit.tech/stellar-wallets-kit";

// After
import { AlbedoModule } from "@creit.tech/stellar-wallets-kit/modules/albedo";
import { FreighterModule } from "@creit.tech/stellar-wallets-kit/modules/freighter";

Other changes:

  • WalletNetwork enum renamed to Networks
  • openModal({ onWalletSelected }) callback pattern replaced by authModal() returning Promise<{ address }>
  • buttonTheme/modalTheme replaced by a single theme property using SwkAppDarkTheme/SwkAppLightTheme
  • LedgerModule import path: .../modules/ledger.module.../modules/ledger

Files Updated

  • WalletKitContextProvider — calls StellarWalletsKit.init() in useEffect; context now provides isInitialized: boolean instead of a class instance
  • ConnectWallet — static method calls; wallet ID sourced from StellarWalletsKit.selectedModule.productId post-auth
  • useSignWithExtensionWalletopenModal callback replaced with authModal() promise chain
  • InvokeContractFormsignTransaction via static call
  • getWalletKitNetworkWalletNetworkNetworks

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • stellarwalletskit.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Upgrade Stellar Wallet Kits to the latest version</issue_title>
<issue_description>https://stellarwalletskit.dev/</issue_description>

<agent_instructions>https://github.com/Creit-Tech/Stellar-Wallets-Kit/releases/tag/v2.0.1 was released. Please update to this release</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@jeesunikim this is still in beta version, but enrique confirmed that it's stable @jeesunikim I created an issue on their library end https://github.com/Creit-Tech/Stellar-Wallets-Kit/issues/79. React hydration error occurs because the library is adding an inline style which causes an error with nextjs' SSR.

I think we should update this when they release a stable version v2.</comment_new>


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

@stellar-jenkins
Copy link
Copy Markdown

Co-authored-by: sagpatil <1414227+sagpatil@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade Stellar Wallet Kits to the latest version Upgrade @creit.tech/stellar-wallets-kit to v2.0.1 Mar 18, 2026
Copilot AI requested a review from sagpatil March 18, 2026 19:58
@stellar-jenkins
Copy link
Copy Markdown

@sagpatil sagpatil requested a review from jeesunikim March 18, 2026 21:26
@sagpatil
Copy link
Copy Markdown

@copilot fix the issue with frozen lock file in the test https://github.com/stellar/laboratory/actions/runs/23264179398/job/67653173536?pr=1958

corepack enable
pnpm install
(This will rewrite pnpm-lock.yaml so the specifier matches ^2.0.1.)

Commit the updated lockfile:

bash
git add pnpm-lock.yaml
git commit -m "chore: sync pnpm-lock.yaml"
git push

Copilot AI and others added 3 commits March 18, 2026 21:31
Co-authored-by: sagpatil <1414227+sagpatil@users.noreply.github.com>
Co-authored-by: sagpatil <1414227+sagpatil@users.noreply.github.com>
Co-authored-by: sagpatil <1414227+sagpatil@users.noreply.github.com>
@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 18, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednext@​15.5.14 ⏵ 15.5.1562100 +16919770
Updated@​creit.tech/​stellar-wallets-kit@​1.9.5 ⏵ 2.1.083 +210098 -193 +7100

View full report

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 18, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
License policy violation: npm @lobstrco/signer-extension-api under GPL-3.0

License: GPL-3.0 - The applicable license policy does not permit this license (5) (npm metadata)

License: GPL-3.0 - The applicable license policy does not permit this license (5) (package/package.json)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@lobstrco/signer-extension-api@2.0.0

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@lobstrco/signer-extension-api@2.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/blockchain-link under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-plugin-stellar@9.2.3npm/@trezor/blockchain-link@2.6.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/blockchain-link@2.6.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/connect-common under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-plugin-stellar@9.2.3npm/@trezor/connect-common@0.5.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/connect-common@0.5.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/connect-plugin-stellar under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-plugin-stellar@9.2.6

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/connect-plugin-stellar@9.2.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/connect-web under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-web@9.7.2

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/connect-web@9.7.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/connect under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-plugin-stellar@9.2.3npm/@trezor/connect@9.7.2

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/connect@9.7.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/transport under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-plugin-stellar@9.2.3npm/@trezor/transport@1.6.2

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/transport@1.6.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/utils under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-plugin-stellar@9.2.3npm/@trezor/utils@9.5.0

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/utils@9.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm @trezor/utxo-lib under LicenseRef-T-RSL

License: LicenseRef-T-RSL - The applicable license policy does not permit this license (5) (package/LICENSE.md)

From: pnpm-lock.yamlnpm/@creit.tech/stellar-wallets-kit@2.1.0npm/@trezor/connect-plugin-stellar@9.2.3npm/@trezor/utxo-lib@2.5.0

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@trezor/utxo-lib@2.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: npm next

Location: Package overview

From: package.jsonnpm/next@15.5.15

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/next@15.5.15. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 18, 2026

@copilot fix the issue with frozen lock file in the test https://github.com/stellar/laboratory/actions/runs/23264179398/job/67653173536?pr=1958

...

Fixed in commit 911e80f. The pnpm-lock.yaml has been updated — the specifier now matches ^2.0.1 in package.json, so pnpm install --frozen-lockfile will pass in CI.

@stellar-jenkins
Copy link
Copy Markdown

1 similar comment
@stellar-jenkins
Copy link
Copy Markdown

@sagpatil
Copy link
Copy Markdown

@copilot previous session had an error , please retry

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 18, 2026

@copilot previous session had an error , please retry

The previous session successfully fixed the lockfile — pnpm-lock.yaml specifier is now ^2.0.1 (commit 911e80f). The current CI run 23268211655 has passed the "Install dependencies" step and is progressing through the build.

@sagpatil sagpatil marked this pull request as ready for review April 14, 2026 18:36
Copilot AI review requested due to automatic review settings April 14, 2026 18:36
@stellar-jenkins-ci
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Upgrades @creit.tech/stellar-wallets-kit to v2.0.1 and refactors wallet-connection/signing flows to match the library’s new static API, aiming to resolve a Next.js SSR hydration issue.

Changes:

  • Upgrade @creit.tech/stellar-wallets-kit to ^2.0.1 and bump next to 15.5.15.
  • Refactor wallet initialization/auth/signing to use StellarWalletsKit.init(), authModal(), and static signTransaction().
  • Make the network limits fetch script resilient to network failures by allowing a cached output file fallback.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/hooks/useSignWithExtensionWallet.ts Migrates signing flow from instance-based API to static authModal() + signTransaction()
src/helpers/getWalletKitNetwork.ts Updates network enum mapping from WalletNetwork to Networks
src/components/WalletKit/WalletKitContextProvider.tsx Reworks context to track kit initialization state and calls StellarWalletsKit.init()
src/components/WalletKit/ConnectWallet.tsx Refactors connect/autoconnect flow to use authModal() and static kit methods
src/app/(sidebar)/smart-contracts/contract-explorer/components/InvokeContractForm.tsx Updates signing to use static StellarWalletsKit.signTransaction()
scripts/fetch-network-limits.mjs Adds cached output fallback when network fetch fails
package.json Dependency upgrades for wallet kit + Next.js patch

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/fetch-network-limits.mjs Outdated
Comment thread src/hooks/useSignWithExtensionWallet.ts Outdated
Comment thread src/components/WalletKit/WalletKitContextProvider.tsx
@sagpatil
Copy link
Copy Markdown

@copilot can you fix the failing tests

@sagpatil
Copy link
Copy Markdown

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 15, 2026

@copilot can you fix the failing tests

Fixed in commit c4cb1f6. The two failing tests were caused by v2 API changes:

  1. signTransactionPage.test.ts — The wallet selection modal heading changed from "Connect a Wallet" to "Connect Wallet" in v2. Updated the assertion to match.

  2. networkLimitsPage.test.ts — The dismissNetworkSettingsModal helper had a 1000ms timeout that was too short on slow CI runners. Increased it to 5000ms.

Also fixed a code review issue in useSignWithExtensionWallet.ts: replaced the useEffect-based isInProgress reset with a finally block so it always resets, including when authModal() resolves without an address.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • mainnet.sorobanrpc.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node scripts/fetch-network-limits.mjs (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node scripts/fetch-network-limits.mjs ash ache/node/24.14.1/x64/bin/node i.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@stellar-jenkins-ci
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 15, 2026

@copilot apply changes based on the comments in this thread

Applied in commit b7dfff2:

  1. scripts/fetch-network-limits.mjs — The cache fallback now only triggers when all network fetches fail (tracked via successCount). If some networks succeed, the script continues to regenerate the file with partial data. The "unavailable for all networks" warning is now accurate.

  2. src/components/WalletKit/WalletKitContextProvider.tsx — Removed the mount-only savedWallet state. The init effect now reads localStorageSavedWallet directly on each run, so when network.id changes it always picks up the wallet persisted for the active network (or falls back to an empty string). Removed unused savedWallet state, walletId context field, and SavedWallet import.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • mainnet.sorobanrpc.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node scripts/fetch-network-limits.mjs (dns block)
  • rpc-futurenet.stellar.org
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node scripts/fetch-network-limits.mjs (dns block)
  • soroban-testnet.stellar.org
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node scripts/fetch-network-limits.mjs (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@stellar-jenkins-ci
Copy link
Copy Markdown

- WalletKitContextProvider: add explicit null guard on savedWallet before
  checking savedWallet.network.id to prevent TypeError crash during hydration
  when both savedWallet and network.id are undefined
- useSignWithExtensionWallet: change isInProgress from useState to useRef so
  setting it does not trigger re-renders, preventing the useCallback reference
  from changing and breaking the infinite authModal() loop in signTx useEffect
@stellar-jenkins-ci
Copy link
Copy Markdown

@sagpatil
Copy link
Copy Markdown

@jeesunikim tests are passing now . can you please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

Upgrade Stellar Wallet Kits to the latest version

4 participants