viem 0.0.1-alpha.22 → 0.0.1-alpha.24
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/dist/{chain-4b39613a.d.ts → chain-afa13f5a.d.ts} +1 -1
- package/dist/{chain-aa4898d0.d.ts → chain-e33d019b.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-QN2NCTEN.mjs → chunk-3ARWEJ3G.mjs} +2 -2
- package/dist/{chunk-QN2NCTEN.mjs.map → chunk-3ARWEJ3G.mjs.map} +0 -0
- package/dist/{chunk-V5U5S7PQ.js → chunk-4D5XG6XB.js} +5 -3
- package/dist/{chunk-V5U5S7PQ.js.map → chunk-4D5XG6XB.js.map} +0 -0
- package/dist/{chunk-JMFNAGCD.mjs → chunk-6QTEW2BE.mjs} +2 -2
- package/dist/{chunk-JMFNAGCD.mjs.map → chunk-6QTEW2BE.mjs.map} +0 -0
- package/dist/{chunk-MVD4Y3AE.js → chunk-A2HXAZXC.js} +271 -66
- package/dist/chunk-A2HXAZXC.js.map +1 -0
- package/dist/{chunk-OZIBQJYR.mjs → chunk-KRPS5CIB.mjs} +2 -2
- package/dist/{chunk-OZIBQJYR.mjs.map → chunk-KRPS5CIB.mjs.map} +0 -0
- package/dist/{chunk-WWJ5YPTJ.mjs → chunk-LQVMDX5I.mjs} +4 -2
- package/dist/{chunk-WWJ5YPTJ.mjs.map → chunk-LQVMDX5I.mjs.map} +0 -0
- package/dist/{chunk-QA3IE5DU.js → chunk-N3IOPT3R.js} +14 -14
- package/dist/{chunk-QA3IE5DU.js.map → chunk-N3IOPT3R.js.map} +0 -0
- package/dist/{chunk-ZXXEENRD.mjs → chunk-YQUC52RL.mjs} +208 -3
- package/dist/chunk-YQUC52RL.mjs.map +1 -0
- package/dist/{chunk-PMPJGAHY.js → chunk-ZSTVHQ6J.js} +13 -13
- package/dist/{chunk-PMPJGAHY.js.map → chunk-ZSTVHQ6J.js.map} +0 -0
- package/dist/{chunk-S77NLWHO.js → chunk-ZYSXBTBB.js} +13 -13
- package/dist/{chunk-S77NLWHO.js.map → chunk-ZYSXBTBB.js.map} +0 -0
- package/dist/clients/index.d.ts +7 -7
- package/dist/clients/index.js +3 -3
- package/dist/clients/index.mjs +2 -2
- package/dist/{contract-74f34ac9.d.ts → contract-70f4ddbe.d.ts} +2 -2
- package/dist/{createClient-55a04188.d.ts → createClient-60e3ab98.d.ts} +2 -2
- package/dist/{createPublicClient-3b27b282.d.ts → createPublicClient-d3d12dc3.d.ts} +3 -3
- package/dist/{createTestClient-93f9eac6.d.ts → createTestClient-5f4532c4.d.ts} +3 -3
- package/dist/{createWalletClient-c10df94d.d.ts → createWalletClient-9ec3df4f.d.ts} +3 -3
- package/dist/{eip1193-4c24765a.d.ts → eip1193-9317a312.d.ts} +1 -1
- package/dist/ens.js +2 -2
- package/dist/ens.mjs +1 -1
- package/dist/index.d.ts +111 -20
- package/dist/index.js +12 -6
- package/dist/index.mjs +11 -5
- package/dist/{parseGwei-b323fb0a.d.ts → parseGwei-492ab7dd.d.ts} +2 -2
- package/dist/public.d.ts +9 -9
- package/dist/public.js +4 -4
- package/dist/public.mjs +3 -3
- package/dist/{sendTransaction-f17a2389.d.ts → sendTransaction-54a0d509.d.ts} +3 -3
- package/dist/{stopImpersonatingAccount-afb26486.d.ts → stopImpersonatingAccount-c1a4b7e5.d.ts} +2 -2
- package/dist/test.d.ts +5 -5
- package/dist/test.js +3 -3
- package/dist/test.mjs +2 -2
- package/dist/{transactionRequest-93e9f001.d.ts → transactionRequest-bdf57f7d.d.ts} +1 -1
- package/dist/utils/index.d.ts +8 -8
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet.d.ts +7 -7
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/{watchAsset-efd3dd05.d.ts → watchAsset-d59d6e35.d.ts} +3 -3
- package/dist/{watchPendingTransactions-a8688b26.d.ts → watchPendingTransactions-ea21b31d.d.ts} +6 -6
- package/dist/{webSocket-d2e7bd0e.d.ts → webSocket-775b4037.d.ts} +2 -2
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/src/_test/constants.ts +4 -3
- package/src/_test/index.ts +1 -1
- package/src/actions/index.test.ts +3 -0
- package/src/actions/index.ts +8 -0
- package/src/actions/public/getFilterChanges.test.ts +9 -9
- package/src/actions/public/getFilterLogs.test.ts +7 -7
- package/src/actions/public/getLogs.test.ts +7 -7
- package/src/actions/public/index.test.ts +1 -0
- package/src/actions/public/index.ts +3 -0
- package/src/actions/public/multicall.test.ts +20 -20
- package/src/actions/public/readContract.test.ts +2 -2
- package/src/actions/public/watchContractEvent.test.ts +32 -32
- package/src/actions/public/watchEvent.test.ts +11 -11
- package/src/actions/test/impersonateAccount.test.ts +4 -6
- package/src/actions/test/sendUnsignedTransaction.test.ts +2 -2
- package/src/actions/test/stopImpersonatingAccount.test.ts +5 -7
- package/src/index.test.ts +3 -0
- package/src/index.ts +8 -0
- package/dist/chunk-MVD4Y3AE.js.map +0 -1
- package/dist/chunk-ZXXEENRD.mjs.map +0 -1
package/dist/utils/index.mjs
CHANGED
package/dist/wallet.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-
|
2
|
-
export { F as FormattedTransactionRequest, S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-
|
3
|
-
import './chain-
|
1
|
+
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-d59d6e35.js';
|
2
|
+
export { F as FormattedTransactionRequest, S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-54a0d509.js';
|
3
|
+
import './chain-afa13f5a.js';
|
4
4
|
import '@wagmi/chains';
|
5
|
-
import './createWalletClient-
|
6
|
-
import './eip1193-
|
7
|
-
import './createClient-
|
8
|
-
import './transactionRequest-
|
5
|
+
import './createWalletClient-9ec3df4f.js';
|
6
|
+
import './eip1193-9317a312.js';
|
7
|
+
import './createClient-60e3ab98.js';
|
8
|
+
import './transactionRequest-bdf57f7d.js';
|
package/dist/wallet.js
CHANGED
@@ -8,8 +8,8 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
var
|
12
|
-
require('./chunk-
|
11
|
+
var _chunkZYSXBTBBjs = require('./chunk-ZYSXBTBB.js');
|
12
|
+
require('./chunk-4D5XG6XB.js');
|
13
13
|
|
14
14
|
|
15
15
|
|
@@ -20,5 +20,5 @@ require('./chunk-V5U5S7PQ.js');
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
exports.addChain =
|
23
|
+
exports.addChain = _chunkZYSXBTBBjs.addChain; exports.getAccounts = _chunkZYSXBTBBjs.getAccounts; exports.getPermissions = _chunkZYSXBTBBjs.getPermissions; exports.requestAccounts = _chunkZYSXBTBBjs.requestAccounts; exports.requestPermissions = _chunkZYSXBTBBjs.requestPermissions; exports.sendTransaction = _chunkZYSXBTBBjs.sendTransaction; exports.signMessage = _chunkZYSXBTBBjs.signMessage; exports.switchChain = _chunkZYSXBTBBjs.switchChain; exports.watchAsset = _chunkZYSXBTBBjs.watchAsset;
|
24
24
|
//# sourceMappingURL=wallet.js.map
|
package/dist/wallet.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as Chain, A as Address, H as Hex, B as ByteArray } from './chain-
|
2
|
-
import { W as WalletClient } from './createWalletClient-
|
3
|
-
import { a as WalletPermission, b as WatchAssetParams } from './eip1193-
|
1
|
+
import { C as Chain, A as Address, H as Hex, B as ByteArray } from './chain-afa13f5a.js';
|
2
|
+
import { W as WalletClient } from './createWalletClient-9ec3df4f.js';
|
3
|
+
import { a as WalletPermission, b as WatchAssetParams } from './eip1193-9317a312.js';
|
4
4
|
|
5
5
|
declare function addChain(client: WalletClient, chain: Chain): Promise<void>;
|
6
6
|
|
package/dist/{watchPendingTransactions-a8688b26.d.ts → watchPendingTransactions-ea21b31d.d.ts}
RENAMED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { Abi, Narrow } from 'abitype';
|
2
|
-
import { H as Hex, C as Chain, A as Address, b as BlockTag, K as Formatter, M as MergeIntersectionProperties, N as Formatted, s as TransactionRequest, O as EstimateGasParameters, a as Hash, F as FeeHistory, L as Log, G as FormattedTransaction, P as TransactionFormatter, Q as ExtractFormatter, p as RpcTransactionReceipt, T as TransactionReceipt, S as TransactionType, x as Transaction } from './chain-
|
3
|
-
import { G as GetValue, C as ContractConfig,
|
4
|
-
import { P as PublicClient } from './createPublicClient-
|
5
|
-
import { W as WalletClient } from './createWalletClient-
|
6
|
-
import { S as SendTransactionArgs, a as SendTransactionResponse } from './sendTransaction-
|
7
|
-
import { T as TransactionRequestFormatter } from './transactionRequest-
|
2
|
+
import { H as Hex, C as Chain, A as Address, b as BlockTag, K as Formatter, M as MergeIntersectionProperties, N as Formatted, s as TransactionRequest, O as EstimateGasParameters, a as Hash, F as FeeHistory, L as Log, G as FormattedTransaction, P as TransactionFormatter, Q as ExtractFormatter, p as RpcTransactionReceipt, T as TransactionReceipt, S as TransactionType, x as Transaction } from './chain-afa13f5a.js';
|
3
|
+
import { G as GetValue, C as ContractConfig, E as ExtractResultFromAbi, e as ExtractConstructorArgsFromAbi, F as FormattedBlock, B as BlockFormatter, g as FormattedTransactionReceipt, T as TransactionReceiptFormatter } from './contract-70f4ddbe.js';
|
4
|
+
import { P as PublicClient } from './createPublicClient-d3d12dc3.js';
|
5
|
+
import { W as WalletClient } from './createWalletClient-9ec3df4f.js';
|
6
|
+
import { S as SendTransactionArgs, a as SendTransactionResponse } from './sendTransaction-54a0d509.js';
|
7
|
+
import { T as TransactionRequestFormatter } from './transactionRequest-bdf57f7d.js';
|
8
8
|
|
9
9
|
type FilterType = 'transaction' | 'block' | 'event';
|
10
10
|
type Filter<TFilterType extends FilterType = 'event'> = {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { b as TransportConfig, T as Transport, B as BaseRpcRequests } from './createClient-
|
2
|
-
import { a as Hash } from './chain-
|
1
|
+
import { b as TransportConfig, T as Transport, B as BaseRpcRequests } from './createClient-60e3ab98.js';
|
2
|
+
import { a as Hash } from './chain-afa13f5a.js';
|
3
3
|
import { R as RpcResponse } from './rpc-26932bae.js';
|
4
4
|
|
5
5
|
type EthereumProvider = {
|
package/dist/window.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { R as Requests, E as Events } from './eip1193-
|
2
|
-
import './chain-
|
1
|
+
import { R as Requests, E as Events } from './eip1193-9317a312.js';
|
2
|
+
import './chain-afa13f5a.js';
|
3
3
|
import '@wagmi/chains';
|
4
4
|
|
5
5
|
type WindowProvider = Requests & Events;
|
package/package.json
CHANGED
package/src/_test/constants.ts
CHANGED
@@ -43,6 +43,10 @@ export const accounts = [
|
|
43
43
|
},
|
44
44
|
] as const
|
45
45
|
|
46
|
+
export const address = {
|
47
|
+
vitalik: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
|
48
|
+
} as const
|
49
|
+
|
46
50
|
export const initialBlockNumber = BigInt(
|
47
51
|
Number(process.env.VITE_ANVIL_BLOCK_NUMBER),
|
48
52
|
)
|
@@ -55,6 +59,3 @@ export const transfer1Data = (address: string): Hex =>
|
|
55
59
|
`0xa9059cbb000000000000000000000000${address
|
56
60
|
.slice(2)
|
57
61
|
.toLowerCase()}0000000000000000000000000000000000000000000000000000000000000001`
|
58
|
-
|
59
|
-
// vitalik.eth
|
60
|
-
export const vitalikAddress = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
|
package/src/_test/index.ts
CHANGED
@@ -40,6 +40,7 @@ test('exports actions', () => {
|
|
40
40
|
"increaseTime": [Function],
|
41
41
|
"inspectTxpool": [Function],
|
42
42
|
"mine": [Function],
|
43
|
+
"multicall": [Function],
|
43
44
|
"readContract": [Function],
|
44
45
|
"removeBlockTimestampInterval": [Function],
|
45
46
|
"requestAccounts": [Function],
|
@@ -71,6 +72,8 @@ test('exports actions', () => {
|
|
71
72
|
"watchAsset": [Function],
|
72
73
|
"watchBlockNumber": [Function],
|
73
74
|
"watchBlocks": [Function],
|
75
|
+
"watchContractEvent": [Function],
|
76
|
+
"watchEvent": [Function],
|
74
77
|
"watchPendingTransactions": [Function],
|
75
78
|
"writeContract": [Function],
|
76
79
|
}
|
package/src/actions/index.ts
CHANGED
@@ -23,12 +23,15 @@ export {
|
|
23
23
|
getTransactionConfirmations,
|
24
24
|
getTransactionCount,
|
25
25
|
getTransactionReceipt,
|
26
|
+
multicall,
|
26
27
|
readContract,
|
27
28
|
simulateContract,
|
28
29
|
uninstallFilter,
|
29
30
|
waitForTransactionReceipt,
|
30
31
|
watchBlockNumber,
|
31
32
|
watchBlocks,
|
33
|
+
watchContractEvent,
|
34
|
+
watchEvent,
|
32
35
|
watchPendingTransactions,
|
33
36
|
} from './public'
|
34
37
|
export type {
|
@@ -73,10 +76,13 @@ export type {
|
|
73
76
|
GetTransactionReceiptArgs,
|
74
77
|
GetTransactionReceiptResponse,
|
75
78
|
GetTransactionResponse,
|
79
|
+
MulticallArgs,
|
76
80
|
OnBlock,
|
77
81
|
OnBlockNumber,
|
78
82
|
OnBlockNumberResponse,
|
79
83
|
OnBlockResponse,
|
84
|
+
OnLogs,
|
85
|
+
OnLogsResponse,
|
80
86
|
OnTransactions,
|
81
87
|
OnTransactionsResponse,
|
82
88
|
ReadContractArgs,
|
@@ -91,6 +97,8 @@ export type {
|
|
91
97
|
WaitForTransactionReceiptResponse,
|
92
98
|
WatchBlockNumberArgs,
|
93
99
|
WatchBlocksArgs,
|
100
|
+
WatchContractEventArgs,
|
101
|
+
WatchEventArgs,
|
94
102
|
WatchPendingTransactionsArgs,
|
95
103
|
} from './public'
|
96
104
|
|
@@ -2,11 +2,11 @@ import { afterAll, assertType, beforeAll, describe, expect, test } from 'vitest'
|
|
2
2
|
|
3
3
|
import {
|
4
4
|
accounts,
|
5
|
+
address,
|
5
6
|
initialBlockNumber,
|
6
7
|
publicClient,
|
7
8
|
testClient,
|
8
9
|
transfer1Data,
|
9
|
-
vitalikAddress,
|
10
10
|
walletClient,
|
11
11
|
usdcContractConfig,
|
12
12
|
} from '../../_test'
|
@@ -28,14 +28,14 @@ import { getFilterChanges } from './getFilterChanges'
|
|
28
28
|
beforeAll(async () => {
|
29
29
|
await setIntervalMining(testClient, { interval: 0 })
|
30
30
|
await impersonateAccount(testClient, {
|
31
|
-
address:
|
31
|
+
address: address.vitalik,
|
32
32
|
})
|
33
33
|
})
|
34
34
|
|
35
35
|
afterAll(async () => {
|
36
36
|
await setIntervalMining(testClient, { interval: 1 })
|
37
37
|
await stopImpersonatingAccount(testClient, {
|
38
|
-
address:
|
38
|
+
address: address.vitalik,
|
39
39
|
})
|
40
40
|
})
|
41
41
|
|
@@ -102,12 +102,12 @@ describe('events', () => {
|
|
102
102
|
const filter = await createEventFilter(publicClient)
|
103
103
|
|
104
104
|
await sendTransaction(walletClient, {
|
105
|
-
from:
|
105
|
+
from: address.vitalik,
|
106
106
|
to: usdcContractConfig.address,
|
107
107
|
data: transfer1Data(accounts[0].address),
|
108
108
|
})
|
109
109
|
await sendTransaction(walletClient, {
|
110
|
-
from:
|
110
|
+
from: address.vitalik,
|
111
111
|
to: usdcContractConfig.address,
|
112
112
|
data: transfer1Data(accounts[1].address),
|
113
113
|
})
|
@@ -122,7 +122,7 @@ describe('events', () => {
|
|
122
122
|
expect(logs.length).toBe(0)
|
123
123
|
|
124
124
|
await sendTransaction(walletClient, {
|
125
|
-
from:
|
125
|
+
from: address.vitalik,
|
126
126
|
to: usdcContractConfig.address,
|
127
127
|
data: transfer1Data(accounts[2].address),
|
128
128
|
})
|
@@ -139,12 +139,12 @@ describe('events', () => {
|
|
139
139
|
})
|
140
140
|
|
141
141
|
await sendTransaction(walletClient, {
|
142
|
-
from:
|
142
|
+
from: address.vitalik,
|
143
143
|
to: usdcContractConfig.address,
|
144
144
|
data: transfer1Data(accounts[0].address),
|
145
145
|
})
|
146
146
|
await sendTransaction(walletClient, {
|
147
|
-
from:
|
147
|
+
from: address.vitalik,
|
148
148
|
to: usdcContractConfig.address,
|
149
149
|
data: transfer1Data(accounts[1].address),
|
150
150
|
})
|
@@ -159,7 +159,7 @@ describe('events', () => {
|
|
159
159
|
expect(logs.length).toBe(0)
|
160
160
|
|
161
161
|
await sendTransaction(walletClient, {
|
162
|
-
from:
|
162
|
+
from: address.vitalik,
|
163
163
|
to: usdcContractConfig.address,
|
164
164
|
data: transfer1Data(accounts[2].address),
|
165
165
|
})
|
@@ -2,12 +2,12 @@ import { afterAll, assertType, beforeAll, describe, expect, test } from 'vitest'
|
|
2
2
|
|
3
3
|
import {
|
4
4
|
accounts,
|
5
|
+
address,
|
5
6
|
initialBlockNumber,
|
6
7
|
publicClient,
|
7
8
|
testClient,
|
8
9
|
transfer1Data,
|
9
10
|
usdcContractConfig,
|
10
|
-
vitalikAddress,
|
11
11
|
walletClient,
|
12
12
|
} from '../../_test'
|
13
13
|
|
@@ -25,14 +25,14 @@ import { getFilterLogs } from './getFilterLogs'
|
|
25
25
|
beforeAll(async () => {
|
26
26
|
await setIntervalMining(testClient, { interval: 0 })
|
27
27
|
await impersonateAccount(testClient, {
|
28
|
-
address:
|
28
|
+
address: address.vitalik,
|
29
29
|
})
|
30
30
|
})
|
31
31
|
|
32
32
|
afterAll(async () => {
|
33
33
|
await setIntervalMining(testClient, { interval: 1 })
|
34
34
|
await stopImpersonatingAccount(testClient, {
|
35
|
-
address:
|
35
|
+
address: address.vitalik,
|
36
36
|
})
|
37
37
|
})
|
38
38
|
|
@@ -48,12 +48,12 @@ describe('events', () => {
|
|
48
48
|
const filter = await createEventFilter(publicClient)
|
49
49
|
|
50
50
|
await sendTransaction(walletClient, {
|
51
|
-
from:
|
51
|
+
from: address.vitalik,
|
52
52
|
to: usdcContractConfig.address,
|
53
53
|
data: transfer1Data(accounts[0].address),
|
54
54
|
})
|
55
55
|
await sendTransaction(walletClient, {
|
56
|
-
from:
|
56
|
+
from: address.vitalik,
|
57
57
|
to: usdcContractConfig.address,
|
58
58
|
data: transfer1Data(accounts[1].address),
|
59
59
|
})
|
@@ -71,12 +71,12 @@ describe('events', () => {
|
|
71
71
|
})
|
72
72
|
|
73
73
|
await sendTransaction(walletClient, {
|
74
|
-
from:
|
74
|
+
from: address.vitalik,
|
75
75
|
to: usdcContractConfig.address,
|
76
76
|
data: transfer1Data(accounts[0].address),
|
77
77
|
})
|
78
78
|
await sendTransaction(walletClient, {
|
79
|
-
from:
|
79
|
+
from: address.vitalik,
|
80
80
|
to: usdcContractConfig.address,
|
81
81
|
data: transfer1Data(accounts[1].address),
|
82
82
|
})
|
@@ -2,11 +2,11 @@ import { afterAll, assertType, beforeAll, describe, expect, test } from 'vitest'
|
|
2
2
|
|
3
3
|
import {
|
4
4
|
accounts,
|
5
|
+
address,
|
5
6
|
initialBlockNumber,
|
6
7
|
publicClient,
|
7
8
|
testClient,
|
8
9
|
transfer1Data,
|
9
|
-
vitalikAddress,
|
10
10
|
usdcContractConfig,
|
11
11
|
walletClient,
|
12
12
|
} from '../../_test'
|
@@ -25,14 +25,14 @@ import { getBlock } from './getBlock'
|
|
25
25
|
beforeAll(async () => {
|
26
26
|
await setIntervalMining(testClient, { interval: 0 })
|
27
27
|
await impersonateAccount(testClient, {
|
28
|
-
address:
|
28
|
+
address: address.vitalik,
|
29
29
|
})
|
30
30
|
})
|
31
31
|
|
32
32
|
afterAll(async () => {
|
33
33
|
await setIntervalMining(testClient, { interval: 1 })
|
34
34
|
await stopImpersonatingAccount(testClient, {
|
35
|
-
address:
|
35
|
+
address: address.vitalik,
|
36
36
|
})
|
37
37
|
})
|
38
38
|
|
@@ -44,12 +44,12 @@ test('default', async () => {
|
|
44
44
|
describe('events', () => {
|
45
45
|
test('no args', async () => {
|
46
46
|
await sendTransaction(walletClient, {
|
47
|
-
from:
|
47
|
+
from: address.vitalik,
|
48
48
|
to: usdcContractConfig.address,
|
49
49
|
data: transfer1Data(accounts[0].address),
|
50
50
|
})
|
51
51
|
await sendTransaction(walletClient, {
|
52
|
-
from:
|
52
|
+
from: address.vitalik,
|
53
53
|
to: usdcContractConfig.address,
|
54
54
|
data: transfer1Data(accounts[1].address),
|
55
55
|
})
|
@@ -62,12 +62,12 @@ describe('events', () => {
|
|
62
62
|
|
63
63
|
test('args: event', async () => {
|
64
64
|
await sendTransaction(walletClient, {
|
65
|
-
from:
|
65
|
+
from: address.vitalik,
|
66
66
|
to: usdcContractConfig.address,
|
67
67
|
data: transfer1Data(accounts[0].address),
|
68
68
|
})
|
69
69
|
await sendTransaction(walletClient, {
|
70
|
-
from:
|
70
|
+
from: address.vitalik,
|
71
71
|
to: usdcContractConfig.address,
|
72
72
|
data: transfer1Data(accounts[1].address),
|
73
73
|
})
|
@@ -29,6 +29,7 @@ test('exports actions', () => {
|
|
29
29
|
"getTransactionConfirmations": [Function],
|
30
30
|
"getTransactionCount": [Function],
|
31
31
|
"getTransactionReceipt": [Function],
|
32
|
+
"multicall": [Function],
|
32
33
|
"readContract": [Function],
|
33
34
|
"simulateContract": [Function],
|
34
35
|
"uninstallFilter": [Function],
|
@@ -105,6 +105,9 @@ export type {
|
|
105
105
|
GetTransactionReceiptResponse,
|
106
106
|
} from './getTransactionReceipt'
|
107
107
|
|
108
|
+
export { multicall } from './multicall'
|
109
|
+
export type { MulticallArgs } from './multicall'
|
110
|
+
|
108
111
|
export { readContract } from './readContract'
|
109
112
|
export type {
|
110
113
|
ReadContractArgs,
|
@@ -7,10 +7,10 @@
|
|
7
7
|
import { describe, expect, test } from 'vitest'
|
8
8
|
import {
|
9
9
|
accounts,
|
10
|
+
address,
|
10
11
|
initialBlockNumber,
|
11
12
|
publicClient,
|
12
13
|
usdcContractConfig,
|
13
|
-
vitalikAddress,
|
14
14
|
} from '../../_test'
|
15
15
|
import { baycContractConfig, wagmiContractConfig } from '../../_test/abis'
|
16
16
|
|
@@ -28,7 +28,7 @@ test('default', async () => {
|
|
28
28
|
{
|
29
29
|
...usdcContractConfig,
|
30
30
|
functionName: 'balanceOf',
|
31
|
-
args: [
|
31
|
+
args: [address.vitalik],
|
32
32
|
},
|
33
33
|
{
|
34
34
|
...baycContractConfig,
|
@@ -70,7 +70,7 @@ describe('errors', async () => {
|
|
70
70
|
{
|
71
71
|
...usdcContractConfig,
|
72
72
|
functionName: 'balanceOf',
|
73
|
-
args: [
|
73
|
+
args: [address.vitalik],
|
74
74
|
},
|
75
75
|
{
|
76
76
|
...baycContractConfig,
|
@@ -117,12 +117,12 @@ describe('errors', async () => {
|
|
117
117
|
{
|
118
118
|
...usdcContractConfig,
|
119
119
|
functionName: 'balanceOf',
|
120
|
-
args: [
|
120
|
+
args: [address.vitalik, 1n],
|
121
121
|
},
|
122
122
|
{
|
123
123
|
...usdcContractConfig,
|
124
124
|
functionName: 'balanceOf',
|
125
|
-
args: [
|
125
|
+
args: [address.vitalik],
|
126
126
|
},
|
127
127
|
{
|
128
128
|
...baycContractConfig,
|
@@ -171,12 +171,12 @@ describe('errors', async () => {
|
|
171
171
|
...usdcContractConfig,
|
172
172
|
address: '0x0000000000000000000000000000000000000000',
|
173
173
|
functionName: 'balanceOf',
|
174
|
-
args: [
|
174
|
+
args: [address.vitalik],
|
175
175
|
},
|
176
176
|
{
|
177
177
|
...usdcContractConfig,
|
178
178
|
functionName: 'balanceOf',
|
179
|
-
args: [
|
179
|
+
args: [address.vitalik],
|
180
180
|
},
|
181
181
|
{
|
182
182
|
...baycContractConfig,
|
@@ -224,17 +224,17 @@ describe('errors', async () => {
|
|
224
224
|
{
|
225
225
|
...usdcContractConfig,
|
226
226
|
functionName: 'balanceOf',
|
227
|
-
args: [
|
227
|
+
args: [address.vitalik],
|
228
228
|
},
|
229
229
|
{
|
230
230
|
...usdcContractConfig,
|
231
231
|
functionName: 'balanceOf',
|
232
|
-
args: [
|
232
|
+
args: [address.vitalik],
|
233
233
|
},
|
234
234
|
{
|
235
235
|
...wagmiContractConfig,
|
236
236
|
functionName: 'transferFrom',
|
237
|
-
args: [
|
237
|
+
args: [address.vitalik, accounts[0].address, 1n],
|
238
238
|
},
|
239
239
|
{
|
240
240
|
...baycContractConfig,
|
@@ -243,7 +243,7 @@ describe('errors', async () => {
|
|
243
243
|
{
|
244
244
|
...baycContractConfig,
|
245
245
|
functionName: 'tokenOfOwnerByIndex',
|
246
|
-
args: [
|
246
|
+
args: [address.vitalik, 1n],
|
247
247
|
},
|
248
248
|
] as const,
|
249
249
|
multicallAddress: '0xca11bde05977b3631167028862be2a173976ca11',
|
@@ -307,7 +307,7 @@ describe('errors', async () => {
|
|
307
307
|
{
|
308
308
|
...usdcContractConfig,
|
309
309
|
functionName: 'balanceOf',
|
310
|
-
args: [
|
310
|
+
args: [address.vitalik],
|
311
311
|
},
|
312
312
|
{
|
313
313
|
...baycContractConfig,
|
@@ -336,12 +336,12 @@ describe('errors', async () => {
|
|
336
336
|
{
|
337
337
|
...usdcContractConfig,
|
338
338
|
functionName: 'balanceOf',
|
339
|
-
args: [
|
339
|
+
args: [address.vitalik, 1n],
|
340
340
|
},
|
341
341
|
{
|
342
342
|
...usdcContractConfig,
|
343
343
|
functionName: 'balanceOf',
|
344
|
-
args: [
|
344
|
+
args: [address.vitalik],
|
345
345
|
},
|
346
346
|
{
|
347
347
|
...baycContractConfig,
|
@@ -373,12 +373,12 @@ describe('errors', async () => {
|
|
373
373
|
...usdcContractConfig,
|
374
374
|
address: '0x0000000000000000000000000000000000000000',
|
375
375
|
functionName: 'balanceOf',
|
376
|
-
args: [
|
376
|
+
args: [address.vitalik],
|
377
377
|
},
|
378
378
|
{
|
379
379
|
...usdcContractConfig,
|
380
380
|
functionName: 'balanceOf',
|
381
|
-
args: [
|
381
|
+
args: [address.vitalik],
|
382
382
|
},
|
383
383
|
{
|
384
384
|
...baycContractConfig,
|
@@ -412,17 +412,17 @@ describe('errors', async () => {
|
|
412
412
|
{
|
413
413
|
...usdcContractConfig,
|
414
414
|
functionName: 'balanceOf',
|
415
|
-
args: [
|
415
|
+
args: [address.vitalik],
|
416
416
|
},
|
417
417
|
{
|
418
418
|
...usdcContractConfig,
|
419
419
|
functionName: 'balanceOf',
|
420
|
-
args: [
|
420
|
+
args: [address.vitalik],
|
421
421
|
},
|
422
422
|
{
|
423
423
|
...wagmiContractConfig,
|
424
424
|
functionName: 'transferFrom',
|
425
|
-
args: [
|
425
|
+
args: [address.vitalik, accounts[0].address, 1n],
|
426
426
|
},
|
427
427
|
{
|
428
428
|
...baycContractConfig,
|
@@ -431,7 +431,7 @@ describe('errors', async () => {
|
|
431
431
|
{
|
432
432
|
...baycContractConfig,
|
433
433
|
functionName: 'tokenOfOwnerByIndex',
|
434
|
-
args: [
|
434
|
+
args: [address.vitalik, 1n],
|
435
435
|
},
|
436
436
|
] as const,
|
437
437
|
multicallAddress: '0xca11bde05977b3631167028862be2a173976ca11',
|
@@ -7,9 +7,9 @@
|
|
7
7
|
|
8
8
|
import { describe, expect, test } from 'vitest'
|
9
9
|
import {
|
10
|
+
address,
|
10
11
|
initialBlockNumber,
|
11
12
|
publicClient,
|
12
|
-
vitalikAddress,
|
13
13
|
wagmiContractConfig,
|
14
14
|
} from '../../_test'
|
15
15
|
import { baycContractConfig } from '../../_test/abis'
|
@@ -115,7 +115,7 @@ describe('bayc', () => {
|
|
115
115
|
readContract(publicClient, {
|
116
116
|
...baycContractConfig,
|
117
117
|
functionName: 'tokenOfOwnerByIndex',
|
118
|
-
args: [
|
118
|
+
args: [address.vitalik, 5n],
|
119
119
|
}),
|
120
120
|
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
121
121
|
"The contract function \\"tokenOfOwnerByIndex\\" reverted with the following reason:
|