Skip to content

Conversation

@ganchoradkov
Copy link
Member

@ganchoradkov ganchoradkov commented Nov 14, 2025

This PR introduces a shared package (@web-examples/shared) to centralize common utilities, chain data, wallet libraries, and types across WalletConnect web examples. This refactoring promotes code reuse and maintainability by consolidating previously duplicated code into a single package.

Key Changes:

  • Created a new TypeScript package with wallet libraries for 13+ blockchain networks (EIP155, Solana, Cosmos, Polkadot, - Near, Kadena, MultiversX, Stacks, Sui, Tezos, Ton, Tron, Bitcoin)
  • Added shared type definitions and helper functions
  • Configured package exports and TypeScript build setup
  • Included chain logos and metadata assets

Copilot AI review requested due to automatic review settings November 14, 2025 12:30
@vercel
Copy link

vercel bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
decentralized-relay-app Error Error Nov 14, 2025 0:34am
decentralized-relay-wallet Error Error Nov 14, 2025 0:34am
malicious-dapp-verify-simulation Ready Ready Preview Comment Nov 14, 2025 0:34am
pos-dapp Ready Ready Preview Comment Nov 14, 2025 0:34am
react-dapp-v2 Ready Ready Preview Comment Nov 14, 2025 0:34am
react-wallet-v2 Error Error Comment Nov 14, 2025 0:34am
wallet-pay-dapp Error Error Nov 14, 2025 0:34am
6 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-react-wagmi-example Ignored Ignored Nov 14, 2025 0:34am
appkit-solana Ignored Ignored Nov 14, 2025 0:34am
chain-abstraction-demo Ignored Ignored Preview Nov 14, 2025 0:34am
react-dapp-v2-cosmos-provider Ignored Ignored Preview Nov 14, 2025 0:34am
react-dapp-v2-with-ethers Ignored Ignored Nov 14, 2025 0:34am
smart-sessions-demo Ignored Ignored Nov 14, 2025 0:34am

@cloudflare-workers-and-pages
Copy link

Deploying demo-ai-agents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 22e56af
Status:🚫  Build failed.

View logs

Copy link
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

This PR introduces a shared package (@web-examples/shared) to centralize common utilities, chain data, wallet libraries, and types across WalletConnect web examples. This refactoring promotes code reuse and maintainability by consolidating previously duplicated code into a single package.

Key Changes:

  • Created a new TypeScript package with wallet libraries for 13+ blockchain networks (EIP155, Solana, Cosmos, Polkadot, Near, Kadena, MultiversX, Stacks, Sui, Tezos, Ton, Tron, Bitcoin)
  • Added shared type definitions and helper functions
  • Configured package exports and TypeScript build setup
  • Included chain logos and metadata assets

Reviewed Changes

Copilot reviewed 117 out of 157 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
shared/package.json Package configuration with dependencies for all supported blockchain SDKs
shared/tsconfig.json TypeScript compiler configuration for the shared package
shared/index.ts Main barrel export file exposing chains, helpers, wallets, constants, and types
shared/wallets/*.ts Wallet library implementations for 13 blockchains with signing and transaction capabilities
shared/types/*.ts Shared TypeScript type definitions
shared/helpers/*.ts Helper utilities including EIP-712 and Tron-specific functions
shared/public/chain-logos/* Chain logo assets (SVG/PNG) for UI display
Files not reviewed (2)
  • advanced/dapps/react-dapp-v2/pnpm-lock.yaml: Language not supported
  • advanced/wallets/react-wallet-v2/pnpm-lock.yaml: Language not supported

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

}
const addressData = this.getAddressData(address, chainId)
if (!addressData) {
throw new Error(`Unkown address: ${address}`)
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Spelling error: "Unkown" should be "Unknown".

Copilot uses AI. Check for mistakes.

const addressData = this.getAddressData(account, chainId)
if (!addressData) {
throw new Error(`Unkown address: ${account}`)
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Spelling error: "Unkown" should be "Unknown".

Copilot uses AI. Check for mistakes.
import { TezosToolkit } from '@taquito/taquito'
import { InMemorySigner } from '@taquito/signer'
import { localForger } from '@taquito/local-forging'
import { Wallet } from 'ethers/'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Importing Wallet from ethers/ for Tezos wallet implementation is inconsistent with the library's purpose. This appears to be using an Ethereum wallet utility to generate mnemonics for Tezos. While functional, it creates an unnecessary dependency on ethers for a Tezos-specific library. Consider using a Tezos-native or chain-agnostic mnemonic generation library instead.

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
import { EIP155Chain } from '@/data/EIP155Data'
import { EIP155Chain } from '@web-examples/shared'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused import EIP155Chain.

Copilot uses AI. Check for mistakes.
import { networkFromName, StacksNetworks } from '@stacks/network'
import { STACKS_MAINNET, STACKS_TESTNET, STACKS_TESTNET_CAIP2 } from '@/data/StacksData'
import { STACKS_MAINNET_CAIP2 } from '@/data/StacksData'
import { STACKS_MAINNET, STACKS_TESTNET, STACKS_TESTNET_CAIP2 } from '@web-examples/shared'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused imports STACKS_MAINNET, STACKS_TESTNET.

Copilot uses AI. Check for mistakes.

static async init(networkId: string, seedPhrase: string) {
// Derive keypair from seed phrase
const { secretKey, publicKey } = parseSeedPhrase(seedPhrase);
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused variable publicKey.

Copilot uses AI. Check for mistakes.
chainId,
messageParams,
}: SignMessageParams): Promise<SignedMessage> {
const { message, nonce, recipient, callbackUrl, state, accountId } =
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused variable state.

Copilot uses AI. Check for mistakes.
publicKeyFromSignatureRsv,
publicKeyToHex,
} from '@stacks/transactions'
import { networkFromName, StacksNetworks } from '@stacks/network'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused import StacksNetworks.

Copilot uses AI. Check for mistakes.
publicKeyToHex,
} from '@stacks/transactions'
import { networkFromName, StacksNetworks } from '@stacks/network'
import { STACKS_MAINNET, STACKS_TESTNET, STACKS_TESTNET_CAIP2 } from '../chains'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused imports STACKS_MAINNET, STACKS_TESTNET.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +13
import {
WalletContractV4,
TonClient,
internal,
Address,
Transaction,
Cell,
Message,
address,
beginCell,
storeMessage
} from '@ton/ton'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused imports Cell, Transaction, address.

Copilot uses AI. Check for mistakes.
"postinstall": "cd ../../../shared && pnpm install && pnpm build || echo 'Warning: Shared package postinstall failed'"
},
"dependencies": {
"@web-examples/shared": "file:../../../shared",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not use the monorepo instead of this?

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.

3 participants