viem 0.0.1-alpha.35 → 0.0.1-alpha.37

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.
Files changed (67) hide show
  1. package/README.md +132 -0
  2. package/dist/abi.d.ts +2 -2
  3. package/dist/abi.js +2 -2
  4. package/dist/abi.mjs +1 -1
  5. package/dist/{chain-7b7ac245.d.ts → chain-a34aa9a2.d.ts} +65 -63
  6. package/dist/{chain-145cfaf3.d.ts → chain-b1229232.d.ts} +1 -1
  7. package/dist/chains.d.ts +3 -3
  8. package/dist/chains.js +46 -46
  9. package/dist/chains.mjs +1 -1
  10. package/dist/{chunk-HQCSH22G.js → chunk-534U2FZG.js} +1824 -129
  11. package/dist/chunk-534U2FZG.js.map +1 -0
  12. package/dist/{chunk-5NDMORWZ.mjs → chunk-AS2YWIFN.mjs} +3 -5
  13. package/dist/{chunk-5NDMORWZ.mjs.map → chunk-AS2YWIFN.mjs.map} +1 -1
  14. package/dist/{chunk-57YM6E7I.js → chunk-JXFHSHM6.js} +21 -23
  15. package/dist/chunk-JXFHSHM6.js.map +1 -0
  16. package/dist/{chunk-PBW4YL37.mjs → chunk-WVZFIDQ5.mjs} +1844 -149
  17. package/dist/chunk-WVZFIDQ5.mjs.map +1 -0
  18. package/dist/contract.d.ts +7 -7
  19. package/dist/contract.js +2 -6
  20. package/dist/contract.mjs +11 -15
  21. package/dist/{createClient-7c715e2c.d.ts → createClient-8024655d.d.ts} +3 -11
  22. package/dist/{createPublicClient-4d24afb2.d.ts → createPublicClient-f283b09d.d.ts} +62 -59
  23. package/dist/{eip1193-d538ae6d.d.ts → eip1193-a4f254d2.d.ts} +2 -2
  24. package/dist/{encodeFunctionResult-f59f4cfe.d.ts → encodeFunctionResult-c3d6c7ea.d.ts} +1 -1
  25. package/dist/ens.d.ts +4 -4
  26. package/dist/ens.js +3 -4
  27. package/dist/ens.js.map +1 -1
  28. package/dist/ens.mjs +2 -3
  29. package/dist/ens.mjs.map +1 -1
  30. package/dist/{formatAbiItem-89d97367.d.ts → formatAbiItem-d79cb207.d.ts} +1 -1
  31. package/dist/{getAbiItem-c9cbc8b8.d.ts → getAbiItem-48e793da.d.ts} +1 -1
  32. package/dist/index.d.ts +27 -16
  33. package/dist/index.js +89 -93
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +82 -86
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/{parseGwei-ad6d1914.d.ts → parseGwei-a8c67c77.d.ts} +11 -22
  38. package/dist/public.d.ts +6 -6
  39. package/dist/public.js +2 -3
  40. package/dist/public.mjs +1 -2
  41. package/dist/{test-8646fb50.d.ts → test-f8bc2fa7.d.ts} +3 -11
  42. package/dist/test.d.ts +5 -5
  43. package/dist/test.js +2 -3
  44. package/dist/test.mjs +1 -2
  45. package/dist/utils/index.d.ts +27 -16
  46. package/dist/utils/index.js +2 -4
  47. package/dist/utils/index.mjs +11 -13
  48. package/dist/wallet.d.ts +4 -4
  49. package/dist/wallet.js +2 -4
  50. package/dist/wallet.mjs +5 -7
  51. package/dist/window.d.ts +2 -2
  52. package/package.json +1 -1
  53. package/dist/chunk-3FT7UKPT.js +0 -1216
  54. package/dist/chunk-3FT7UKPT.js.map +0 -1
  55. package/dist/chunk-57YM6E7I.js.map +0 -1
  56. package/dist/chunk-A665BF7O.js +0 -205
  57. package/dist/chunk-A665BF7O.js.map +0 -1
  58. package/dist/chunk-HQCSH22G.js.map +0 -1
  59. package/dist/chunk-PBW4YL37.mjs.map +0 -1
  60. package/dist/chunk-PH5LCMME.mjs +0 -205
  61. package/dist/chunk-PH5LCMME.mjs.map +0 -1
  62. package/dist/chunk-TJK6AFBM.js +0 -265
  63. package/dist/chunk-TJK6AFBM.js.map +0 -1
  64. package/dist/chunk-WQDVW7EJ.mjs +0 -1216
  65. package/dist/chunk-WQDVW7EJ.mjs.map +0 -1
  66. package/dist/chunk-YEVW7GK5.mjs +0 -265
  67. package/dist/chunk-YEVW7GK5.mjs.map +0 -1
package/README.md CHANGED
@@ -10,7 +10,139 @@
10
10
  <p>
11
11
 
12
12
  <p align="center">
13
+ <a aria-label="Version" href="https://www.npmjs.com/package/viem">
14
+ <img
15
+ alt="version"
16
+ src="https://img.shields.io/npm/v/viem?colorA=2B323B&colorB=1e2329&style=flat&label=Version"
17
+ />
18
+ </a>
13
19
  <a href="https://codecov.io/github/wagmi-dev/viem" >
14
20
  <img src="https://codecov.io/github/wagmi-dev/viem/branch/main/graph/badge.svg?token=iUTN9R4Qfg"/>
15
21
  </a>
22
+ <a aria-label="License" href="https://www.npmjs.com/package/viem">
23
+ <img
24
+ alt=""
25
+ src="https://img.shields.io/github/license/wagmi-dev/viem?colorA=2B323B&colorB=1e2329&style=flat&label=License"
26
+ />
27
+ </a>
16
28
  </p>
29
+
30
+ ## Features
31
+
32
+ - Abstractions over the [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) to make your life easier
33
+ - First-class APIs for interacting with [Smart Contracts](https://ethereum.org/en/glossary/#smart-contract)
34
+ - Language closely aligned to official [Ethereum terminology](https://ethereum.org/en/glossary/)
35
+ - Import your Browser Extension, WalletConnect or Private Key Wallet
36
+ - Browser native [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt), instead of large BigNumber libraries
37
+ - Utilities for working with [ABIs](https://ethereum.org/en/glossary/#abi) (encoding/decoding/inspection)
38
+ - TypeScript ready ([infer types](https://viem.sh/docs/typescript) from ABIs and EIP-712 Typed Data)
39
+ - First-class support for [Anvil](https://book.getfoundry.sh/) & [Hardhat](https://hardhat.org/)
40
+ - Test suite running against [forked](https://ethereum.org/en/glossary/#fork) Ethereum network
41
+
42
+ ... and a lot lot more.
43
+
44
+ ## Overview
45
+
46
+ ```ts
47
+ // 1. Import modules.
48
+ import { createPublicClient, http } from 'viem'
49
+ import { mainnet } from 'viem/chains'
50
+
51
+ // 2. Set up your client with desired chain & transport.
52
+ const client = createPublicClient({
53
+ chain: mainnet,
54
+ transport: http(),
55
+ })
56
+
57
+ // 3. Consume an action!
58
+ const blockNumber = await client.getBlockNumber()
59
+ ```
60
+
61
+ ## Community
62
+
63
+ Check out the following places for more viem-related content:
64
+
65
+ - Follow [@wagmi_sh](https://twitter.com/wagmi_sh), [@jakemoxey](https://twitter.com/jakemoxey), and [@awkweb](https://twitter.com/awkweb) on Twitter for project updates
66
+ - Join the [discussions on GitHub](https://github.com/wagmi-dev/viem/discussions)
67
+ - [Share your project/organization](https://github.com/wagmi-dev/viem/discussions/104) that uses viem
68
+
69
+
70
+ ## Support
71
+
72
+ - [GitHub Sponsors](https://github.com/sponsors/wagmi-dev?metadata_campaign=docs_support)
73
+ - [Gitcoin Grant](https://wagmi.sh/gitcoin)
74
+ - [wagmi-dev.eth](https://etherscan.io/enslookup-search?search=wagmi-dev.eth)
75
+
76
+ ## Sponsors
77
+
78
+ <a href="https://paradigm.xyz">
79
+ <picture>
80
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/paradigm-dark.svg">
81
+ <img alt="paradigm logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/paradigm-light.svg" width="auto" height="70">
82
+ </picture>
83
+ </a>
84
+
85
+ <br>
86
+
87
+ <a href="https://twitter.com/family">
88
+ <picture>
89
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-dark.svg">
90
+ <img alt="family logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-light.svg" width="auto" height="50">
91
+ </picture>
92
+ </a>
93
+ <a href="https://twitter.com/context">
94
+ <picture>
95
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-dark.svg">
96
+ <img alt="context logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-light.svg" width="auto" height="50">
97
+ </picture>
98
+ </a>
99
+ <a href="https://walletconnect.com">
100
+ <picture>
101
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/walletconnect-dark.svg">
102
+ <img alt="WalletConnect logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/walletconnect-light.svg" width="auto" height="50">
103
+ </picture>
104
+ </a>
105
+ <a href="https://looksrare.org">
106
+ <picture>
107
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/looksrare-dark.svg">
108
+ <img alt="LooksRare logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/8923685e23fe9708b74d456c3f9e7a2b90f6abd9/content/sponsors/looksrare-light.svg" width="auto" height="50">
109
+ </picture>
110
+ </a>
111
+ <a href="https://twitter.com/prtyDAO">
112
+ <picture>
113
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/partydao-dark.svg">
114
+ <img alt="PartyDAO logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/partydao-light.svg" width="auto" height="50">
115
+ </picture>
116
+ </a>
117
+ <a href="https://dynamic.xyz">
118
+ <picture>
119
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/dynamic-dark.svg">
120
+ <img alt="Dynamic logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/dynamic-light.svg" width="auto" height="50">
121
+ </picture>
122
+ </a>
123
+ <a href="https://sushi.com">
124
+ <picture>
125
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/sushi-dark.svg">
126
+ <img alt="Sushi logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/sushi-light.svg" width="auto" height="50">
127
+ </picture>
128
+ </a>
129
+ <a href="https://stripe.com">
130
+ <picture>
131
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/stripe-dark.svg">
132
+ <img alt="Stripe logo" src="https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/stripe-light.svg" width="auto" height="50">
133
+ </picture>
134
+ </a>
135
+
136
+ ## Contributing
137
+
138
+ If you're interested in contributing, please read the [contributing docs](/.github/CONTRIBUTING.md) **before submitting a pull request**.
139
+
140
+ ## Authors
141
+
142
+ - [@jxom](https://github.com/jxom) (jxom.eth, [Twitter](https://twitter.com/jakemoxey))
143
+ - [@tmm](https://github.com/tmm) (awkweb.eth, [Twitter](https://twitter.com/awkweb))
144
+
145
+ ## License
146
+
147
+ [MIT](/LICENSE) License
148
+
package/dist/abi.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { D as DecodeAbiParametersResponse, E as EncodeAbiParametersResponse, G as GetAbiItemArgs, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-c9cbc8b8.js';
1
+ export { D as DecodeAbiParametersResponse, E as EncodeAbiParametersResponse, G as GetAbiItemArgs, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-48e793da.js';
2
2
  import 'abitype';
3
- import './chain-7b7ac245.js';
3
+ import './chain-a34aa9a2.js';
4
4
  import '@wagmi/chains';
5
5
  import 'ethers@6/types/providers';
package/dist/abi.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkHQCSH22Gjs = require('./chunk-HQCSH22G.js');
5
+ var _chunk534U2FZGjs = require('./chunk-534U2FZG.js');
6
6
 
7
7
 
8
8
 
9
9
 
10
- exports.decodeAbiParameters = _chunkHQCSH22Gjs.decodeAbiParameters; exports.encodeAbiParameters = _chunkHQCSH22Gjs.encodeAbiParameters; exports.getAbiItem = _chunkHQCSH22Gjs.getAbiItem;
10
+ exports.decodeAbiParameters = _chunk534U2FZGjs.decodeAbiParameters; exports.encodeAbiParameters = _chunk534U2FZGjs.encodeAbiParameters; exports.getAbiItem = _chunk534U2FZGjs.getAbiItem;
11
11
  //# sourceMappingURL=abi.js.map
package/dist/abi.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  decodeAbiParameters,
3
3
  encodeAbiParameters,
4
4
  getAbiItem
5
- } from "./chunk-PBW4YL37.mjs";
5
+ } from "./chunk-WVZFIDQ5.mjs";
6
6
  export {
7
7
  decodeAbiParameters,
8
8
  encodeAbiParameters,
@@ -27,11 +27,11 @@ type FormatOptions<TSource, TTarget> = {
27
27
  * Formatted<() => { a: bigint | undefined, b: bigint }, { a: bigint, b: bigint }, true>
28
28
  * => { a?: bigint | undefined, b: bigint }
29
29
  */
30
- type Formatted<TFormatter, TFallback, TAllowOptional = false> = TFormatter extends Formatter ? ReturnType<TFormatter> extends Record<string, never> ? TFallback : TAllowOptional extends true ? OptionalNullable<ReturnType<TFormatter>> : ReturnType<TFormatter> : never;
30
+ type Formatted<TFormatter, TFallback, TAllowOptional = false, TUseParameters = false> = TFormatter extends Formatter ? ReturnType<TFormatter> extends Record<string, never> ? TFallback : TAllowOptional extends true ? OptionalNullable<TUseParameters extends true ? Parameters<TFormatter>[0] : ReturnType<TFormatter>> : TUseParameters extends true ? Parameters<TFormatter>[0] : ReturnType<TFormatter> : never;
31
31
  /**
32
32
  * @description Formats a data object using the given replacer and an optional formatter.
33
33
  */
34
- declare function format<TFormatter, TSource extends Record<string, any>, TTarget>(data: TSource, { formatter }: FormatOptions<TSource, TTarget>): Formatted<TFormatter, TTarget, false>;
34
+ declare function format<TFormatter, TSource extends Record<string, any>, TTarget>(data: TSource, { formatter }: FormatOptions<TSource, TTarget>): Formatted<TFormatter, TTarget, false, false>;
35
35
  declare function defineFormatter<TSource extends Record<string, unknown>, TFormatted>({ format, }: {
36
36
  format: (data: TSource) => TFormatted;
37
37
  }): <TFormat extends Formatter<TSource, Partial<TFormatted> & {
@@ -53,13 +53,72 @@ declare const transactionType: {
53
53
  declare function formatTransaction(transaction: Partial<RpcTransaction>): Transaction<bigint, number>;
54
54
  declare const defineTransaction: <TFormat extends Formatter<Partial<RpcTransaction>, Partial<Transaction<bigint, number>> & {
55
55
  [key: string]: unknown;
56
- }>, TExclude extends ("type" | "value" | "blockHash" | "blockNumber" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "from" | "gas" | "nonce" | "to" | "accessList" | "hash" | "input" | "r" | "s" | "transactionIndex" | "v")[] = []>({ exclude, format: formatOverride, }: {
56
+ }>, TExclude extends ("type" | "value" | "blockHash" | "blockNumber" | "from" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "gas" | "nonce" | "to" | "accessList" | "chainId" | "hash" | "input" | "r" | "s" | "transactionIndex" | "v")[] = []>({ exclude, format: formatOverride, }: {
57
57
  exclude?: TExclude | undefined;
58
58
  format?: TFormat | undefined;
59
59
  }) => (data: Partial<RpcTransaction> & {
60
60
  [key: string]: unknown;
61
61
  }) => Transaction<bigint, number> & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
62
62
 
63
+ type Block<TQuantity = bigint, TTransaction = Transaction> = {
64
+ /** Base fee per gas */
65
+ baseFeePerGas: TQuantity | null;
66
+ /** Difficulty for this block */
67
+ difficulty: TQuantity;
68
+ /** "Extra data" field of this block */
69
+ extraData: Hex;
70
+ /** Maximum gas allowed in this block */
71
+ gasLimit: TQuantity;
72
+ /** Total used gas by all transactions in this block */
73
+ gasUsed: TQuantity;
74
+ /** Block hash or `null` if pending */
75
+ hash: Hash | null;
76
+ /** Logs bloom filter or `null` if pending */
77
+ logsBloom: Hex | null;
78
+ /** Address that received this block’s mining rewards */
79
+ miner: Address;
80
+ /** Unique identifier for the block. */
81
+ mixHash: Hash;
82
+ /** Proof-of-work hash or `null` if pending */
83
+ nonce: Hex | null;
84
+ /** Block number or `null` if pending */
85
+ number: TQuantity | null;
86
+ /** Parent block hash */
87
+ parentHash: Hash;
88
+ /** Root of the this block’s receipts trie */
89
+ receiptsRoot: Hex;
90
+ sealFields: Hex[];
91
+ /** SHA3 of the uncles data in this block */
92
+ sha3Uncles: Hash;
93
+ /** Size of this block in bytes */
94
+ size: TQuantity;
95
+ /** Root of this block’s final state trie */
96
+ stateRoot: Hash;
97
+ /** Unix timestamp of when this block was collated */
98
+ timestamp: TQuantity;
99
+ /** Total difficulty of the chain until this block */
100
+ totalDifficulty: TQuantity | null;
101
+ /** List of transaction objects or hashes */
102
+ transactions: Hash[] | TTransaction[];
103
+ /** Root of this block’s transaction trie */
104
+ transactionsRoot: Hash;
105
+ /** List of uncle hashes */
106
+ uncles: Hash[];
107
+ };
108
+ type BlockIdentifier<TQuantity = bigint> = {
109
+ /** Whether or not to throw an error if the block is not in the canonical chain as described below. Only allowed in conjunction with the blockHash tag. Defaults to false. */
110
+ requireCanonical?: boolean;
111
+ } & ({
112
+ /** The block in the canonical chain with this number */
113
+ blockNumber: BlockNumber<TQuantity>;
114
+ } | {
115
+ /** The block uniquely identified by this hash. The `blockNumber` and `blockHash` properties are mutually exclusive; exactly one of them must be set. */
116
+ blockHash: Hash;
117
+ });
118
+ type BlockNumber<TQuantity = bigint> = TQuantity;
119
+ type BlockTag = 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized';
120
+ type Uncle<TQuantity = bigint, TTransaction = Transaction> = Block<TQuantity, TTransaction>;
121
+
63
122
  type FeeHistory<TQuantity = bigint> = {
64
123
  /**
65
124
  * An array of block base fees per gas (in wei). This includes the next block after
@@ -406,6 +465,8 @@ type TransactionBase<TQuantity = bigint, TIndex = number> = {
406
465
  blockHash: Hash | null;
407
466
  /** Number of block containing this transaction or `null` if pending */
408
467
  blockNumber: TQuantity | null;
468
+ /** Chain ID. */
469
+ chainId: TIndex;
409
470
  /** Transaction sender */
410
471
  from: Address;
411
472
  /** Gas provided for transaction execution */
@@ -467,65 +528,6 @@ type TransactionRequestEIP1559<TQuantity = bigint, TIndex = number> = Transactio
467
528
  };
468
529
  type TransactionRequest<TQuantity = bigint, TIndex = number> = TransactionRequestLegacy<TQuantity, TIndex> | TransactionRequestEIP2930<TQuantity, TIndex> | TransactionRequestEIP1559<TQuantity, TIndex>;
469
530
 
470
- type Block<TQuantity = bigint, TTransaction = Transaction> = {
471
- /** Base fee per gas */
472
- baseFeePerGas: TQuantity | null;
473
- /** Difficulty for this block */
474
- difficulty: TQuantity;
475
- /** "Extra data" field of this block */
476
- extraData: Hex;
477
- /** Maximum gas allowed in this block */
478
- gasLimit: TQuantity;
479
- /** Total used gas by all transactions in this block */
480
- gasUsed: TQuantity;
481
- /** Block hash or `null` if pending */
482
- hash: Hash | null;
483
- /** Logs bloom filter or `null` if pending */
484
- logsBloom: Hex | null;
485
- /** Address that received this block’s mining rewards */
486
- miner: Address;
487
- /** Unique identifier for the block. */
488
- mixHash: Hash;
489
- /** Proof-of-work hash or `null` if pending */
490
- nonce: Hex | null;
491
- /** Block number or `null` if pending */
492
- number: TQuantity | null;
493
- /** Parent block hash */
494
- parentHash: Hash;
495
- /** Root of the this block’s receipts trie */
496
- receiptsRoot: Hex;
497
- sealFields: Hex[];
498
- /** SHA3 of the uncles data in this block */
499
- sha3Uncles: Hash;
500
- /** Size of this block in bytes */
501
- size: TQuantity;
502
- /** Root of this block’s final state trie */
503
- stateRoot: Hash;
504
- /** Unix timestamp of when this block was collated */
505
- timestamp: TQuantity;
506
- /** Total difficulty of the chain until this block */
507
- totalDifficulty: TQuantity | null;
508
- /** List of transaction objects or hashes */
509
- transactions: Hash[] | TTransaction[];
510
- /** Root of this block’s transaction trie */
511
- transactionsRoot: Hash;
512
- /** List of uncle hashes */
513
- uncles: Hash[];
514
- };
515
- type BlockIdentifier<TQuantity = bigint> = {
516
- /** Whether or not to throw an error if the block is not in the canonical chain as described below. Only allowed in conjunction with the blockHash tag. Defaults to false. */
517
- requireCanonical?: boolean;
518
- } & ({
519
- /** The block in the canonical chain with this number */
520
- blockNumber: BlockNumber<TQuantity>;
521
- } | {
522
- /** The block uniquely identified by this hash. The `blockNumber` and `blockHash` properties are mutually exclusive; exactly one of them must be set. */
523
- blockHash: Hash;
524
- });
525
- type BlockNumber<TQuantity = bigint> = TQuantity;
526
- type BlockTag = 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized';
527
- type Uncle<TQuantity = bigint, TTransaction = Transaction> = Block<TQuantity, TTransaction>;
528
-
529
531
  type Formatter<TSource = any, TTarget = any> = (value: TSource & {
530
532
  [key: string]: unknown;
531
533
  }) => TTarget;
@@ -540,4 +542,4 @@ type Chain<TFormatters extends Formatters = Formatters> = Chain$1 & {
540
542
  formatters?: TFormatters;
541
543
  };
542
544
 
543
- export { MaybeAbiEventName as $, Address as A, ByteArray as B, Chain as C, TransactionBase as D, TransactionEIP1559 as E, FeeHistory as F, TransactionEIP2930 as G, Hex as H, TransactionLegacy as I, ExtractFormatter as J, Formatted as K, Log as L, FormattedTransaction as M, TransactionFormatter as N, defineTransaction as O, formatTransaction as P, transactionType as Q, RpcBlock as R, Formatters as S, TransactionReceipt as T, Uncle as U, Formatter as V, TransactionType as W, MergeIntersectionProperties as X, ExtractConstructorArgsFromAbi as Y, GetValue as Z, ExtractResultFromAbi as _, Hash as a, MaybeExtractEventArgsFromAbi as a0, ExtractEventNameFromAbi as a1, ExtractEventArgsFromAbi as a2, Prettify as a3, Quantity as a4, EventDefinition as a5, ExtractNameFromAbi as a6, ExtractArgsFromAbi as a7, LogTopic as a8, ExtractEventArgsFromTopics as a9, ExtractFunctionNameFromAbi as aa, ExtractErrorNameFromAbi as ab, ExtractErrorArgsFromAbi as ac, defineFormatter as ad, format as ae, AbiItem as b, AccessList as c, Block as d, BlockIdentifier as e, BlockNumber as f, BlockTag as g, ContractConfig as h, FeeValues as i, FeeValuesEIP1559 as j, FeeValuesLegacy as k, RpcBlockIdentifier as l, RpcBlockNumber as m, RpcFeeHistory as n, RpcFeeValues as o, RpcLog as p, RpcTransaction as q, RpcTransactionReceipt as r, RpcTransactionRequest as s, RpcUncle as t, TransactionRequest as u, TransactionRequestBase as v, TransactionRequestEIP1559 as w, TransactionRequestEIP2930 as x, TransactionRequestLegacy as y, Transaction as z };
545
+ export { MaybeAbiEventName as $, AbiItem as A, ByteArray as B, Chain as C, TransactionBase as D, TransactionEIP1559 as E, FeeHistory as F, TransactionEIP2930 as G, Hex as H, TransactionLegacy as I, ExtractFormatter as J, Formatted as K, Log as L, FormattedTransaction as M, TransactionFormatter as N, defineTransaction as O, formatTransaction as P, transactionType as Q, RpcBlock as R, Formatters as S, TransactionReceipt as T, Uncle as U, Formatter as V, TransactionType as W, MergeIntersectionProperties as X, ExtractConstructorArgsFromAbi as Y, GetValue as Z, ExtractResultFromAbi as _, Hash as a, MaybeExtractEventArgsFromAbi as a0, ExtractEventNameFromAbi as a1, ExtractEventArgsFromAbi as a2, Prettify as a3, Quantity as a4, EventDefinition as a5, ExtractNameFromAbi as a6, ExtractArgsFromAbi as a7, LogTopic as a8, ExtractEventArgsFromTopics as a9, ExtractFunctionNameFromAbi as aa, ExtractErrorNameFromAbi as ab, ExtractErrorArgsFromAbi as ac, defineFormatter as ad, format as ae, AccessList as b, Address as c, Block as d, BlockIdentifier as e, BlockNumber as f, BlockTag as g, ContractConfig as h, FeeValues as i, FeeValuesEIP1559 as j, FeeValuesLegacy as k, RpcBlockIdentifier as l, RpcBlockNumber as m, RpcFeeHistory as n, RpcFeeValues as o, RpcLog as p, RpcTransaction as q, RpcTransactionReceipt as r, RpcTransactionRequest as s, RpcUncle as t, TransactionRequest as u, TransactionRequestBase as v, TransactionRequestEIP1559 as w, TransactionRequestEIP2930 as x, TransactionRequestLegacy as y, Transaction as z };
@@ -1,4 +1,4 @@
1
- import { S as Formatters, C as Chain } from './chain-7b7ac245.js';
1
+ import { S as Formatters, C as Chain } from './chain-a34aa9a2.js';
2
2
 
3
3
  declare function defineChain<TFormatters extends Formatters = Formatters, TChain extends Chain<TFormatters> = Chain<TFormatters>>(chain: TChain): TChain;
4
4
 
package/dist/chains.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { R as RpcBlock, d as Block, z as Transaction, H as Hex, q as RpcTransaction, r as RpcTransactionReceipt, T as TransactionReceipt, W as TransactionType, u as TransactionRequest, s as RpcTransactionRequest } from './chain-7b7ac245.js';
2
- export { C as Chain } from './chain-7b7ac245.js';
3
- export { d as defineChain } from './chain-145cfaf3.js';
1
+ import { R as RpcBlock, d as Block, z as Transaction, H as Hex, q as RpcTransaction, r as RpcTransactionReceipt, T as TransactionReceipt, W as TransactionType, u as TransactionRequest, s as RpcTransactionRequest } from './chain-a34aa9a2.js';
2
+ export { C as Chain } from './chain-a34aa9a2.js';
3
+ export { d as defineChain } from './chain-b1229232.js';
4
4
  import '@wagmi/chains';
5
5
  import 'abitype';
6
6
  import 'ethers@6/types/providers';
package/dist/chains.js CHANGED
@@ -4,32 +4,32 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkHQCSH22Gjs = require('./chunk-HQCSH22G.js');
7
+ var _chunk534U2FZGjs = require('./chunk-534U2FZG.js');
8
8
 
9
9
  // src/chains.ts
10
10
  var _chains = require('@wagmi/chains'); var chains = _interopRequireWildcard(_chains);
11
11
  var celoFormatters = {
12
- block: _chunkHQCSH22Gjs.defineBlock.call(void 0, {
12
+ block: _chunk534U2FZGjs.defineBlock.call(void 0, {
13
13
  exclude: ["difficulty", "gasLimit", "mixHash", "nonce", "uncles"],
14
14
  format: (block) => ({
15
15
  randomness: block.randomness
16
16
  })
17
17
  }),
18
- transaction: _chunkHQCSH22Gjs.defineTransaction.call(void 0, {
18
+ transaction: _chunk534U2FZGjs.defineTransaction.call(void 0, {
19
19
  format: (transaction) => ({
20
20
  feeCurrency: transaction.feeCurrency,
21
21
  gatewayFee: transaction.gatewayFee ? BigInt(transaction.gatewayFee) : null,
22
22
  gatewayFeeRecipient: transaction.gatewayFeeRecipient
23
23
  })
24
24
  }),
25
- transactionReceipt: _chunkHQCSH22Gjs.defineTransactionReceipt.call(void 0, {
25
+ transactionReceipt: _chunk534U2FZGjs.defineTransactionReceipt.call(void 0, {
26
26
  format: (transaction) => ({
27
27
  feeCurrency: transaction.feeCurrency,
28
28
  gatewayFee: transaction.gatewayFee ? BigInt(transaction.gatewayFee) : null,
29
29
  gatewayFeeRecipient: transaction.gatewayFeeRecipient
30
30
  })
31
31
  }),
32
- transactionRequest: _chunkHQCSH22Gjs.defineTransactionRequest.call(void 0, {
32
+ transactionRequest: _chunk534U2FZGjs.defineTransactionRequest.call(void 0, {
33
33
  format: (transactionRequest) => ({
34
34
  feeCurrency: transactionRequest.feeCurrency,
35
35
  gatewayFee: transactionRequest.gatewayFee,
@@ -37,52 +37,52 @@ var celoFormatters = {
37
37
  })
38
38
  })
39
39
  };
40
- var arbitrum2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.arbitrum);
41
- var arbitrumGoerli2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.arbitrumGoerli);
42
- var aurora2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.aurora);
43
- var auroraGoerli = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.auroraTestnet);
44
- var avalanche2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.avalanche);
45
- var avalancheFuji2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.avalancheFuji);
46
- var bronos2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.bronos);
47
- var bronosTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.bronosTestnet);
48
- var bsc2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.bsc);
49
- var bscTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.bscTestnet);
50
- var canto2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.canto);
51
- var celo2 = _chunkHQCSH22Gjs.defineChain.call(void 0, {
40
+ var arbitrum2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.arbitrum);
41
+ var arbitrumGoerli2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.arbitrumGoerli);
42
+ var aurora2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.aurora);
43
+ var auroraGoerli = _chunk534U2FZGjs.defineChain.call(void 0, chains.auroraTestnet);
44
+ var avalanche2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.avalanche);
45
+ var avalancheFuji2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.avalancheFuji);
46
+ var bronos2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.bronos);
47
+ var bronosTestnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.bronosTestnet);
48
+ var bsc2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.bsc);
49
+ var bscTestnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.bscTestnet);
50
+ var canto2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.canto);
51
+ var celo2 = _chunk534U2FZGjs.defineChain.call(void 0, {
52
52
  ...chains.celo,
53
53
  formatters: celoFormatters
54
54
  });
55
- var celoAlfajores2 = _chunkHQCSH22Gjs.defineChain.call(void 0, {
55
+ var celoAlfajores2 = _chunk534U2FZGjs.defineChain.call(void 0, {
56
56
  ...chains.celoAlfajores,
57
57
  formatters: celoFormatters
58
58
  });
59
- var crossbell2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.crossbell);
60
- var evmos2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.evmos);
61
- var evmosTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.evmosTestnet);
62
- var fantom2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.fantom);
63
- var fantomTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.fantomTestnet);
64
- var filecoin2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.filecoin);
65
- var filecoinTestnet = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.filecoinHyperspace);
66
- var foundry2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.foundry);
67
- var goerli2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.goerli);
68
- var gnosis2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.gnosis);
69
- var gnosisChiado2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.gnosisChiado);
70
- var hardhat2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.hardhat);
71
- var iotex2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.iotex);
72
- var iotexTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.iotexTestnet);
73
- var localhost2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.localhost);
74
- var mainnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.mainnet);
75
- var metis2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.metis);
76
- var metisGoerli2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.metisGoerli);
77
- var optimism2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.optimism);
78
- var optimismGoerli2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.optimismGoerli);
79
- var polygon2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.polygon);
80
- var polygonMumbai2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.polygonMumbai);
81
- var sepolia2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.sepolia);
82
- var taraxa2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.taraxa);
83
- var taraxaTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.taraxaTestnet);
84
- var zkSync2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.zkSync);
85
- var zkSyncTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.zkSyncTestnet);
59
+ var crossbell2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.crossbell);
60
+ var evmos2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.evmos);
61
+ var evmosTestnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.evmosTestnet);
62
+ var fantom2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.fantom);
63
+ var fantomTestnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.fantomTestnet);
64
+ var filecoin2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.filecoin);
65
+ var filecoinTestnet = _chunk534U2FZGjs.defineChain.call(void 0, chains.filecoinHyperspace);
66
+ var foundry2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.foundry);
67
+ var goerli2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.goerli);
68
+ var gnosis2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.gnosis);
69
+ var gnosisChiado2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.gnosisChiado);
70
+ var hardhat2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.hardhat);
71
+ var iotex2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.iotex);
72
+ var iotexTestnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.iotexTestnet);
73
+ var localhost2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.localhost);
74
+ var mainnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.mainnet);
75
+ var metis2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.metis);
76
+ var metisGoerli2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.metisGoerli);
77
+ var optimism2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.optimism);
78
+ var optimismGoerli2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.optimismGoerli);
79
+ var polygon2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.polygon);
80
+ var polygonMumbai2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.polygonMumbai);
81
+ var sepolia2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.sepolia);
82
+ var taraxa2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.taraxa);
83
+ var taraxaTestnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.taraxaTestnet);
84
+ var zkSync2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.zkSync);
85
+ var zkSyncTestnet2 = _chunk534U2FZGjs.defineChain.call(void 0, chains.zkSyncTestnet);
86
86
 
87
87
 
88
88
 
@@ -125,5 +125,5 @@ var zkSyncTestnet2 = _chunkHQCSH22Gjs.defineChain.call(void 0, chains.zkSyncTest
125
125
 
126
126
 
127
127
 
128
- exports.arbitrum = arbitrum2; exports.arbitrumGoerli = arbitrumGoerli2; exports.aurora = aurora2; exports.auroraGoerli = auroraGoerli; exports.avalanche = avalanche2; exports.avalancheFuji = avalancheFuji2; exports.bronos = bronos2; exports.bronosTestnet = bronosTestnet2; exports.bsc = bsc2; exports.bscTestnet = bscTestnet2; exports.canto = canto2; exports.celo = celo2; exports.celoAlfajores = celoAlfajores2; exports.crossbell = crossbell2; exports.defineChain = _chunkHQCSH22Gjs.defineChain; exports.evmos = evmos2; exports.evmosTestnet = evmosTestnet2; exports.fantom = fantom2; exports.fantomTestnet = fantomTestnet2; exports.filecoin = filecoin2; exports.filecoinTestnet = filecoinTestnet; exports.foundry = foundry2; exports.gnosis = gnosis2; exports.gnosisChiado = gnosisChiado2; exports.goerli = goerli2; exports.hardhat = hardhat2; exports.iotex = iotex2; exports.iotexTestnet = iotexTestnet2; exports.localhost = localhost2; exports.mainnet = mainnet2; exports.metis = metis2; exports.metisGoerli = metisGoerli2; exports.optimism = optimism2; exports.optimismGoerli = optimismGoerli2; exports.polygon = polygon2; exports.polygonMumbai = polygonMumbai2; exports.sepolia = sepolia2; exports.taraxa = taraxa2; exports.taraxaTestnet = taraxaTestnet2; exports.zkSync = zkSync2; exports.zkSyncTestnet = zkSyncTestnet2;
128
+ exports.arbitrum = arbitrum2; exports.arbitrumGoerli = arbitrumGoerli2; exports.aurora = aurora2; exports.auroraGoerli = auroraGoerli; exports.avalanche = avalanche2; exports.avalancheFuji = avalancheFuji2; exports.bronos = bronos2; exports.bronosTestnet = bronosTestnet2; exports.bsc = bsc2; exports.bscTestnet = bscTestnet2; exports.canto = canto2; exports.celo = celo2; exports.celoAlfajores = celoAlfajores2; exports.crossbell = crossbell2; exports.defineChain = _chunk534U2FZGjs.defineChain; exports.evmos = evmos2; exports.evmosTestnet = evmosTestnet2; exports.fantom = fantom2; exports.fantomTestnet = fantomTestnet2; exports.filecoin = filecoin2; exports.filecoinTestnet = filecoinTestnet; exports.foundry = foundry2; exports.gnosis = gnosis2; exports.gnosisChiado = gnosisChiado2; exports.goerli = goerli2; exports.hardhat = hardhat2; exports.iotex = iotex2; exports.iotexTestnet = iotexTestnet2; exports.localhost = localhost2; exports.mainnet = mainnet2; exports.metis = metis2; exports.metisGoerli = metisGoerli2; exports.optimism = optimism2; exports.optimismGoerli = optimismGoerli2; exports.polygon = polygon2; exports.polygonMumbai = polygonMumbai2; exports.sepolia = sepolia2; exports.taraxa = taraxa2; exports.taraxaTestnet = taraxaTestnet2; exports.zkSync = zkSync2; exports.zkSyncTestnet = zkSyncTestnet2;
129
129
  //# sourceMappingURL=chains.js.map
package/dist/chains.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  defineTransaction,
5
5
  defineTransactionReceipt,
6
6
  defineTransactionRequest
7
- } from "./chunk-PBW4YL37.mjs";
7
+ } from "./chunk-WVZFIDQ5.mjs";
8
8
 
9
9
  // src/chains.ts
10
10
  import * as chains from "@wagmi/chains";