viem 0.0.1-alpha.13 → 0.0.1-alpha.15

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 (50) hide show
  1. package/dist/chains.js +5 -5
  2. package/dist/chains.mjs +1 -1
  3. package/dist/{chunk-4XV4JRFM.mjs → chunk-2HENAFQN.mjs} +16 -6
  4. package/dist/{chunk-O3XABJRL.js → chunk-EMQSYKNY.js} +11 -11
  5. package/dist/{chunk-OHOJCVQD.js → chunk-HTYEJEWI.js} +156 -529
  6. package/dist/chunk-IMYI7Z6M.js +255 -0
  7. package/dist/chunk-KGXH5DYI.js +152 -0
  8. package/dist/chunk-NYXBQHNJ.mjs +255 -0
  9. package/dist/chunk-PHAG5KUF.mjs +152 -0
  10. package/dist/{chunk-NJ5NFIT4.mjs → chunk-PPDHFNFM.mjs} +107 -480
  11. package/dist/{chunk-AGF7GU6G.js → chunk-QMLDI5JU.js} +16 -6
  12. package/dist/{chunk-KZVBHS2T.mjs → chunk-SX7GPOCZ.mjs} +1 -1
  13. package/dist/clients/index.d.ts +6 -3
  14. package/dist/clients/index.js +3 -3
  15. package/dist/clients/index.mjs +2 -2
  16. package/dist/createClient-cd948138.d.ts +62 -0
  17. package/dist/createPublicClient-989a0556.d.ts +19 -0
  18. package/dist/createTestClient-81507f58.d.ts +34 -0
  19. package/dist/createWalletClient-43f801b9.d.ts +30 -0
  20. package/dist/{eip1193-c001fcd5.d.ts → eip1193-4330b722.d.ts} +1 -1
  21. package/dist/index.d.ts +13 -6
  22. package/dist/index.js +10 -4
  23. package/dist/index.mjs +35 -29
  24. package/dist/{parseGwei-21f98a29.d.ts → parseGwei-f2d23de6.d.ts} +1 -1
  25. package/dist/public.d.ts +12 -0
  26. package/dist/public.js +58 -0
  27. package/dist/public.mjs +58 -0
  28. package/dist/sendTransaction-7a9d241a.d.ts +13 -0
  29. package/dist/stopImpersonatingAccount-8113150e.d.ts +156 -0
  30. package/dist/test.d.ts +7 -0
  31. package/dist/test.js +59 -0
  32. package/dist/test.mjs +59 -0
  33. package/dist/{transactionRequest-1d4e4385.d.ts → transactionReceipt-5d332aab.d.ts} +4 -32
  34. package/dist/transactionRequest-327eb7c2.d.ts +33 -0
  35. package/dist/utils/index.d.ts +4 -3
  36. package/dist/utils/index.js +2 -2
  37. package/dist/utils/index.mjs +1 -1
  38. package/dist/wallet.d.ts +9 -0
  39. package/dist/wallet.js +23 -0
  40. package/dist/wallet.mjs +23 -0
  41. package/dist/watchAsset-0088384c.d.ts +39 -0
  42. package/dist/{stopImpersonatingAccount-70c4a70c.d.ts → watchPendingTransactions-670a7ca3.d.ts} +19 -197
  43. package/dist/{webSocket-3385e295.d.ts → webSocket-9a3b0b26.d.ts} +1 -1
  44. package/dist/window.d.ts +1 -1
  45. package/package.json +16 -6
  46. package/actions/package.json +0 -4
  47. package/dist/actions/index.d.ts +0 -8
  48. package/dist/actions/index.js +0 -127
  49. package/dist/actions/index.mjs +0 -127
  50. package/dist/createWalletClient-3f9fa8b6.d.ts +0 -130
@@ -0,0 +1,255 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkQMLDI5JUjs = require('./chunk-QMLDI5JU.js');
6
+
7
+ // src/actions/test/dropTransaction.ts
8
+ async function dropTransaction(client, { hash }) {
9
+ return await client.request({
10
+ method: `${client.mode}_dropTransaction`,
11
+ params: [hash]
12
+ });
13
+ }
14
+
15
+ // src/actions/test/getAutomine.ts
16
+ async function getAutomine(client) {
17
+ return await client.request({
18
+ method: `${client.mode}_getAutomine`
19
+ });
20
+ }
21
+
22
+ // src/actions/test/getTxpoolContent.ts
23
+ async function getTxpoolContent(client) {
24
+ return await client.request({
25
+ method: "txpool_content"
26
+ });
27
+ }
28
+
29
+ // src/actions/test/getTxpoolStatus.ts
30
+ async function getTxpoolStatus(client) {
31
+ const { pending, queued } = await client.request({
32
+ method: "txpool_status"
33
+ });
34
+ return {
35
+ pending: _chunkQMLDI5JUjs.hexToNumber.call(void 0, pending),
36
+ queued: _chunkQMLDI5JUjs.hexToNumber.call(void 0, queued)
37
+ };
38
+ }
39
+
40
+ // src/actions/test/impersonateAccount.ts
41
+ async function impersonateAccount(client, { address }) {
42
+ return await client.request({
43
+ method: `${client.mode}_impersonateAccount`,
44
+ params: [address]
45
+ });
46
+ }
47
+
48
+ // src/actions/test/increaseTime.ts
49
+ async function increaseTime(client, { seconds }) {
50
+ return await client.request({
51
+ method: "evm_increaseTime",
52
+ params: [_chunkQMLDI5JUjs.numberToHex.call(void 0, seconds)]
53
+ });
54
+ }
55
+
56
+ // src/actions/test/inspectTxpool.ts
57
+ async function inspectTxpool(client) {
58
+ return await client.request({
59
+ method: "txpool_inspect"
60
+ });
61
+ }
62
+
63
+ // src/actions/test/mine.ts
64
+ async function mine(client, { blocks, interval }) {
65
+ return await client.request({
66
+ method: `${client.mode}_mine`,
67
+ params: [_chunkQMLDI5JUjs.numberToHex.call(void 0, blocks), _chunkQMLDI5JUjs.numberToHex.call(void 0, interval || 0)]
68
+ });
69
+ }
70
+
71
+ // src/actions/test/removeBlockTimestampInterval.ts
72
+ async function removeBlockTimestampInterval(client) {
73
+ return await client.request({
74
+ method: `${client.mode}_removeBlockTimestampInterval`
75
+ });
76
+ }
77
+
78
+ // src/actions/test/reset.ts
79
+ async function reset(client, { blockNumber, jsonRpcUrl } = {}) {
80
+ return await client.request({
81
+ method: `${client.mode}_reset`,
82
+ params: [{ forking: { blockNumber: Number(blockNumber), jsonRpcUrl } }]
83
+ });
84
+ }
85
+
86
+ // src/actions/test/revert.ts
87
+ async function revert(client, { id }) {
88
+ return await client.request({
89
+ method: "evm_revert",
90
+ params: [id]
91
+ });
92
+ }
93
+
94
+ // src/actions/test/sendUnsignedTransaction.ts
95
+ async function sendUnsignedTransaction(client, request) {
96
+ const request_ = _chunkQMLDI5JUjs.formatTransactionRequest.call(void 0, request);
97
+ const hash = await client.request({
98
+ method: "eth_sendUnsignedTransaction",
99
+ params: [request_]
100
+ });
101
+ return hash;
102
+ }
103
+
104
+ // src/actions/test/setAutomine.ts
105
+ async function setAutomine(client, enabled) {
106
+ return await client.request({
107
+ method: "evm_setAutomine",
108
+ params: [enabled]
109
+ });
110
+ }
111
+
112
+ // src/actions/test/setBalance.ts
113
+ async function setBalance(client, { address, value }) {
114
+ return await client.request({
115
+ method: `${client.mode}_setBalance`,
116
+ params: [address, _chunkQMLDI5JUjs.numberToHex.call(void 0, value)]
117
+ });
118
+ }
119
+
120
+ // src/actions/test/setBlockGasLimit.ts
121
+ async function setBlockGasLimit(client, { gasLimit }) {
122
+ return await client.request({
123
+ method: "evm_setBlockGasLimit",
124
+ params: [_chunkQMLDI5JUjs.numberToHex.call(void 0, gasLimit)]
125
+ });
126
+ }
127
+
128
+ // src/actions/test/setBlockTimestampInterval.ts
129
+ async function setBlockTimestampInterval(client, { interval }) {
130
+ return await client.request({
131
+ method: `${client.mode}_setBlockTimestampInterval`,
132
+ params: [interval]
133
+ });
134
+ }
135
+
136
+ // src/actions/test/setCode.ts
137
+ async function setCode(client, { address, bytecode }) {
138
+ return await client.request({
139
+ method: `${client.mode}_setCode`,
140
+ params: [address, bytecode]
141
+ });
142
+ }
143
+
144
+ // src/actions/test/setCoinbase.ts
145
+ async function setCoinbase(client, { address }) {
146
+ return await client.request({
147
+ method: `${client.mode}_setCoinbase`,
148
+ params: [address]
149
+ });
150
+ }
151
+
152
+ // src/actions/test/setIntervalMining.ts
153
+ async function setIntervalMining(client, { interval }) {
154
+ return await client.request({
155
+ method: "evm_setIntervalMining",
156
+ params: [interval]
157
+ });
158
+ }
159
+
160
+ // src/actions/test/setLoggingEnabled.ts
161
+ async function setLoggingEnabled(client, enabled) {
162
+ return await client.request({
163
+ method: `${client.mode}_setLoggingEnabled`,
164
+ params: [enabled]
165
+ });
166
+ }
167
+
168
+ // src/actions/test/setMinGasPrice.ts
169
+ async function setMinGasPrice(client, { gasPrice }) {
170
+ return await client.request({
171
+ method: `${client.mode}_setMinGasPrice`,
172
+ params: [_chunkQMLDI5JUjs.numberToHex.call(void 0, gasPrice)]
173
+ });
174
+ }
175
+
176
+ // src/actions/test/setNextBlockBaseFeePerGas.ts
177
+ async function setNextBlockBaseFeePerGas(client, { baseFeePerGas }) {
178
+ return await client.request({
179
+ method: `${client.mode}_setNextBlockBaseFeePerGas`,
180
+ params: [_chunkQMLDI5JUjs.numberToHex.call(void 0, baseFeePerGas)]
181
+ });
182
+ }
183
+
184
+ // src/actions/test/setNextBlockTimestamp.ts
185
+ async function setNextBlockTimestamp(client, { timestamp }) {
186
+ return await client.request({
187
+ method: "evm_setNextBlockTimestamp",
188
+ params: [_chunkQMLDI5JUjs.numberToHex.call(void 0, timestamp)]
189
+ });
190
+ }
191
+
192
+ // src/actions/test/setNonce.ts
193
+ async function setNonce(client, { address, nonce }) {
194
+ return await client.request({
195
+ method: `${client.mode}_setNonce`,
196
+ params: [address, _chunkQMLDI5JUjs.numberToHex.call(void 0, nonce)]
197
+ });
198
+ }
199
+
200
+ // src/actions/test/setStorageAt.ts
201
+ async function setStorageAt(client, { address, index, value }) {
202
+ return await client.request({
203
+ method: `${client.mode}_setStorageAt`,
204
+ params: [
205
+ address,
206
+ typeof index === "number" ? _chunkQMLDI5JUjs.numberToHex.call(void 0, index) : index,
207
+ value
208
+ ]
209
+ });
210
+ }
211
+
212
+ // src/actions/test/snapshot.ts
213
+ async function snapshot(client) {
214
+ return await client.request({
215
+ method: "evm_snapshot"
216
+ });
217
+ }
218
+
219
+ // src/actions/test/stopImpersonatingAccount.ts
220
+ async function stopImpersonatingAccount(client, { address }) {
221
+ return await client.request({
222
+ method: `${client.mode}_stopImpersonatingAccount`,
223
+ params: [address]
224
+ });
225
+ }
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+ exports.dropTransaction = dropTransaction; exports.getAutomine = getAutomine; exports.getTxpoolContent = getTxpoolContent; exports.getTxpoolStatus = getTxpoolStatus; exports.impersonateAccount = impersonateAccount; exports.increaseTime = increaseTime; exports.inspectTxpool = inspectTxpool; exports.mine = mine; exports.removeBlockTimestampInterval = removeBlockTimestampInterval; exports.reset = reset; exports.revert = revert; exports.sendUnsignedTransaction = sendUnsignedTransaction; exports.setAutomine = setAutomine; exports.setBalance = setBalance; exports.setBlockGasLimit = setBlockGasLimit; exports.setBlockTimestampInterval = setBlockTimestampInterval; exports.setCode = setCode; exports.setCoinbase = setCoinbase; exports.setIntervalMining = setIntervalMining; exports.setLoggingEnabled = setLoggingEnabled; exports.setMinGasPrice = setMinGasPrice; exports.setNextBlockBaseFeePerGas = setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = setNextBlockTimestamp; exports.setNonce = setNonce; exports.setStorageAt = setStorageAt; exports.snapshot = snapshot; exports.stopImpersonatingAccount = stopImpersonatingAccount;
@@ -0,0 +1,152 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+ var _chunkQMLDI5JUjs = require('./chunk-QMLDI5JU.js');
12
+
13
+ // src/actions/wallet/addChain.ts
14
+ async function addChain(client, chain) {
15
+ const { id, name, nativeCurrency, rpcUrls, blockExplorers } = chain;
16
+ await client.request({
17
+ method: "wallet_addEthereumChain",
18
+ params: [
19
+ {
20
+ chainId: _chunkQMLDI5JUjs.numberToHex.call(void 0, id),
21
+ chainName: name,
22
+ nativeCurrency,
23
+ rpcUrls: rpcUrls.default.http,
24
+ blockExplorerUrls: blockExplorers ? Object.values(blockExplorers).map(({ url }) => url) : void 0
25
+ }
26
+ ]
27
+ });
28
+ }
29
+
30
+ // src/actions/wallet/getAccounts.ts
31
+ async function getAccounts(client) {
32
+ const addresses = await client.request({ method: "eth_accounts" });
33
+ return addresses.map((address) => _chunkQMLDI5JUjs.checksumAddress.call(void 0, address));
34
+ }
35
+
36
+ // src/actions/wallet/getPermissions.ts
37
+ async function getPermissions(client) {
38
+ const permissions = await client.request({ method: "wallet_getPermissions" });
39
+ return permissions;
40
+ }
41
+
42
+ // src/actions/wallet/requestAccounts.ts
43
+ async function requestAccounts(client) {
44
+ const addresses = await client.request({ method: "eth_requestAccounts" });
45
+ return addresses.map((address) => _chunkQMLDI5JUjs.getAddress.call(void 0, address));
46
+ }
47
+
48
+ // src/actions/wallet/requestPermissions.ts
49
+ async function requestPermissions(client, permissions) {
50
+ return client.request({
51
+ method: "wallet_requestPermissions",
52
+ params: [permissions]
53
+ });
54
+ }
55
+
56
+ // src/actions/wallet/sendTransaction.ts
57
+ async function sendTransaction(client, {
58
+ chain,
59
+ from,
60
+ accessList,
61
+ data,
62
+ gas,
63
+ gasPrice,
64
+ maxFeePerGas,
65
+ maxPriorityFeePerGas,
66
+ nonce,
67
+ to,
68
+ value,
69
+ ...rest
70
+ }) {
71
+ if (maxFeePerGas !== void 0 && maxPriorityFeePerGas !== void 0 && maxFeePerGas < maxPriorityFeePerGas)
72
+ throw new (0, _chunkQMLDI5JUjs.InvalidGasArgumentsError)();
73
+ const formatter = _optionalChain([chain, 'optionalAccess', _ => _.formatters, 'optionalAccess', _2 => _2.transactionRequest]);
74
+ const request_ = _chunkQMLDI5JUjs.format.call(void 0,
75
+ {
76
+ from,
77
+ accessList,
78
+ data,
79
+ gas,
80
+ gasPrice,
81
+ maxFeePerGas,
82
+ maxPriorityFeePerGas,
83
+ nonce,
84
+ to,
85
+ value,
86
+ ..._chunkQMLDI5JUjs.extract.call(void 0, rest, { formatter })
87
+ },
88
+ {
89
+ formatter: formatter || _chunkQMLDI5JUjs.formatTransactionRequest
90
+ }
91
+ );
92
+ const hash = await client.request({
93
+ method: "eth_sendTransaction",
94
+ params: [request_]
95
+ });
96
+ return hash;
97
+ }
98
+
99
+ // src/actions/wallet/signMessage.ts
100
+ async function signMessage(client, { from, data: data_ }) {
101
+ let data;
102
+ if (typeof data_ === "string") {
103
+ if (!data_.startsWith("0x"))
104
+ throw new (0, _chunkQMLDI5JUjs.BaseError)(
105
+ `data ("${data_}") must be a hex value. Encode it first to a hex with the \`encodeHex\` util.`,
106
+ {
107
+ docsPath: "/TODO"
108
+ }
109
+ );
110
+ data = data_;
111
+ } else {
112
+ data = _chunkQMLDI5JUjs.encodeHex.call(void 0, data_);
113
+ }
114
+ const signed = await client.request({
115
+ method: "personal_sign",
116
+ params: [data, from]
117
+ });
118
+ return signed;
119
+ }
120
+
121
+ // src/actions/wallet/switchChain.ts
122
+ async function switchChain(client, { id }) {
123
+ await client.request({
124
+ method: "wallet_switchEthereumChain",
125
+ params: [
126
+ {
127
+ chainId: _chunkQMLDI5JUjs.numberToHex.call(void 0, id)
128
+ }
129
+ ]
130
+ });
131
+ }
132
+
133
+ // src/actions/wallet/watchAsset.ts
134
+ async function watchAsset(client, params) {
135
+ const added = await client.request({
136
+ method: "wallet_watchAsset",
137
+ params: [params]
138
+ });
139
+ return added;
140
+ }
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ exports.addChain = addChain; exports.getAccounts = getAccounts; exports.getPermissions = getPermissions; exports.requestAccounts = requestAccounts; exports.requestPermissions = requestPermissions; exports.sendTransaction = sendTransaction; exports.signMessage = signMessage; exports.switchChain = switchChain; exports.watchAsset = watchAsset;
@@ -0,0 +1,255 @@
1
+ import {
2
+ formatTransactionRequest,
3
+ hexToNumber,
4
+ numberToHex
5
+ } from "./chunk-2HENAFQN.mjs";
6
+
7
+ // src/actions/test/dropTransaction.ts
8
+ async function dropTransaction(client, { hash }) {
9
+ return await client.request({
10
+ method: `${client.mode}_dropTransaction`,
11
+ params: [hash]
12
+ });
13
+ }
14
+
15
+ // src/actions/test/getAutomine.ts
16
+ async function getAutomine(client) {
17
+ return await client.request({
18
+ method: `${client.mode}_getAutomine`
19
+ });
20
+ }
21
+
22
+ // src/actions/test/getTxpoolContent.ts
23
+ async function getTxpoolContent(client) {
24
+ return await client.request({
25
+ method: "txpool_content"
26
+ });
27
+ }
28
+
29
+ // src/actions/test/getTxpoolStatus.ts
30
+ async function getTxpoolStatus(client) {
31
+ const { pending, queued } = await client.request({
32
+ method: "txpool_status"
33
+ });
34
+ return {
35
+ pending: hexToNumber(pending),
36
+ queued: hexToNumber(queued)
37
+ };
38
+ }
39
+
40
+ // src/actions/test/impersonateAccount.ts
41
+ async function impersonateAccount(client, { address }) {
42
+ return await client.request({
43
+ method: `${client.mode}_impersonateAccount`,
44
+ params: [address]
45
+ });
46
+ }
47
+
48
+ // src/actions/test/increaseTime.ts
49
+ async function increaseTime(client, { seconds }) {
50
+ return await client.request({
51
+ method: "evm_increaseTime",
52
+ params: [numberToHex(seconds)]
53
+ });
54
+ }
55
+
56
+ // src/actions/test/inspectTxpool.ts
57
+ async function inspectTxpool(client) {
58
+ return await client.request({
59
+ method: "txpool_inspect"
60
+ });
61
+ }
62
+
63
+ // src/actions/test/mine.ts
64
+ async function mine(client, { blocks, interval }) {
65
+ return await client.request({
66
+ method: `${client.mode}_mine`,
67
+ params: [numberToHex(blocks), numberToHex(interval || 0)]
68
+ });
69
+ }
70
+
71
+ // src/actions/test/removeBlockTimestampInterval.ts
72
+ async function removeBlockTimestampInterval(client) {
73
+ return await client.request({
74
+ method: `${client.mode}_removeBlockTimestampInterval`
75
+ });
76
+ }
77
+
78
+ // src/actions/test/reset.ts
79
+ async function reset(client, { blockNumber, jsonRpcUrl } = {}) {
80
+ return await client.request({
81
+ method: `${client.mode}_reset`,
82
+ params: [{ forking: { blockNumber: Number(blockNumber), jsonRpcUrl } }]
83
+ });
84
+ }
85
+
86
+ // src/actions/test/revert.ts
87
+ async function revert(client, { id }) {
88
+ return await client.request({
89
+ method: "evm_revert",
90
+ params: [id]
91
+ });
92
+ }
93
+
94
+ // src/actions/test/sendUnsignedTransaction.ts
95
+ async function sendUnsignedTransaction(client, request) {
96
+ const request_ = formatTransactionRequest(request);
97
+ const hash = await client.request({
98
+ method: "eth_sendUnsignedTransaction",
99
+ params: [request_]
100
+ });
101
+ return hash;
102
+ }
103
+
104
+ // src/actions/test/setAutomine.ts
105
+ async function setAutomine(client, enabled) {
106
+ return await client.request({
107
+ method: "evm_setAutomine",
108
+ params: [enabled]
109
+ });
110
+ }
111
+
112
+ // src/actions/test/setBalance.ts
113
+ async function setBalance(client, { address, value }) {
114
+ return await client.request({
115
+ method: `${client.mode}_setBalance`,
116
+ params: [address, numberToHex(value)]
117
+ });
118
+ }
119
+
120
+ // src/actions/test/setBlockGasLimit.ts
121
+ async function setBlockGasLimit(client, { gasLimit }) {
122
+ return await client.request({
123
+ method: "evm_setBlockGasLimit",
124
+ params: [numberToHex(gasLimit)]
125
+ });
126
+ }
127
+
128
+ // src/actions/test/setBlockTimestampInterval.ts
129
+ async function setBlockTimestampInterval(client, { interval }) {
130
+ return await client.request({
131
+ method: `${client.mode}_setBlockTimestampInterval`,
132
+ params: [interval]
133
+ });
134
+ }
135
+
136
+ // src/actions/test/setCode.ts
137
+ async function setCode(client, { address, bytecode }) {
138
+ return await client.request({
139
+ method: `${client.mode}_setCode`,
140
+ params: [address, bytecode]
141
+ });
142
+ }
143
+
144
+ // src/actions/test/setCoinbase.ts
145
+ async function setCoinbase(client, { address }) {
146
+ return await client.request({
147
+ method: `${client.mode}_setCoinbase`,
148
+ params: [address]
149
+ });
150
+ }
151
+
152
+ // src/actions/test/setIntervalMining.ts
153
+ async function setIntervalMining(client, { interval }) {
154
+ return await client.request({
155
+ method: "evm_setIntervalMining",
156
+ params: [interval]
157
+ });
158
+ }
159
+
160
+ // src/actions/test/setLoggingEnabled.ts
161
+ async function setLoggingEnabled(client, enabled) {
162
+ return await client.request({
163
+ method: `${client.mode}_setLoggingEnabled`,
164
+ params: [enabled]
165
+ });
166
+ }
167
+
168
+ // src/actions/test/setMinGasPrice.ts
169
+ async function setMinGasPrice(client, { gasPrice }) {
170
+ return await client.request({
171
+ method: `${client.mode}_setMinGasPrice`,
172
+ params: [numberToHex(gasPrice)]
173
+ });
174
+ }
175
+
176
+ // src/actions/test/setNextBlockBaseFeePerGas.ts
177
+ async function setNextBlockBaseFeePerGas(client, { baseFeePerGas }) {
178
+ return await client.request({
179
+ method: `${client.mode}_setNextBlockBaseFeePerGas`,
180
+ params: [numberToHex(baseFeePerGas)]
181
+ });
182
+ }
183
+
184
+ // src/actions/test/setNextBlockTimestamp.ts
185
+ async function setNextBlockTimestamp(client, { timestamp }) {
186
+ return await client.request({
187
+ method: "evm_setNextBlockTimestamp",
188
+ params: [numberToHex(timestamp)]
189
+ });
190
+ }
191
+
192
+ // src/actions/test/setNonce.ts
193
+ async function setNonce(client, { address, nonce }) {
194
+ return await client.request({
195
+ method: `${client.mode}_setNonce`,
196
+ params: [address, numberToHex(nonce)]
197
+ });
198
+ }
199
+
200
+ // src/actions/test/setStorageAt.ts
201
+ async function setStorageAt(client, { address, index, value }) {
202
+ return await client.request({
203
+ method: `${client.mode}_setStorageAt`,
204
+ params: [
205
+ address,
206
+ typeof index === "number" ? numberToHex(index) : index,
207
+ value
208
+ ]
209
+ });
210
+ }
211
+
212
+ // src/actions/test/snapshot.ts
213
+ async function snapshot(client) {
214
+ return await client.request({
215
+ method: "evm_snapshot"
216
+ });
217
+ }
218
+
219
+ // src/actions/test/stopImpersonatingAccount.ts
220
+ async function stopImpersonatingAccount(client, { address }) {
221
+ return await client.request({
222
+ method: `${client.mode}_stopImpersonatingAccount`,
223
+ params: [address]
224
+ });
225
+ }
226
+
227
+ export {
228
+ dropTransaction,
229
+ getAutomine,
230
+ getTxpoolContent,
231
+ getTxpoolStatus,
232
+ impersonateAccount,
233
+ increaseTime,
234
+ inspectTxpool,
235
+ mine,
236
+ removeBlockTimestampInterval,
237
+ reset,
238
+ revert,
239
+ sendUnsignedTransaction,
240
+ setAutomine,
241
+ setBalance,
242
+ setBlockGasLimit,
243
+ setBlockTimestampInterval,
244
+ setCode,
245
+ setCoinbase,
246
+ setIntervalMining,
247
+ setLoggingEnabled,
248
+ setMinGasPrice,
249
+ setNextBlockBaseFeePerGas,
250
+ setNextBlockTimestamp,
251
+ setNonce,
252
+ setStorageAt,
253
+ snapshot,
254
+ stopImpersonatingAccount
255
+ };