Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Walletconnect v2 #340

Merged
merged 18 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
if: matrix.node == 'lts/*'
uses: codecov/codecov-action@v2
with:
files: ./packages/react-celo/coverage/clover.xml,./packages/walletconnect-v1/coverage/clover.xml
files: ./packages/react-celo/coverage/clover.xml,./packages/walletconnect/coverage/clover.xml
fail_ci_if_error: true
verbose: true

Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"request": "launch",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/packages/walletconnect-v1/src/wc-wallet.ts",
"program": "${workspaceFolder}/packages/walletconnect/src/wc-wallet.ts",
"outFiles": ["${workspaceFolder}/**/*.js"]
},
{
Expand Down
8 changes: 2 additions & 6 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ flags:
react-celo:
paths:
- packages/react-celo/
walletconnect-v1:
walletconnect:
paths:
- packages/walletconnect-v1/
# When WC-v2 is merged
# walletconnect:
# paths:
# - packages/walletconnect/
- packages/walletconnect/
ignore:
- 'packages/*/node_modules'
- 'node_modules'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"workspaces": [
"packages/example",
"packages/react-celo",
"packages/walletconnect-v1"
"packages/walletconnect"
],
"pkgs": {
"path": "./packages"
Expand Down Expand Up @@ -48,7 +48,7 @@
"eth-testing": "^1.0.0",
"husky": "^7.0.4",
"jest": "^28.1.0",
"lerna": "^5.4.3",
"lerna": "^5.6.2",
"lint-staged": "^12.2.2",
"prettier": "^2.5.1",
"prompt": "^1.2.1",
Expand Down
1 change: 1 addition & 0 deletions packages/example/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
config.plugins.push(
new webpack.IgnorePlugin({ resourceRegExp: /^electron$/ })
);
config.resolve.fallback = { net: false };
return config;
},

Expand Down
8 changes: 5 additions & 3 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example",
"version": "4.2.1",
"version": "5.0.0-alpha.1",
"private": true,
"scripts": {
"build": "next build",
Expand All @@ -15,9 +15,11 @@
"license": "MIT",
"dependencies": {
"@celo/contractkit": "^3.1.0",
"@celo/react-celo": "^4.3.0",
"@celo/react-celo": "5.0.0-alpha.1-dev",
"@celo/utils": "^3.1.0",
"@walletconnect/client": "1.8.0",
"@walletconnect/sign-client": "^2.1.4",
"@walletconnect/types": "^2.1.4",
"@walletconnect/utils": "^2.1.4",
"next": "^12.1.6",
"postcss": "^8.4.5",
"react": "^18.1.0",
Expand Down
11 changes: 3 additions & 8 deletions packages/example/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ import { signTestTypedData } from '../utils/sign-test-typed-data';
interface Summary {
name: string;
address: string;
wallet: string;
celo: BigNumber;
balances: { symbol: StableToken; value?: BigNumber; error?: string }[];
}

const defaultSummary: Summary = {
name: '',
address: '',
wallet: '',
celo: new BigNumber(0),
balances: [],
};
Expand Down Expand Up @@ -273,12 +271,6 @@ function HomePage(): React.ReactElement {
<div>Wallet type: {walletType}</div>
<div>Name: {summary.name || 'Not set'}</div>
<div className="">Address: {truncateAddress(address)}</div>
<div className="">
Wallet address:{' '}
{summary.wallet
? truncateAddress(summary.wallet)
: 'Not set'}
</div>
</div>
</div>
<div>
Expand Down Expand Up @@ -348,6 +340,8 @@ async function getBalances(
);
}

export const WC_PROJECT_ID = '3ee9bf02f3a89a03837044fc7cdeb232';

export default function Home(): React.ReactElement {
return (
<CeloProvider
Expand All @@ -356,6 +350,7 @@ export default function Home(): React.ReactElement {
description: 'A demo DApp to showcase functionality',
url: 'https://react-celo.vercel.app',
icon: 'https://react-celo.vercel.app/favicon.ico',
walletConnectProjectId: WC_PROJECT_ID,
}}
defaultNetwork={Alfajores.name}
connectModal={{
Expand Down
7 changes: 5 additions & 2 deletions packages/example/pages/wallet-test-plan.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CeloProvider, Mainnet } from '@celo/react-celo';
import { Alfajores, CeloProvider, Mainnet } from '@celo/react-celo';
import React from 'react';

import { ConnectWalletCheck } from '../components/test-plan/connect-wallet';
Expand All @@ -11,6 +11,7 @@ import {
import { SwitchNetwork } from '../components/test-plan/switch-networks';
import { UpdateFeeCurrency } from '../components/test-plan/update-fee-currency';

export const WC_PROJECT_ID = '3ee9bf02f3a89a03837044fc7cdeb232';
export default function WalletTestPlan(): React.ReactElement {
return (
<CeloProvider
Expand All @@ -19,8 +20,10 @@ export default function WalletTestPlan(): React.ReactElement {
description: 'Wallet test plan',
url: 'https://react-celo.vercel.app/wallet-test-plan',
icon: 'https://react-celo.vercel.app/favicon.ico?v=2',
walletConnectProjectId: WC_PROJECT_ID,
}}
network={Mainnet}
defaultNetwork={Mainnet.name}
networks={[Mainnet, Alfajores]}
connectModal={{
providersOptions: { searchable: true },
}}
Expand Down
Loading