Update next+walletconnect#3
Conversation
…nnect-sdk Replace @airgap/beacon-dapp, @airgap/beacon-sdk, and @taquito/beacon-wallet with @tezos-x/octez.connect-sdk@^4.8.3 — the official @tezos-x namespace rename per https://docs.tezos.com/dApps/migrating-from-beacon. ✨ (lib/tezos/OctezConnectWallet.ts): add OctezConnectWallet adapter Taquito WalletProvider implementation wrapping DAppClient from @tezos-x/octez.connect-sdk. Mirrors BeaconWallet's behaviour exactly (same showPrepare/hideUI lifecycle, same param mapping via Taquito's createTransferOperation etc., same signing watermark logic). Also exports: - buildNetwork() helper that uses NetworkType.CUSTOM for non-mainnet, bypassing wallet extension internal network lookups that can fail on older Temple versions - NetworkType, PermissionScope, BeaconEvent re-exports so call sites only need one import ♻️ (lib/tezos/store/walletStore.ts): switch to OctezConnectWallet - Replace all @taquito/beacon-wallet / @airgap/beacon-dapp lazy imports with a single lazy import of OctezConnectWallet and buildNetwork - Wallet is constructed with network: buildNetwork(...) instead of the deprecated preferredNetwork enum — CUSTOM type for every non-mainnet - initializeWallets() no longer logs noise; silently restores session - disconnectWallet() calls wallet.clearActiveAccount() via the public adapter method rather than reaching into wallet.client directly - switchNetwork() passes reset: true to destroy the DAppClient singleton before creating a new one for the target network 🗑️ Remove octez_connect_bug_report.md — bug resolved in 4.8.3 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…478 to keep documentation current and relevant
❌ Deploy Preview for tezos-next-boilerplate failed. Why did it fail? →
|
|
@josim please review the Octez.connect SDK implementation here for update. |
Add .nvmrc and package.json engines field to use Node 20.x, fixing the missing lightningcss.linux-x64-gnu.node binary error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the Tezos wallet integration from the Beacon/Taquito BeaconWallet stack to @tezos-x/octez.connect-sdk by introducing a Taquito WalletProvider adapter and updating the Zustand wallet store accordingly.
Changes:
- Replace Beacon-related dependencies with
@tezos-x/octez.connect-sdk. - Update
walletStoreto initialize/connect/disconnect/switch networks using the newOctezConnectWalletadapter. - Add a new
OctezConnectWalletadapter that implements Taquito’sWalletProviderover octez.connect, and regenerate the Bun lockfile.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Removes Beacon deps and adds @tezos-x/octez.connect-sdk. |
| lib/tezos/store/walletStore.ts | Switches store wallet type + init/connect/disconnect/network switching to octez.connect. |
| lib/tezos/OctezConnectWallet.ts | New Taquito WalletProvider adapter built on octez.connect SDK. |
| bun.lock | New/generated Bun lockfile reflecting dependency changes. |
| README.md | Removes the dedicated “Security” section block. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (watermark !== undefined) { | ||
| bb = mergebuf(watermark, bb); | ||
| } | ||
| const watermarkedBytes = buf2hex(Buffer.from(bb)); |
There was a problem hiding this comment.
sign() uses Buffer.from(...) but Buffer is not imported. In Next.js client bundles (and especially Edge runtimes), Buffer is not guaranteed to be available globally, which can cause a runtime crash when signing. Import Buffer from the buffer package (or avoid Buffer entirely by converting the Uint8Array to hex without it).
| const watermarkedBytes = buf2hex(Buffer.from(bb)); | |
| const watermarkedBytes = buf2hex(bb); |
| async getPK(): Promise<string> { | ||
| const account = await this.client.getActiveAccount(); | ||
| if (!account) throw new OctezConnectNotInitialized(); | ||
| return account.publicKey ?? ""; | ||
| } |
There was a problem hiding this comment.
getPK() returns an empty string when account.publicKey is missing. Returning an invalid public key can cause downstream Taquito operations to fail with confusing errors; it would be safer to throw a specific error (or ensure permissions/request flow guarantees a public key is available) rather than returning "".
| * internal network lookup, which may not recognise newer testnet names and | ||
| * would otherwise throw PARAMETERS_INVALID_ERROR. | ||
| * | ||
| * @see skills/tezos-octez-connect-patterns.md §1 |
There was a problem hiding this comment.
The JSDoc reference @see skills/tezos-octez-connect-patterns.md §1 points to a file/path that doesn't exist in this repository. Consider updating the reference to a real doc link/location (or removing it) so future readers can follow the guidance.
| * @see skills/tezos-octez-connect-patterns.md §1 | |
| * @see https://docs.tezos.com/dApps/wallets/octez-connect#network-configuration |
| // Lazily create the wallet if initializeWallets has not run yet | ||
| if (!wallet) { | ||
| const { BeaconWallet } = await import("@taquito/beacon-wallet"); | ||
| const { NetworkType } = await import("@airgap/beacon-dapp"); | ||
| const { OctezConnectWallet, buildNetwork } = await import("../OctezConnectWallet"); | ||
| const networkConfig = NETWORK_CONFIGS[get().network]; | ||
|
|
There was a problem hiding this comment.
connectWallet() can lazily create a wallet when initializeWallets() hasn't run yet, but it doesn't set isInitialized to true. That allows useTezos's effect to still call initializeWallets() afterward, potentially re-creating/resetting the wallet provider right after a user-initiated connect. Consider marking the store initialized here (or have connectWallet() await initializeWallets() when !isInitialized).
|
well it worked locally lolol |
No description provided.