viem 0.0.0-main.20230924T220038 → 0.0.0-main.20230924T221257
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +215 -0
- package/_cjs/errors/version.js +1 -1
- package/_esm/errors/version.js +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/errors/version.ts +1 -1
- package/package.json +1 -1
package/README.md
ADDED
@@ -0,0 +1,215 @@
|
|
1
|
+
<br/>
|
2
|
+
|
3
|
+
<p align="center">
|
4
|
+
<a href="https://viem.sh">
|
5
|
+
<picture>
|
6
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/wagmi-dev/viem/blob/main/.github/gh-logo-dark.svg">
|
7
|
+
<img alt="viem logo" src="https://github.com/wagmi-dev/viem/blob/main/.github/gh-logo-light.svg" width="auto" height="60">
|
8
|
+
</picture>
|
9
|
+
</a>
|
10
|
+
</p>
|
11
|
+
|
12
|
+
<p align="center">
|
13
|
+
TypeScript Interface for Ethereum
|
14
|
+
<p>
|
15
|
+
|
16
|
+
<p align="center">
|
17
|
+
<a href="https://www.npmjs.com/package/viem">
|
18
|
+
<picture>
|
19
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/viem?colorA=21262d&colorB=21262d&style=flat">
|
20
|
+
<img src="https://img.shields.io/npm/v/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Version">
|
21
|
+
</picture>
|
22
|
+
</a>
|
23
|
+
<a href="https://app.codecov.io/gh/wagmi-dev/viem">
|
24
|
+
<picture>
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/codecov/c/github/wagmi-dev/viem?colorA=21262d&colorB=21262d&style=flat">
|
26
|
+
<img src="https://img.shields.io/codecov/c/github/wagmi-dev/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Code coverage">
|
27
|
+
</picture>
|
28
|
+
</a>
|
29
|
+
<a href="https://github.com/wagmi-dev/viem/blob/main/LICENSE">
|
30
|
+
<picture>
|
31
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/l/viem?colorA=21262d&colorB=21262d&style=flat">
|
32
|
+
<img src="https://img.shields.io/npm/l/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="MIT License">
|
33
|
+
</picture>
|
34
|
+
</a>
|
35
|
+
<a href="https://www.npmjs.com/package/viem">
|
36
|
+
<picture>
|
37
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/viem?colorA=21262d&colorB=21262d&style=flat">
|
38
|
+
<img src="https://img.shields.io/npm/dm/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Downloads per month">
|
39
|
+
</picture>
|
40
|
+
</a>
|
41
|
+
<a href="https://bestofjs.org/projects/viem">
|
42
|
+
<picture>
|
43
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/endpoint?colorA=21262d&colorB=21262d&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wagmi-dev%2Fviem%26since=daily">
|
44
|
+
<img src="https://img.shields.io/endpoint?colorA=f6f8fa&colorB=f6f8fa&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wagmi-dev%2Fviem%26since=daily" alt="Best of JS">
|
45
|
+
</picture>
|
46
|
+
</a>
|
47
|
+
</p>
|
48
|
+
|
49
|
+
<br>
|
50
|
+
|
51
|
+
## Features
|
52
|
+
|
53
|
+
- Abstractions over the [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) to make your life easier
|
54
|
+
- First-class APIs for interacting with [Smart Contracts](https://ethereum.org/en/glossary/#smart-contract)
|
55
|
+
- Language closely aligned to official [Ethereum terminology](https://ethereum.org/en/glossary/)
|
56
|
+
- Import your Browser Extension, WalletConnect or Private Key Wallet
|
57
|
+
- Browser native [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt), instead of large BigNumber libraries
|
58
|
+
- Utilities for working with [ABIs](https://ethereum.org/en/glossary/#abi) (encoding/decoding/inspection)
|
59
|
+
- TypeScript ready ([infer types](https://viem.sh/docs/typescript) from ABIs and EIP-712 Typed Data)
|
60
|
+
- First-class support for [Anvil](https://book.getfoundry.sh/), [Hardhat](https://hardhat.org/) & [Ganache](https://trufflesuite.com/ganache/)
|
61
|
+
- Test suite running against [forked](https://ethereum.org/en/glossary/#fork) Ethereum network
|
62
|
+
|
63
|
+
... and a lot lot more.
|
64
|
+
|
65
|
+
## Overview
|
66
|
+
|
67
|
+
```ts
|
68
|
+
// 1. Import modules.
|
69
|
+
import { createPublicClient, http } from 'viem';
|
70
|
+
import { mainnet } from 'viem/chains';
|
71
|
+
|
72
|
+
// 2. Set up your client with desired chain & transport.
|
73
|
+
const client = createPublicClient({
|
74
|
+
chain: mainnet,
|
75
|
+
transport: http(),
|
76
|
+
});
|
77
|
+
|
78
|
+
// 3. Consume an action!
|
79
|
+
const blockNumber = await client.getBlockNumber();
|
80
|
+
```
|
81
|
+
|
82
|
+
## Community
|
83
|
+
|
84
|
+
Check out the following places for more viem-related content:
|
85
|
+
|
86
|
+
- Follow [@wagmi_sh](https://twitter.com/wagmi_sh), [@jakemoxey](https://twitter.com/jakemoxey), and [@awkweb](https://twitter.com/awkweb) on Twitter for project updates
|
87
|
+
- Join the [discussions on GitHub](https://github.com/wagmi-dev/viem/discussions)
|
88
|
+
- [Share your project/organization](https://github.com/wagmi-dev/viem/discussions/104) that uses viem
|
89
|
+
|
90
|
+
## Support
|
91
|
+
|
92
|
+
- [GitHub Sponsors](https://github.com/sponsors/wagmi-dev?metadata_campaign=docs_support)
|
93
|
+
- [Gitcoin Grant](https://wagmi.sh/gitcoin)
|
94
|
+
- [wagmi-dev.eth](https://etherscan.io/enslookup-search?search=wagmi-dev.eth)
|
95
|
+
|
96
|
+
## Sponsors
|
97
|
+
|
98
|
+
<a href="https://paradigm.xyz">
|
99
|
+
<picture>
|
100
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/paradigm-dark.svg">
|
101
|
+
<img alt="paradigm logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/paradigm-light.svg" width="auto" height="70">
|
102
|
+
</picture>
|
103
|
+
</a>
|
104
|
+
|
105
|
+
<br>
|
106
|
+
|
107
|
+
<a href="https://twitter.com/family">
|
108
|
+
<picture>
|
109
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-dark.svg">
|
110
|
+
<img alt="family logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-light.svg" width="auto" height="50">
|
111
|
+
</picture>
|
112
|
+
</a>
|
113
|
+
<a href="https://twitter.com/context">
|
114
|
+
<picture>
|
115
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-dark.svg">
|
116
|
+
<img alt="context logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-light.svg" width="auto" height="50">
|
117
|
+
</picture>
|
118
|
+
</a>
|
119
|
+
<a href="https://walletconnect.com">
|
120
|
+
<picture>
|
121
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/walletconnect-dark.svg">
|
122
|
+
<img alt="WalletConnect logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/walletconnect-light.svg" width="auto" height="50">
|
123
|
+
</picture>
|
124
|
+
</a>
|
125
|
+
<a href="https://looksrare.org">
|
126
|
+
<picture>
|
127
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/looksrare-dark.svg">
|
128
|
+
<img alt="LooksRare logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/8923685e23fe9708b74d456c3f9e7a2b90f6abd9/content/sponsors/looksrare-light.svg" width="auto" height="50">
|
129
|
+
</picture>
|
130
|
+
</a>
|
131
|
+
<a href="https://twitter.com/prtyDAO">
|
132
|
+
<picture>
|
133
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/partydao-dark.svg">
|
134
|
+
<img alt="PartyDAO logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/partydao-light.svg" width="auto" height="50">
|
135
|
+
</picture>
|
136
|
+
</a>
|
137
|
+
<a href="https://dynamic.xyz">
|
138
|
+
<picture>
|
139
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/dynamic-dark.svg">
|
140
|
+
<img alt="Dynamic logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/dynamic-light.svg" width="auto" height="50">
|
141
|
+
</picture>
|
142
|
+
</a>
|
143
|
+
<a href="https://sushi.com">
|
144
|
+
<picture>
|
145
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/sushi-dark.svg">
|
146
|
+
<img alt="Sushi logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/sushi-light.svg" width="auto" height="50">
|
147
|
+
</picture>
|
148
|
+
</a>
|
149
|
+
<a href="https://stripe.com">
|
150
|
+
<picture>
|
151
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/stripe-dark.svg">
|
152
|
+
<img alt="Stripe logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/stripe-light.svg" width="auto" height="50">
|
153
|
+
</picture>
|
154
|
+
</a>
|
155
|
+
<a href="https://bitkeep.com">
|
156
|
+
<picture>
|
157
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/bitkeep-dark.svg">
|
158
|
+
<img alt="BitKeep logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/bitkeep-light.svg" width="auto" height="50">
|
159
|
+
</picture>
|
160
|
+
</a>
|
161
|
+
<a href="https://privy.io">
|
162
|
+
<picture>
|
163
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/privy-dark.svg">
|
164
|
+
<img alt="Privy logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/privy-light.svg" width="auto" height="50">
|
165
|
+
</picture>
|
166
|
+
</a>
|
167
|
+
<a href="https://spruceid.com">
|
168
|
+
<picture>
|
169
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/spruce-dark.svg">
|
170
|
+
<img alt="Spruce logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/spruce-light.svg" width="auto" height="50">
|
171
|
+
</picture>
|
172
|
+
</a>
|
173
|
+
<a href="https://rollup.id">
|
174
|
+
<picture>
|
175
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/rollup.id-dark.svg">
|
176
|
+
<img alt="rollup.id logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/rollup.id-light.svg" width="auto" height="50">
|
177
|
+
</picture>
|
178
|
+
</a>
|
179
|
+
<a href="https://pancakeswap.finance/">
|
180
|
+
<picture>
|
181
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/pancake-dark.svg">
|
182
|
+
<img alt="pancake logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/pancake-light.svg" width="auto" height="50">
|
183
|
+
</picture>
|
184
|
+
</a>
|
185
|
+
<a href="https://celo.org/">
|
186
|
+
<picture>
|
187
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/celo-dark.svg">
|
188
|
+
<img alt="celo logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/celo-light.svg" width="auto" height="50">
|
189
|
+
</picture>
|
190
|
+
</a>
|
191
|
+
<a href="https://pimlico.io/">
|
192
|
+
<picture>
|
193
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/pimlico-dark.svg">
|
194
|
+
<img alt="pimlico logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/pimlico-light.svg" width="auto" height="50">
|
195
|
+
</picture>
|
196
|
+
</a>
|
197
|
+
<a href="https://zora.co/">
|
198
|
+
<picture>
|
199
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/zora-dark.svg">
|
200
|
+
<img alt="zora logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/zora-light.svg" width="auto" height="50">
|
201
|
+
</picture>
|
202
|
+
</a>
|
203
|
+
|
204
|
+
## Contributing
|
205
|
+
|
206
|
+
If you're interested in contributing, please read the [contributing docs](/.github/CONTRIBUTING.md) **before submitting a pull request**.
|
207
|
+
|
208
|
+
## Authors
|
209
|
+
|
210
|
+
- [@jxom](https://github.com/jxom) (jxom.eth, [Twitter](https://twitter.com/jakemoxey))
|
211
|
+
- [@tmm](https://github.com/tmm) (awkweb.eth, [Twitter](https://twitter.com/awkweb))
|
212
|
+
|
213
|
+
## License
|
214
|
+
|
215
|
+
[MIT](/LICENSE) License
|
package/_cjs/errors/version.js
CHANGED
package/_esm/errors/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = '0.0.0-main.
|
1
|
+
export const version = '0.0.0-main.20230924T221257';
|
2
2
|
//# sourceMappingURL=version.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "0.0.0-main.
|
1
|
+
export declare const version = "0.0.0-main.20230924T221257";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '0.0.0-main.
|
1
|
+
export const version = '0.0.0-main.20230924T221257'
|
package/package.json
CHANGED