Skip to content

Commit

Permalink
Added code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mariopil committed Dec 14, 2023
1 parent 3cd913c commit 0b722d7
Show file tree
Hide file tree
Showing 22 changed files with 3,126 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:5137",
"webRoot": "${workspaceFolder}",
}
]
}
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ This repository contains an example that uses Viem with EIP712 changes and Wagmi

1. Ensure you have `bun` and `pnpm` installed.

1. Download `eip712_signer` branch from https://github.com/eigerco/viem.
2. Download `eip712_signer` branch from https://github.com/eigerco/viem.

1. Modify `package.json` files:
3. Modify `package.json` files:

* in the main viem directory add following beneath `"type": "module"`:

Expand Down Expand Up @@ -38,28 +38,29 @@ This repository contains an example that uses Viem with EIP712 changes and Wagmi
}
```

1. Run `bun install`
4. Run `bun install`

1. Run `bun link` in the main directory. Then run the same command in `src/actions` and `src/chains`
5. Run `bun link` in the main directory. Then run the same command in `src/actions` and `src/chains`

1. Download `beta` branch from https://github.com/wevm/wagmi
6. Download `beta` branch from https://github.com/wevm/wagmi

1. Run `pnpm install` and then `pnpm build`
7. Run `pnpm install` and then `pnpm build`

1. Run `bun link` in the following directories inside `wagmi`:
8. Run `bun link` in the following directories inside `wagmi`:

* `packages/react`

* `packages/core`

* `packages/connectors`

1. Go to this projects directory and run
9. Go to this projects directory and run

* `bun install`

* `./bunlink.sh`

1. Finally run `bun dev` - this will start the app, and open `http://localhost:5173/` in the browser
10. Finally run `bun dev` - this will start the app, and open `http://localhost:5173/` in the browser

### Project uses testnet ZkSync chain. You will need to have a ZkSync testnet account and MetaMask installed to perform tests.

Project uses testnet ZkSync chain. You will need to have a ZkSync testnet account and MetaMask installed to perform tests.
Binary file added bun.lockb
Binary file not shown.
5 changes: 5 additions & 0 deletions bunlink.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bun link viem_zksync
bun link viem_zksync_chains
bun link wagmi
bun link @wagmi/core
bun link @wagmi/connectors
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "viem-wagmi-test",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "link:viem_zksync",
"wagmi_fork_zksync": "link:wagmi",
"wagmi_fork_zksync_core": "link:@wagmi/core",
"@tanstack/react-query": "^5.13.4"
},
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"zksync-web3": "^0.14.3"
}
}
Loading

0 comments on commit 0b722d7

Please sign in to comment.