viem 0.0.1-alpha.9 → 0.0.1-cjs.10

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.
@@ -0,0 +1,133 @@
1
+ import {
2
+ formatBlock,
3
+ formatTransaction,
4
+ formatTransactionReceipt,
5
+ formatTransactionRequest
6
+ } from "./chunk-2FDH6XP5.mjs";
7
+
8
+ // src/chains.ts
9
+ import {
10
+ arbitrumGoerli as arbitrumGoerli_,
11
+ arbitrum as arbitrum_,
12
+ avalancheFuji as avalancheFuji_,
13
+ avalanche as avalanche_,
14
+ bscTestnet as bscTestnet_,
15
+ bsc as bsc_,
16
+ fantomTestnet as fantomTestnet_,
17
+ fantom as fantom_,
18
+ foundry as foundry_,
19
+ goerli as goerli_,
20
+ hardhat as hardhat_,
21
+ localhost as localhost_,
22
+ mainnet as mainnet_,
23
+ optimismGoerli as optimismGoerli_,
24
+ optimism as optimism_,
25
+ polygonMumbai as polygonMumbai_,
26
+ polygon as polygon_,
27
+ sepolia as sepolia_
28
+ } from "@wagmi/chains";
29
+ function defineChain(chain) {
30
+ return chain;
31
+ }
32
+ function defineFormatter({
33
+ format
34
+ }) {
35
+ return ({
36
+ exclude,
37
+ format: formatOverride
38
+ }) => (data) => {
39
+ const formatted = format(data);
40
+ if (exclude) {
41
+ for (const key of exclude) {
42
+ delete formatted[key];
43
+ }
44
+ }
45
+ return {
46
+ ...formatted,
47
+ ...formatOverride?.(data)
48
+ };
49
+ };
50
+ }
51
+ var defineBlock = defineFormatter({ format: formatBlock });
52
+ var defineTransaction = defineFormatter({ format: formatTransaction });
53
+ var defineTransactionRequest = defineFormatter({
54
+ format: formatTransactionRequest
55
+ });
56
+ var defineTransactionReceipt = defineFormatter({
57
+ format: formatTransactionReceipt
58
+ });
59
+ var arbitrumGoerli = defineChain(arbitrumGoerli_);
60
+ var arbitrum = defineChain(arbitrum_);
61
+ var avalancheFuji = defineChain(avalancheFuji_);
62
+ var avalanche = defineChain(avalanche_);
63
+ var bscTestnet = defineChain(bscTestnet_);
64
+ var bsc = defineChain(bsc_);
65
+ var celo = defineChain({
66
+ id: 42220,
67
+ name: "Celo",
68
+ network: "celo",
69
+ nativeCurrency: { name: "Celo", symbol: "CELO", decimals: 18 },
70
+ rpcUrls: {
71
+ default: { http: ["https://rpc.ankr.com/celo"] }
72
+ },
73
+ formatters: {
74
+ block: defineBlock({
75
+ exclude: ["difficulty", "gasLimit", "mixHash", "nonce", "uncles"],
76
+ format: (block) => ({
77
+ randomness: block.randomness
78
+ })
79
+ }),
80
+ transaction: defineTransaction({
81
+ format: (transaction) => ({
82
+ feeCurrency: transaction.feeCurrency,
83
+ gatewayFee: transaction.gatewayFee ? BigInt(transaction.gatewayFee) : null,
84
+ gatewayFeeRecipient: transaction.gatewayFeeRecipient
85
+ })
86
+ }),
87
+ transactionRequest: defineTransactionRequest({
88
+ format: (transactionRequest) => ({
89
+ feeCurrency: transactionRequest.feeCurrency,
90
+ gatewayFee: transactionRequest.gatewayFee,
91
+ gatewayFeeRecipient: transactionRequest.gatewayFeeRecipient
92
+ })
93
+ })
94
+ }
95
+ });
96
+ var fantomTestnet = defineChain(fantomTestnet_);
97
+ var fantom = defineChain(fantom_);
98
+ var foundry = defineChain(foundry_);
99
+ var goerli = defineChain(goerli_);
100
+ var hardhat = defineChain(hardhat_);
101
+ var localhost = defineChain(localhost_);
102
+ var mainnet = defineChain(mainnet_);
103
+ var optimismGoerli = defineChain(optimismGoerli_);
104
+ var optimism = defineChain(optimism_);
105
+ var polygonMumbai = defineChain(polygonMumbai_);
106
+ var polygon = defineChain(polygon_);
107
+ var sepolia = defineChain(sepolia_);
108
+ export {
109
+ arbitrum,
110
+ arbitrumGoerli,
111
+ avalanche,
112
+ avalancheFuji,
113
+ bsc,
114
+ bscTestnet,
115
+ celo,
116
+ defineBlock,
117
+ defineChain,
118
+ defineTransaction,
119
+ defineTransactionReceipt,
120
+ defineTransactionRequest,
121
+ fantom,
122
+ fantomTestnet,
123
+ foundry,
124
+ goerli,
125
+ hardhat,
126
+ localhost,
127
+ mainnet,
128
+ optimism,
129
+ optimismGoerli,
130
+ polygon,
131
+ polygonMumbai,
132
+ sepolia
133
+ };