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.
- package/actions/package.json +1 -1
- package/chains/package.json +1 -1
- package/clients/package.json +1 -1
- package/dist/actions/index.d.ts +3 -2
- package/dist/actions/index.js +125 -124
- package/dist/actions/index.mjs +125 -0
- package/dist/chains.d.ts +2 -2
- package/dist/chains.js +75 -76
- package/dist/chains.mjs +133 -0
- package/dist/{chunk-26WUARDL.js → chunk-2FDH6XP5.mjs} +1314 -72
- package/dist/chunk-46ZFLVHC.js +1084 -0
- package/dist/chunk-5ZBNF5WM.js +2616 -0
- package/dist/{chunk-375SRM5R.js → chunk-CWCWWGBC.mjs} +1 -1
- package/dist/{chunk-6BXRN6CQ.js → chunk-HLVCJ7RV.mjs} +48 -11
- package/dist/chunk-SGTIBKHG.js +258 -0
- package/dist/clients/index.js +23 -23
- package/dist/clients/index.mjs +23 -0
- package/dist/index.d.ts +5 -7
- package/dist/index.js +374 -374
- package/dist/index.mjs +374 -0
- package/dist/{parseGwei-64031f5e.d.ts → parseGwei-7c87ff41.d.ts} +40 -118
- package/dist/transactionRequest-08d30731.d.ts +132 -0
- package/dist/utils/index.d.ts +38 -5
- package/dist/utils/index.js +148 -138
- package/dist/utils/index.mjs +148 -0
- package/dist/{watchAsset-dc7dcdd9.d.ts → watchAsset-bc6373f4.d.ts} +15 -3
- package/dist/window.js +1 -0
- package/dist/window.mjs +0 -0
- package/package.json +9 -3
- package/utils/package.json +1 -1
- package/window/package.json +1 -1
- package/dist/chunk-7H5SPKXN.js +0 -1113
- package/dist/transactionRequest-3e463099.d.ts +0 -44
package/dist/chains.mjs
ADDED
@@ -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
|
+
};
|