Skip to content

Commit 2a59ccf

Browse files
committed
chore: merge main
2 parents 3bfb1e6 + 4875a2a commit 2a59ccf

File tree

130 files changed

+2906
-1601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+2906
-1601
lines changed

.changeset/lemon-eels-approve.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"viem": patch
3+
---
4+
5+
Added Vechain chain.

.github/actions/install-dependencies/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
uses: actions/setup-node@v3
1212
with:
1313
cache: pnpm
14-
node-version: 18
14+
node-version: 20
1515

1616
- name: Set up foundry
1717
uses: foundry-rs/foundry-toolchain@v1

.github/workflows/bench.yml

-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ jobs:
1010
bench:
1111
name: Benchmark
1212
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
transport-mode: ['http', 'webSocket']
1613

1714
steps:
1815
- name: Clone repository
@@ -27,7 +24,6 @@ jobs:
2724
VITE_ANVIL_BLOCK_NUMBER: ${{ vars.VITE_ANVIL_BLOCK_NUMBER }}
2825
VITE_ANVIL_BLOCK_TIME: ${{ vars.VITE_ANVIL_BLOCK_TIME }}
2926
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }}
30-
VITE_NETWORK_TRANSPORT_MODE: ${{ matrix.transport-mode }}
3127

3228
- name: Report benchmarks
3329
run: pnpm bun ./.github/scripts/bench.ts

.github/workflows/verify.yml

+5-9
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,11 @@ jobs:
7777
name: Test
7878
runs-on: ubuntu-latest
7979
strategy:
80+
max-parallel: 3
8081
matrix:
81-
shard: [1, 2, 3, 4]
82-
total-shards: [4]
8382
transport-mode: ['http', 'webSocket']
84-
include:
85-
- batch-multicall: 'false'
86-
- batch-multicall: 'true'
87-
transport-mode: 'http'
88-
83+
shard: [1, 2, 3]
84+
total-shards: [3]
8985
steps:
9086
- name: Clone repository
9187
uses: actions/checkout@v3
@@ -100,14 +96,14 @@ jobs:
10096
- name: Run tests
10197
uses: nick-fields/retry@v2
10298
with:
103-
timeout_minutes: 30
99+
timeout_minutes: 10
104100
max_attempts: 3
105101
command: pnpm test:ci --shard=${{ matrix.shard }}/${{ matrix.total-shards }}
106102
env:
107103
VITE_ANVIL_BLOCK_NUMBER: ${{ vars.VITE_ANVIL_BLOCK_NUMBER }}
108104
VITE_ANVIL_BLOCK_TIME: ${{ vars.VITE_ANVIL_BLOCK_TIME }}
109105
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }}
110-
VITE_BATCH_MULTICALL: ${{ matrix.batch-multicall }}
106+
VITE_BATCH_MULTICALL: ${{ matrix.multicall }}
111107
VITE_NETWORK_TRANSPORT_MODE: ${{ matrix.transport-mode }}
112108

113109
- name: Upload coverage reports to Codecov

CHANGELOG.md

+55
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
# viem
22

3+
## 1.10.1
4+
5+
### Patch Changes
6+
7+
- [`bf2f7ee1`](https://github.com/wagmi-dev/viem/commit/bf2f7ee124af5eb43f0541200e88bd4302680912) Thanks [@jxom](https://github.com/jxom)! - Updated dependencies:
8+
9+
- `@adraffy/ens-normalize`
10+
- `@noble/curves`
11+
- `@noble/hashes`
12+
- `@scure/bip32`
13+
- `@scure/bip39`
14+
- `abitype`
15+
- `isomorphic-ws`
16+
- `ws`
17+
18+
## 1.10.0
19+
20+
### Minor Changes
21+
22+
- [#1110](https://github.com/wagmi-dev/viem/pull/1110) [`74c7d276`](https://github.com/wagmi-dev/viem/commit/74c7d276305d4e3db4a4902c247e191ead369abd) Thanks [@jxom](https://github.com/jxom)! - Amended `Chain` type to allow arbitrary `contracts` (as well as contracts that could be dependant on chain).
23+
24+
* [#1136](https://github.com/wagmi-dev/viem/pull/1136) [`16699c8c`](https://github.com/wagmi-dev/viem/commit/16699c8c92faccecc4dbd3353879ce5a512bbb35) Thanks [@jxom](https://github.com/jxom)! - Handle CAIP-25 "User Rejected" errors.
25+
26+
- [#1120](https://github.com/wagmi-dev/viem/pull/1120) [`0e4d9320`](https://github.com/wagmi-dev/viem/commit/0e4d932079a449fb7268c24eb0f6391e7b05076c) Thanks [@polygomic](https://github.com/polygomic)! - Added Plinga chain
27+
28+
* [#1108](https://github.com/wagmi-dev/viem/pull/1108) [`2327aa07`](https://github.com/wagmi-dev/viem/commit/2327aa0741bac51058d7038840bdc2895ead5456) Thanks [@simonzg](https://github.com/simonzg)! - Added Meter chain and Meter Testnet chain
29+
30+
- [#1128](https://github.com/wagmi-dev/viem/pull/1128) [`e1728054`](https://github.com/wagmi-dev/viem/commit/e17280544dc113c855166dae0ee634890c8a4e96) Thanks [@karangoraniya](https://github.com/karangoraniya)! - Added opBNB Mainnet and Testnet chains.
31+
32+
* [#1117](https://github.com/wagmi-dev/viem/pull/1117) [`a637ba2b`](https://github.com/wagmi-dev/viem/commit/a637ba2b5fc1ffacc1f483ea4be0121528faf3f4) Thanks [@rkalis](https://github.com/rkalis)! - Added `domainSeparator` to calculate domain separator from an EIP712 domain.
33+
34+
### Patch Changes
35+
36+
- [#1137](https://github.com/wagmi-dev/viem/pull/1137) [`4159c997`](https://github.com/wagmi-dev/viem/commit/4159c9979788798cca6ebb48f38e2284559850ff) Thanks [@jxom](https://github.com/jxom)! - Fixed an issue where non-standard "user rejected" errors where being coalesced into an `UnknownNodeError`.
37+
38+
* [`8605c1f1`](https://github.com/wagmi-dev/viem/commit/8605c1f1d048a2d924bd8b83a42b8ce5b0e65900) Thanks [@jxom](https://github.com/jxom)! - Handle `-32603` RPC error codes when deriving a `ContractFunctionRevertedError`.
39+
40+
- [#1109](https://github.com/wagmi-dev/viem/pull/1109) [`0a242120`](https://github.com/wagmi-dev/viem/commit/0a2421204f3878e016502f7e2ec98d043ef88cf6) Thanks [@jxom](https://github.com/jxom)! - Removed hardcoded `defaultPriorityFee` on OP Stack chains in favor of fetching it from `eth_maxPriorityFeePerGas`.
41+
42+
* [#1112](https://github.com/wagmi-dev/viem/pull/1112) [`7da52244`](https://github.com/wagmi-dev/viem/commit/7da5224467ca5a6368f27734a01b56f53c2c0106) Thanks [@RexCloud](https://github.com/RexCloud)! - Added multicall3 for Scroll Sepolia
43+
44+
- [#1139](https://github.com/wagmi-dev/viem/pull/1139) [`86230caf`](https://github.com/wagmi-dev/viem/commit/86230caf872f76975f7f6aaff53a9c9e3b8bfdc7) Thanks [@jxom](https://github.com/jxom)! - Fixed `VerifyMessageParameters` to accept a `raw` property.
45+
46+
* [#1138](https://github.com/wagmi-dev/viem/pull/1138) [`101c94f2`](https://github.com/wagmi-dev/viem/commit/101c94f2841056410ed4c32b76672f7fbd1ebabc) Thanks [@jxom](https://github.com/jxom)! - Amended Base chain `nativeCurreny.name` to "Ether".
47+
48+
- [#1048](https://github.com/wagmi-dev/viem/pull/1048) [`f33086ef`](https://github.com/wagmi-dev/viem/commit/f33086ef88a1c9650b2b0efa6a034490519eead8) Thanks [@brianathere](https://github.com/brianathere)! - Converted `isomorphic-ws` to a synchronous import.
49+
50+
## 1.9.5
51+
52+
### Patch Changes
53+
54+
- [#1105](https://github.com/wagmi-dev/viem/pull/1105) [`9661b9d8`](https://github.com/wagmi-dev/viem/commit/9661b9d8f4d747391f9ffb14b789c727a6831488) Thanks [@dschlabach](https://github.com/dschlabach)! - Added ENS Registry and ENS Universal Resolver for Sepolia.
55+
56+
* [#1102](https://github.com/wagmi-dev/viem/pull/1102) [`0edea858`](https://github.com/wagmi-dev/viem/commit/0edea858fe28bd9d7cb7c5b9b8ebde72025cf71d) Thanks [@rkalis](https://github.com/rkalis)! - Fixed bug regarding incorrect bigint->bytes32 conversion in hexToSignature
57+
358
## 1.9.4
459

560
### Patch Changes

examples/_template/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/blocks/fetching-blocks/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/blocks/watching-blocks/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/clients/public-client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/clients/wallet-client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"@types/react-dom": "^18.0.10",
1717
"@vitejs/plugin-react": "^3.1.0",
1818
"typescript": "^5.0.3",
19-
"vite": "^4.1.4"
19+
"vite": "^4.4.2"
2020
}
2121
}

examples/contracts/deploying-contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"@types/react-dom": "^18.0.10",
1717
"@vitejs/plugin-react": "^3.1.0",
1818
"typescript": "^5.0.3",
19-
"vite": "^4.1.4"
19+
"vite": "^4.4.2"
2020
}
2121
}

examples/contracts/multicall/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/contracts/reading-contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/contracts/writing-to-contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"@types/react-dom": "^18.0.10",
1717
"@vitejs/plugin-react": "^3.1.0",
1818
"typescript": "^5.0.3",
19-
"vite": "^4.1.4"
19+
"vite": "^4.4.2"
2020
}
2121
}

examples/ens/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/filters-and-logs/block-event-logs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/filters-and-logs/event-logs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/signing/typed-data/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"@types/react-dom": "^18.0.10",
1717
"@vitejs/plugin-react": "^3.1.0",
1818
"typescript": "^5.0.3",
19-
"vite": "^4.1.4"
19+
"vite": "^4.4.2"
2020
}
2121
}

examples/transactions/fetching-transactions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"devDependencies": {
1313
"typescript": "^5.0.3",
14-
"vite": "^4.1.4"
14+
"vite": "^4.4.2"
1515
}
1616
}

examples/transactions/sending-transactions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"@types/react-dom": "^18.0.10",
1717
"@vitejs/plugin-react": "^3.1.0",
1818
"typescript": "^5.0.3",
19-
"vite": "^4.1.4"
19+
"vite": "^4.4.2"
2020
}
2121
}

examples/walletconnect/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Public Client Example
2+
3+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/walletconnect)

examples/walletconnect/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
</head>
7+
<body>
8+
<h1>Wallet Client Example</h1>
9+
<div id="root"></div>
10+
<script type="module" src="/index.tsx"></script>
11+
</body>
12+
</html>

examples/walletconnect/index.tsx

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import { EthereumProvider } from '@walletconnect/ethereum-provider'
2+
import React, { useEffect, useState } from 'react'
3+
import ReactDOM from 'react-dom/client'
4+
import {
5+
http,
6+
Address,
7+
Hash,
8+
TransactionReceipt,
9+
createPublicClient,
10+
createWalletClient,
11+
custom,
12+
parseEther,
13+
stringify,
14+
} from 'viem'
15+
import { mainnet } from 'viem/chains'
16+
import 'viem/window'
17+
18+
const projectId = 'fdb8164b4aa07b46f14e131f5c7c5903'
19+
20+
const provider = await EthereumProvider.init({
21+
chains: [1],
22+
projectId,
23+
showQrModal: true,
24+
})
25+
26+
const publicClient = createPublicClient({
27+
chain: mainnet,
28+
transport: http(),
29+
})
30+
const walletClient = createWalletClient({
31+
chain: mainnet,
32+
transport: custom(provider),
33+
})
34+
35+
function Example() {
36+
const [account, setAccount] = useState<Address>()
37+
const [hash, setHash] = useState<Hash>()
38+
const [receipt, setReceipt] = useState<TransactionReceipt>()
39+
40+
const addressInput = React.createRef<HTMLInputElement>()
41+
const valueInput = React.createRef<HTMLInputElement>()
42+
43+
const connect = async () => {
44+
await provider.connect()
45+
const [address] = await walletClient.getAddresses()
46+
setAccount(address)
47+
}
48+
49+
const sendTransaction = async () => {
50+
if (!account) return
51+
const hash = await walletClient.sendTransaction({
52+
account,
53+
to: addressInput.current!.value as Address,
54+
value: parseEther(valueInput.current!.value as `${number}`),
55+
})
56+
console.log('test', hash)
57+
setHash(hash)
58+
}
59+
60+
useEffect(() => {
61+
;(async () => {
62+
if (hash) {
63+
const receipt = await publicClient.waitForTransactionReceipt({ hash })
64+
setReceipt(receipt)
65+
}
66+
})()
67+
}, [hash])
68+
69+
if (account)
70+
return (
71+
<>
72+
<div>Connected: {account}</div>
73+
<input ref={addressInput} placeholder="address" />
74+
<input ref={valueInput} placeholder="value (ether)" />
75+
<button onClick={sendTransaction}>Send</button>
76+
{receipt && (
77+
<div>
78+
Receipt:{' '}
79+
<pre>
80+
<code>{stringify(receipt, null, 2)}</code>
81+
</pre>
82+
</div>
83+
)}
84+
</>
85+
)
86+
return <button onClick={connect}>Connect Wallet</button>
87+
}
88+
89+
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
90+
<Example />,
91+
)

examples/walletconnect/package.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "example-walletconnect",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite"
8+
},
9+
"dependencies": {
10+
"@walletconnect/ethereum-provider": "^2.10.0",
11+
"@walletconnect/modal": "^2.6.1",
12+
"react": "^18.2.0",
13+
"react-dom": "^18.2.0",
14+
"viem": "latest"
15+
},
16+
"devDependencies": {
17+
"@types/react": "^18.0.27",
18+
"@types/react-dom": "^18.0.10",
19+
"@vitejs/plugin-react": "^3.1.0",
20+
"typescript": "^5.0.3",
21+
"vite": "^4.4.2"
22+
}
23+
}

0 commit comments

Comments
 (0)