Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
6 Skipped Deployments
|
There was a problem hiding this comment.
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}`) |
There was a problem hiding this comment.
Spelling error: "Unkown" should be "Unknown".
|
|
||
| const addressData = this.getAddressData(account, chainId) | ||
| if (!addressData) { | ||
| throw new Error(`Unkown address: ${account}`) |
There was a problem hiding this comment.
Spelling error: "Unkown" should be "Unknown".
| import { TezosToolkit } from '@taquito/taquito' | ||
| import { InMemorySigner } from '@taquito/signer' | ||
| import { localForger } from '@taquito/local-forging' | ||
| import { Wallet } from 'ethers/' |
There was a problem hiding this comment.
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.
| @@ -1,4 +1,4 @@ | |||
| import { EIP155Chain } from '@/data/EIP155Data' | |||
| import { EIP155Chain } from '@web-examples/shared' | |||
There was a problem hiding this comment.
Unused import EIP155Chain.
| 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' |
There was a problem hiding this comment.
Unused imports STACKS_MAINNET, STACKS_TESTNET.
|
|
||
| static async init(networkId: string, seedPhrase: string) { | ||
| // Derive keypair from seed phrase | ||
| const { secretKey, publicKey } = parseSeedPhrase(seedPhrase); |
There was a problem hiding this comment.
Unused variable publicKey.
| chainId, | ||
| messageParams, | ||
| }: SignMessageParams): Promise<SignedMessage> { | ||
| const { message, nonce, recipient, callbackUrl, state, accountId } = |
There was a problem hiding this comment.
Unused variable state.
| publicKeyFromSignatureRsv, | ||
| publicKeyToHex, | ||
| } from '@stacks/transactions' | ||
| import { networkFromName, StacksNetworks } from '@stacks/network' |
There was a problem hiding this comment.
Unused import StacksNetworks.
| publicKeyToHex, | ||
| } from '@stacks/transactions' | ||
| import { networkFromName, StacksNetworks } from '@stacks/network' | ||
| import { STACKS_MAINNET, STACKS_TESTNET, STACKS_TESTNET_CAIP2 } from '../chains' |
There was a problem hiding this comment.
Unused imports STACKS_MAINNET, STACKS_TESTNET.
| import { | ||
| WalletContractV4, | ||
| TonClient, | ||
| internal, | ||
| Address, | ||
| Transaction, | ||
| Cell, | ||
| Message, | ||
| address, | ||
| beginCell, | ||
| storeMessage | ||
| } from '@ton/ton' |
There was a problem hiding this comment.
Unused imports Cell, Transaction, address.
| "postinstall": "cd ../../../shared && pnpm install && pnpm build || echo 'Warning: Shared package postinstall failed'" | ||
| }, | ||
| "dependencies": { | ||
| "@web-examples/shared": "file:../../../shared", |
There was a problem hiding this comment.
Why not use the monorepo instead of this?
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: