wagmi 1.4.9 → 1.4.10-cjs
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/actions.js +83 -83
- package/dist/chains.js +2 -2
- package/dist/connectors/coinbaseWallet.js +5 -5
- package/dist/connectors/index.js +5 -5
- package/dist/connectors/injected.js +5 -5
- package/dist/connectors/ledger.js +5 -5
- package/dist/connectors/metaMask.js +5 -5
- package/dist/connectors/mock.js +5 -5
- package/dist/connectors/safe.js +5 -5
- package/dist/connectors/walletConnect.js +5 -5
- package/dist/connectors/walletConnectLegacy.js +5 -5
- package/dist/index.js +272 -272
- package/dist/providers/alchemy.js +5 -5
- package/dist/providers/infura.js +5 -5
- package/dist/providers/jsonRpc.js +5 -5
- package/dist/providers/public.js +5 -5
- package/dist/window.d.ts +1 -0
- package/dist/window.js +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } 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; }"use client";
|
|
2
2
|
|
|
3
3
|
// src/config.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
var _querysyncstoragepersister = require('@tanstack/query-sync-storage-persister');
|
|
5
|
+
var _reactquery = require('@tanstack/react-query');
|
|
6
|
+
var _reactquerypersistclient = require('@tanstack/react-query-persist-client');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _core = require('@wagmi/core');
|
|
12
12
|
function createConfig({
|
|
13
|
-
queryClient = new QueryClient({
|
|
13
|
+
queryClient = new (0, _reactquery.QueryClient)({
|
|
14
14
|
defaultOptions: {
|
|
15
15
|
queries: {
|
|
16
16
|
cacheTime: 1e3 * 60 * 60 * 24,
|
|
@@ -23,10 +23,10 @@ function createConfig({
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}),
|
|
26
|
-
storage = createStorage({
|
|
27
|
-
storage: typeof window !== "undefined" && window.localStorage ? window.localStorage : noopStorage
|
|
26
|
+
storage = _core.createStorage.call(void 0, {
|
|
27
|
+
storage: typeof window !== "undefined" && window.localStorage ? window.localStorage : _core.noopStorage
|
|
28
28
|
}),
|
|
29
|
-
persister = typeof window !== "undefined" ? createSyncStoragePersister({
|
|
29
|
+
persister = typeof window !== "undefined" ? _querysyncstoragepersister.createSyncStoragePersister.call(void 0, {
|
|
30
30
|
key: "cache",
|
|
31
31
|
storage,
|
|
32
32
|
serialize: (x) => x,
|
|
@@ -34,12 +34,12 @@ function createConfig({
|
|
|
34
34
|
}) : void 0,
|
|
35
35
|
...args
|
|
36
36
|
}) {
|
|
37
|
-
const config =
|
|
37
|
+
const config = _core.createConfig.call(void 0, {
|
|
38
38
|
...args,
|
|
39
39
|
storage
|
|
40
40
|
});
|
|
41
41
|
if (persister)
|
|
42
|
-
persistQueryClient({
|
|
42
|
+
_reactquerypersistclient.persistQueryClient.call(void 0, {
|
|
43
43
|
queryClient,
|
|
44
44
|
persister,
|
|
45
45
|
dehydrateOptions: {
|
|
@@ -50,8 +50,8 @@ function createConfig({
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// src/context.ts
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
|
|
54
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react); var React9 = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React7 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React6 = _interopRequireWildcard(_react); var React8 = _interopRequireWildcard(_react); var React10 = _interopRequireWildcard(_react); var React11 = _interopRequireWildcard(_react); var React12 = _interopRequireWildcard(_react); var React13 = _interopRequireWildcard(_react); var React14 = _interopRequireWildcard(_react); var React15 = _interopRequireWildcard(_react); var React16 = _interopRequireWildcard(_react); var React17 = _interopRequireWildcard(_react); var React18 = _interopRequireWildcard(_react); var React19 = _interopRequireWildcard(_react); var React20 = _interopRequireWildcard(_react); var React21 = _interopRequireWildcard(_react);
|
|
55
55
|
var Context = React.createContext(void 0);
|
|
56
56
|
var queryClientContext = React.createContext(
|
|
57
57
|
void 0
|
|
@@ -61,7 +61,7 @@ function WagmiConfig({
|
|
|
61
61
|
config
|
|
62
62
|
}) {
|
|
63
63
|
return React.createElement(Context.Provider, {
|
|
64
|
-
children: React.createElement(QueryClientProvider, {
|
|
64
|
+
children: React.createElement(_reactquery.QueryClientProvider, {
|
|
65
65
|
children,
|
|
66
66
|
client: config.queryClient,
|
|
67
67
|
context: queryClientContext
|
|
@@ -82,20 +82,20 @@ function useConfig() {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
// src/hooks/accounts/useAccount.ts
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
|
|
86
|
+
|
|
87
87
|
|
|
88
88
|
// src/hooks/utils/query/useBaseQuery.ts
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
96
|
|
|
97
97
|
// src/hooks/utils/useSyncExternalStore.ts
|
|
98
|
-
|
|
98
|
+
var _indexjs = require('use-sync-external-store/shim/index.js'); var pkg = _interopRequireWildcard(_indexjs);
|
|
99
99
|
var useSyncExternalStore2 = pkg.useSyncExternalStore;
|
|
100
100
|
|
|
101
101
|
// src/hooks/utils/query/utils.ts
|
|
@@ -163,26 +163,26 @@ function trackResult(result, observer) {
|
|
|
163
163
|
|
|
164
164
|
// src/hooks/utils/query/useBaseQuery.ts
|
|
165
165
|
function useBaseQuery(options, Observer) {
|
|
166
|
-
const queryClient = useQueryClient({ context: options.context });
|
|
167
|
-
const isRestoring = useIsRestoring();
|
|
168
|
-
const errorResetBoundary = useQueryErrorResetBoundary();
|
|
166
|
+
const queryClient = _reactquery.useQueryClient.call(void 0, { context: options.context });
|
|
167
|
+
const isRestoring = _reactquery.useIsRestoring.call(void 0, );
|
|
168
|
+
const errorResetBoundary = _reactquery.useQueryErrorResetBoundary.call(void 0, );
|
|
169
169
|
const defaultedOptions = queryClient.defaultQueryOptions({
|
|
170
170
|
...options,
|
|
171
171
|
queryKeyHashFn
|
|
172
172
|
});
|
|
173
173
|
defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
|
|
174
174
|
if (defaultedOptions.onError) {
|
|
175
|
-
defaultedOptions.onError = notifyManager.batchCalls(
|
|
175
|
+
defaultedOptions.onError = _reactquery.notifyManager.batchCalls(
|
|
176
176
|
defaultedOptions.onError
|
|
177
177
|
);
|
|
178
178
|
}
|
|
179
179
|
if (defaultedOptions.onSuccess) {
|
|
180
|
-
defaultedOptions.onSuccess = notifyManager.batchCalls(
|
|
180
|
+
defaultedOptions.onSuccess = _reactquery.notifyManager.batchCalls(
|
|
181
181
|
defaultedOptions.onSuccess
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
184
|
if (defaultedOptions.onSettled) {
|
|
185
|
-
defaultedOptions.onSettled = notifyManager.batchCalls(
|
|
185
|
+
defaultedOptions.onSettled = _reactquery.notifyManager.batchCalls(
|
|
186
186
|
defaultedOptions.onSettled
|
|
187
187
|
);
|
|
188
188
|
}
|
|
@@ -205,7 +205,7 @@ function useBaseQuery(options, Observer) {
|
|
|
205
205
|
const result = observer.getOptimisticResult(defaultedOptions);
|
|
206
206
|
useSyncExternalStore2(
|
|
207
207
|
React2.useCallback(
|
|
208
|
-
(onStoreChange) => isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange)),
|
|
208
|
+
(onStoreChange) => isRestoring ? () => void 0 : observer.subscribe(_reactquery.notifyManager.batchCalls(onStoreChange)),
|
|
209
209
|
[observer, isRestoring]
|
|
210
210
|
),
|
|
211
211
|
() => observer.getCurrentResult(),
|
|
@@ -219,12 +219,12 @@ function useBaseQuery(options, Observer) {
|
|
|
219
219
|
}, [defaultedOptions, observer]);
|
|
220
220
|
if (defaultedOptions.suspense && result.isLoading && result.isFetching && !isRestoring) {
|
|
221
221
|
throw observer.fetchOptimistic(defaultedOptions).then(({ data }) => {
|
|
222
|
-
defaultedOptions.onSuccess
|
|
223
|
-
defaultedOptions.onSettled
|
|
222
|
+
_optionalChain([defaultedOptions, 'access', _2 => _2.onSuccess, 'optionalCall', _3 => _3(data)]);
|
|
223
|
+
_optionalChain([defaultedOptions, 'access', _4 => _4.onSettled, 'optionalCall', _5 => _5(data, null)]);
|
|
224
224
|
}).catch((error) => {
|
|
225
225
|
errorResetBoundary.clearReset();
|
|
226
|
-
defaultedOptions.onError
|
|
227
|
-
defaultedOptions.onSettled
|
|
226
|
+
_optionalChain([defaultedOptions, 'access', _6 => _6.onError, 'optionalCall', _7 => _7(error)]);
|
|
227
|
+
_optionalChain([defaultedOptions, 'access', _8 => _8.onSettled, 'optionalCall', _9 => _9(void 0, error)]);
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
if (result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(defaultedOptions.useErrorBoundary, [
|
|
@@ -247,12 +247,12 @@ function useBaseQuery(options, Observer) {
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
// src/hooks/utils/query/useInfiniteQuery.ts
|
|
250
|
-
|
|
250
|
+
|
|
251
251
|
function useInfiniteQuery(arg1, arg2, arg3) {
|
|
252
252
|
const parsedOptions = parseQueryArgs(arg1, arg2, arg3);
|
|
253
253
|
const baseQuery = useBaseQuery(
|
|
254
254
|
{ context: queryClientContext, ...parsedOptions },
|
|
255
|
-
InfiniteQueryObserver
|
|
255
|
+
_reactquery.InfiniteQueryObserver
|
|
256
256
|
);
|
|
257
257
|
const result = {
|
|
258
258
|
data: baseQuery.data,
|
|
@@ -289,20 +289,20 @@ function useInfiniteQuery(arg1, arg2, arg3) {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
// src/hooks/utils/query/useMutation.ts
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
296
|
function useMutation(arg1, arg2, arg3) {
|
|
297
|
-
const options = parseMutationArgs(arg1, arg2, arg3);
|
|
298
|
-
return
|
|
297
|
+
const options = _reactquery.parseMutationArgs.call(void 0, arg1, arg2, arg3);
|
|
298
|
+
return _reactquery.useMutation.call(void 0, { context: queryClientContext, ...options });
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
// src/hooks/utils/query/useQuery.ts
|
|
302
|
-
|
|
302
|
+
|
|
303
303
|
function useQuery(arg1, arg2, arg3) {
|
|
304
304
|
const parsedOptions = parseQueryArgs(arg1, arg2, arg3);
|
|
305
|
-
const baseQuery = useBaseQuery({ context: queryClientContext, ...parsedOptions }, QueryObserver);
|
|
305
|
+
const baseQuery = useBaseQuery({ context: queryClientContext, ...parsedOptions }, _reactquery.QueryObserver);
|
|
306
306
|
const result = {
|
|
307
307
|
data: baseQuery.data,
|
|
308
308
|
error: baseQuery.error,
|
|
@@ -335,34 +335,34 @@ function useQuery(arg1, arg2, arg3) {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
// src/hooks/utils/query/useQueryClient.ts
|
|
338
|
-
|
|
339
|
-
var useQueryClient2 = () =>
|
|
338
|
+
|
|
339
|
+
var useQueryClient2 = () => _reactquery.useQueryClient.call(void 0, { context: queryClientContext });
|
|
340
340
|
|
|
341
341
|
// src/hooks/viem/usePublicClient.ts
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
|
|
343
|
+
var _withselectorjs = require('use-sync-external-store/shim/with-selector.js');
|
|
344
344
|
function usePublicClient({
|
|
345
345
|
chainId
|
|
346
346
|
} = {}) {
|
|
347
|
-
return useSyncExternalStoreWithSelector(
|
|
348
|
-
(cb) => watchPublicClient({ chainId }, cb),
|
|
349
|
-
() => getPublicClient({ chainId }),
|
|
350
|
-
() => getPublicClient({ chainId }),
|
|
347
|
+
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
348
|
+
(cb) => _core.watchPublicClient.call(void 0, { chainId }, cb),
|
|
349
|
+
() => _core.getPublicClient.call(void 0, { chainId }),
|
|
350
|
+
() => _core.getPublicClient.call(void 0, { chainId }),
|
|
351
351
|
(x) => x,
|
|
352
352
|
(a, b) => a.uid === b.uid
|
|
353
353
|
);
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
// src/hooks/viem/useWalletClient.ts
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
|
|
358
|
+
|
|
359
359
|
function queryKey({ chainId }) {
|
|
360
360
|
return [{ entity: "walletClient", chainId, persist: false }];
|
|
361
361
|
}
|
|
362
362
|
function queryFn({
|
|
363
363
|
queryKey: [{ chainId }]
|
|
364
364
|
}) {
|
|
365
|
-
return getWalletClient({ chainId });
|
|
365
|
+
return _core.getWalletClient.call(void 0, { chainId });
|
|
366
366
|
}
|
|
367
367
|
function useWalletClient({
|
|
368
368
|
chainId: chainId_,
|
|
@@ -384,7 +384,7 @@ function useWalletClient({
|
|
|
384
384
|
});
|
|
385
385
|
const queryClient = useQueryClient2();
|
|
386
386
|
React3.useEffect(() => {
|
|
387
|
-
const unwatch = watchWalletClient({ chainId }, (walletClient) => {
|
|
387
|
+
const unwatch = _core.watchWalletClient.call(void 0, { chainId }, (walletClient) => {
|
|
388
388
|
if (walletClient)
|
|
389
389
|
queryClient.invalidateQueries(queryKey({ chainId }));
|
|
390
390
|
else
|
|
@@ -396,18 +396,18 @@ function useWalletClient({
|
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
// src/hooks/viem/useWebSocketPublicClient.ts
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
404
|
function useWebSocketPublicClient({ chainId } = {}) {
|
|
405
|
-
return
|
|
406
|
-
(cb) => watchWebSocketPublicClient({ chainId }, cb),
|
|
407
|
-
() => getWebSocketPublicClient({ chainId }),
|
|
408
|
-
() => getWebSocketPublicClient({ chainId }),
|
|
405
|
+
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
406
|
+
(cb) => _core.watchWebSocketPublicClient.call(void 0, { chainId }, cb),
|
|
407
|
+
() => _core.getWebSocketPublicClient.call(void 0, { chainId }),
|
|
408
|
+
() => _core.getWebSocketPublicClient.call(void 0, { chainId }),
|
|
409
409
|
(x) => x,
|
|
410
|
-
(a, b) => a
|
|
410
|
+
(a, b) => _optionalChain([a, 'optionalAccess', _10 => _10.uid]) === _optionalChain([b, 'optionalAccess', _11 => _11.uid])
|
|
411
411
|
);
|
|
412
412
|
}
|
|
413
413
|
|
|
@@ -418,25 +418,25 @@ function useChainId({ chainId } = {}) {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
// src/hooks/utils/useForceUpdate.ts
|
|
421
|
-
|
|
421
|
+
|
|
422
422
|
function useForceUpdate() {
|
|
423
423
|
const [, forceUpdate] = React4.useReducer((x) => x + 1, 0);
|
|
424
424
|
return forceUpdate;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// src/hooks/utils/useInvalidateOnBlock.ts
|
|
428
|
-
|
|
428
|
+
|
|
429
429
|
|
|
430
430
|
// src/hooks/network-status/useBlockNumber.ts
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
|
|
432
|
+
|
|
433
433
|
function queryKey2({ chainId, scopeKey }) {
|
|
434
434
|
return [{ entity: "blockNumber", chainId, scopeKey }];
|
|
435
435
|
}
|
|
436
436
|
function queryFn2({
|
|
437
437
|
queryKey: [{ chainId }]
|
|
438
438
|
}) {
|
|
439
|
-
return fetchBlockNumber({ chainId });
|
|
439
|
+
return _core.fetchBlockNumber.call(void 0, { chainId });
|
|
440
440
|
}
|
|
441
441
|
function useBlockNumber({
|
|
442
442
|
cacheTime = 0,
|
|
@@ -460,7 +460,7 @@ function useBlockNumber({
|
|
|
460
460
|
return;
|
|
461
461
|
if (!watch && !onBlock)
|
|
462
462
|
return;
|
|
463
|
-
const publicClient_ = webSocketPublicClient
|
|
463
|
+
const publicClient_ = _nullishCoalesce(webSocketPublicClient, () => ( publicClient));
|
|
464
464
|
const unwatch = publicClient_.watchBlockNumber({
|
|
465
465
|
onBlockNumber: (blockNumber) => {
|
|
466
466
|
if (watch)
|
|
@@ -493,8 +493,8 @@ function useBlockNumber({
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
// src/hooks/network-status/useFeeData.ts
|
|
496
|
-
|
|
497
|
-
|
|
496
|
+
|
|
497
|
+
|
|
498
498
|
function queryKey3({
|
|
499
499
|
chainId,
|
|
500
500
|
formatUnits,
|
|
@@ -505,7 +505,7 @@ function queryKey3({
|
|
|
505
505
|
function queryFn3({
|
|
506
506
|
queryKey: [{ chainId, formatUnits }]
|
|
507
507
|
}) {
|
|
508
|
-
return fetchFeeData({ chainId, formatUnits });
|
|
508
|
+
return _core.fetchFeeData.call(void 0, { chainId, formatUnits });
|
|
509
509
|
}
|
|
510
510
|
function useFeeData({
|
|
511
511
|
cacheTime,
|
|
@@ -566,13 +566,13 @@ function useInvalidateOnBlock({
|
|
|
566
566
|
}
|
|
567
567
|
|
|
568
568
|
// src/hooks/utils/useSyncExternalStoreWithTracked.ts
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
|
|
572
572
|
var isPlainObject2 = (obj) => typeof obj === "object" && !Array.isArray(obj);
|
|
573
|
-
function useSyncExternalStoreWithTracked(subscribe, getSnapshot, getServerSnapshot = getSnapshot, isEqual = deepEqual) {
|
|
573
|
+
function useSyncExternalStoreWithTracked(subscribe, getSnapshot, getServerSnapshot = getSnapshot, isEqual = _core.deepEqual) {
|
|
574
574
|
const trackedKeys = React8.useRef([]);
|
|
575
|
-
const result =
|
|
575
|
+
const result = _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
576
576
|
subscribe,
|
|
577
577
|
getSnapshot,
|
|
578
578
|
getServerSnapshot,
|
|
@@ -624,22 +624,22 @@ function useSyncExternalStoreWithTracked(subscribe, getSnapshot, getServerSnapsh
|
|
|
624
624
|
function useAccount({ onConnect, onDisconnect } = {}) {
|
|
625
625
|
const config = useConfig();
|
|
626
626
|
const watchAccount_ = React9.useCallback(
|
|
627
|
-
(callback) => watchAccount(callback),
|
|
627
|
+
(callback) => _core.watchAccount.call(void 0, callback),
|
|
628
628
|
[config]
|
|
629
629
|
);
|
|
630
|
-
const account = useSyncExternalStoreWithTracked(watchAccount_, getAccount);
|
|
630
|
+
const account = useSyncExternalStoreWithTracked(watchAccount_, _core.getAccount);
|
|
631
631
|
const previousAccountRef = React9.useRef();
|
|
632
632
|
const previousAccount = previousAccountRef.current;
|
|
633
633
|
React9.useEffect(() => {
|
|
634
|
-
if (previousAccount
|
|
635
|
-
onConnect
|
|
634
|
+
if (_optionalChain([previousAccount, 'optionalAccess', _12 => _12.status]) !== "connected" && account.status === "connected") {
|
|
635
|
+
_optionalChain([onConnect, 'optionalCall', _13 => _13({
|
|
636
636
|
address: account.address,
|
|
637
637
|
connector: account.connector,
|
|
638
|
-
isReconnected: previousAccount
|
|
639
|
-
});
|
|
638
|
+
isReconnected: _optionalChain([previousAccount, 'optionalAccess', _14 => _14.status]) === "reconnecting" || _optionalChain([previousAccount, 'optionalAccess', _15 => _15.status]) === void 0
|
|
639
|
+
})]);
|
|
640
640
|
}
|
|
641
|
-
if (previousAccount
|
|
642
|
-
onDisconnect
|
|
641
|
+
if (_optionalChain([previousAccount, 'optionalAccess', _16 => _16.status]) === "connected" && account.status === "disconnected") {
|
|
642
|
+
_optionalChain([onDisconnect, 'optionalCall', _17 => _17()]);
|
|
643
643
|
}
|
|
644
644
|
previousAccountRef.current = account;
|
|
645
645
|
}, [onConnect, onDisconnect, previousAccount, account]);
|
|
@@ -647,8 +647,8 @@ function useAccount({ onConnect, onDisconnect } = {}) {
|
|
|
647
647
|
}
|
|
648
648
|
|
|
649
649
|
// src/hooks/accounts/useBalance.ts
|
|
650
|
-
|
|
651
|
-
|
|
650
|
+
|
|
651
|
+
|
|
652
652
|
function queryKey4({
|
|
653
653
|
address,
|
|
654
654
|
chainId,
|
|
@@ -672,7 +672,7 @@ function queryFn4({
|
|
|
672
672
|
}) {
|
|
673
673
|
if (!address)
|
|
674
674
|
throw new Error("address is required");
|
|
675
|
-
return fetchBalance({ address, chainId, formatUnits, token });
|
|
675
|
+
return _core.fetchBalance.call(void 0, { address, chainId, formatUnits, token });
|
|
676
676
|
}
|
|
677
677
|
function useBalance({
|
|
678
678
|
address,
|
|
@@ -712,14 +712,14 @@ function useBalance({
|
|
|
712
712
|
}
|
|
713
713
|
|
|
714
714
|
// src/hooks/accounts/useConnect.ts
|
|
715
|
-
|
|
716
|
-
|
|
715
|
+
|
|
716
|
+
|
|
717
717
|
var mutationKey = (args) => [{ entity: "connect", ...args }];
|
|
718
718
|
var mutationFn = (args) => {
|
|
719
719
|
const { connector, chainId } = args;
|
|
720
720
|
if (!connector)
|
|
721
721
|
throw new Error("connector is required");
|
|
722
|
-
return connect({ connector, chainId });
|
|
722
|
+
return _core.connect.call(void 0, { connector, chainId });
|
|
723
723
|
};
|
|
724
724
|
function useConnect({
|
|
725
725
|
chainId,
|
|
@@ -751,8 +751,8 @@ function useConnect({
|
|
|
751
751
|
const connect2 = React11.useCallback(
|
|
752
752
|
(args) => {
|
|
753
753
|
return mutate({
|
|
754
|
-
chainId: args
|
|
755
|
-
connector: args
|
|
754
|
+
chainId: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _18 => _18.chainId]), () => ( chainId)),
|
|
755
|
+
connector: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _19 => _19.connector]), () => ( connector))
|
|
756
756
|
});
|
|
757
757
|
},
|
|
758
758
|
[chainId, connector, mutate]
|
|
@@ -760,8 +760,8 @@ function useConnect({
|
|
|
760
760
|
const connectAsync = React11.useCallback(
|
|
761
761
|
(args) => {
|
|
762
762
|
return mutateAsync({
|
|
763
|
-
chainId: args
|
|
764
|
-
connector: args
|
|
763
|
+
chainId: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _20 => _20.chainId]), () => ( chainId)),
|
|
764
|
+
connector: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _21 => _21.connector]), () => ( connector))
|
|
765
765
|
});
|
|
766
766
|
},
|
|
767
767
|
[chainId, connector, mutateAsync]
|
|
@@ -776,7 +776,7 @@ function useConnect({
|
|
|
776
776
|
isIdle,
|
|
777
777
|
isLoading,
|
|
778
778
|
isSuccess,
|
|
779
|
-
pendingConnector: variables
|
|
779
|
+
pendingConnector: _optionalChain([variables, 'optionalAccess', _22 => _22.connector]),
|
|
780
780
|
reset,
|
|
781
781
|
status,
|
|
782
782
|
variables
|
|
@@ -784,9 +784,9 @@ function useConnect({
|
|
|
784
784
|
}
|
|
785
785
|
|
|
786
786
|
// src/hooks/accounts/useDisconnect.ts
|
|
787
|
-
|
|
787
|
+
|
|
788
788
|
var mutationKey2 = [{ entity: "disconnect" }];
|
|
789
|
-
var mutationFn2 = () => disconnect();
|
|
789
|
+
var mutationFn2 = () => _core.disconnect.call(void 0, );
|
|
790
790
|
function useDisconnect({
|
|
791
791
|
onError,
|
|
792
792
|
onMutate,
|
|
@@ -835,26 +835,26 @@ function useDisconnect({
|
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
// src/hooks/accounts/useNetwork.ts
|
|
838
|
-
|
|
839
|
-
|
|
838
|
+
|
|
839
|
+
|
|
840
840
|
function useNetwork() {
|
|
841
841
|
const config = useConfig();
|
|
842
|
-
const watchNetwork_ =
|
|
843
|
-
(callback) => watchNetwork(callback),
|
|
842
|
+
const watchNetwork_ = _react.useCallback.call(void 0,
|
|
843
|
+
(callback) => _core.watchNetwork.call(void 0, callback),
|
|
844
844
|
[config]
|
|
845
845
|
);
|
|
846
|
-
return useSyncExternalStoreWithTracked(watchNetwork_, getNetwork);
|
|
846
|
+
return useSyncExternalStoreWithTracked(watchNetwork_, _core.getNetwork);
|
|
847
847
|
}
|
|
848
848
|
|
|
849
849
|
// src/hooks/accounts/useSignMessage.ts
|
|
850
|
-
|
|
851
|
-
|
|
850
|
+
|
|
851
|
+
|
|
852
852
|
var mutationKey3 = (args) => [{ entity: "signMessage", ...args }];
|
|
853
853
|
var mutationFn3 = (args) => {
|
|
854
854
|
const { message } = args;
|
|
855
855
|
if (!message)
|
|
856
856
|
throw new Error("message is required");
|
|
857
|
-
return signMessage({ message });
|
|
857
|
+
return _core.signMessage.call(void 0, { message });
|
|
858
858
|
};
|
|
859
859
|
function useSignMessage({
|
|
860
860
|
message,
|
|
@@ -905,8 +905,8 @@ function useSignMessage({
|
|
|
905
905
|
}
|
|
906
906
|
|
|
907
907
|
// src/hooks/accounts/useSignTypedData.ts
|
|
908
|
-
|
|
909
|
-
|
|
908
|
+
|
|
909
|
+
|
|
910
910
|
function mutationKey4({ domain, types, message, primaryType }) {
|
|
911
911
|
return [
|
|
912
912
|
{ entity: "signTypedData", domain, types, message, primaryType }
|
|
@@ -922,7 +922,7 @@ function mutationFn4(args) {
|
|
|
922
922
|
throw new Error("primaryType is required");
|
|
923
923
|
if (!message)
|
|
924
924
|
throw new Error("message is required");
|
|
925
|
-
return signTypedData({
|
|
925
|
+
return _core.signTypedData.call(void 0, {
|
|
926
926
|
domain,
|
|
927
927
|
message,
|
|
928
928
|
primaryType,
|
|
@@ -968,19 +968,19 @@ function useSignTypedData({
|
|
|
968
968
|
);
|
|
969
969
|
const signTypedData2 = React13.useCallback(
|
|
970
970
|
(args) => mutate({
|
|
971
|
-
domain: args
|
|
972
|
-
types: args
|
|
973
|
-
message: args
|
|
974
|
-
primaryType: args
|
|
971
|
+
domain: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _23 => _23.domain]), () => ( domain)),
|
|
972
|
+
types: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _24 => _24.types]), () => ( types)),
|
|
973
|
+
message: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _25 => _25.message]), () => ( message)),
|
|
974
|
+
primaryType: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _26 => _26.primaryType]), () => ( primaryType))
|
|
975
975
|
}),
|
|
976
976
|
[domain, types, primaryType, message, mutate]
|
|
977
977
|
);
|
|
978
978
|
const signTypedDataAsync = React13.useCallback(
|
|
979
979
|
(args) => mutateAsync({
|
|
980
|
-
domain: args
|
|
981
|
-
types: args
|
|
982
|
-
message: args
|
|
983
|
-
primaryType: args
|
|
980
|
+
domain: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _27 => _27.domain]), () => ( domain)),
|
|
981
|
+
types: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _28 => _28.types]), () => ( types)),
|
|
982
|
+
message: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _29 => _29.message]), () => ( message)),
|
|
983
|
+
primaryType: _nullishCoalesce(_optionalChain([args, 'optionalAccess', _30 => _30.primaryType]), () => ( primaryType))
|
|
984
984
|
}),
|
|
985
985
|
[domain, types, primaryType, message, mutateAsync]
|
|
986
986
|
);
|
|
@@ -1000,14 +1000,14 @@ function useSignTypedData({
|
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
1002
|
// src/hooks/accounts/useSwitchNetwork.ts
|
|
1003
|
-
|
|
1004
|
-
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
1005
|
var mutationKey5 = (args) => [{ entity: "switchNetwork", ...args }];
|
|
1006
1006
|
var mutationFn5 = (args) => {
|
|
1007
1007
|
const { chainId } = args;
|
|
1008
1008
|
if (!chainId)
|
|
1009
1009
|
throw new Error("chainId is required");
|
|
1010
|
-
return switchNetwork({ chainId });
|
|
1010
|
+
return _core.switchNetwork.call(void 0, { chainId });
|
|
1011
1011
|
};
|
|
1012
1012
|
function useSwitchNetwork({
|
|
1013
1013
|
chainId,
|
|
@@ -1038,11 +1038,11 @@ function useSwitchNetwork({
|
|
|
1038
1038
|
onSuccess
|
|
1039
1039
|
});
|
|
1040
1040
|
const switchNetwork_ = React14.useCallback(
|
|
1041
|
-
(chainId_) => mutate({ chainId: chainId_
|
|
1041
|
+
(chainId_) => mutate({ chainId: _nullishCoalesce(chainId_, () => ( chainId)) }),
|
|
1042
1042
|
[chainId, mutate]
|
|
1043
1043
|
);
|
|
1044
1044
|
const switchNetworkAsync_ = React14.useCallback(
|
|
1045
|
-
(chainId_) => mutateAsync({ chainId: chainId_
|
|
1045
|
+
(chainId_) => mutateAsync({ chainId: _nullishCoalesce(chainId_, () => ( chainId)) }),
|
|
1046
1046
|
[chainId, mutateAsync]
|
|
1047
1047
|
);
|
|
1048
1048
|
React14.useEffect(() => {
|
|
@@ -1057,20 +1057,20 @@ function useSwitchNetwork({
|
|
|
1057
1057
|
}, [config, forceUpdate]);
|
|
1058
1058
|
let switchNetwork2;
|
|
1059
1059
|
let switchNetworkAsync;
|
|
1060
|
-
const supportsSwitchChain = !!config.connector
|
|
1060
|
+
const supportsSwitchChain = !!_optionalChain([config, 'access', _31 => _31.connector, 'optionalAccess', _32 => _32.switchChain]);
|
|
1061
1061
|
if (throwForSwitchChainNotSupported || supportsSwitchChain) {
|
|
1062
1062
|
switchNetwork2 = switchNetwork_;
|
|
1063
1063
|
switchNetworkAsync = switchNetworkAsync_;
|
|
1064
1064
|
}
|
|
1065
1065
|
return {
|
|
1066
|
-
chains: config.chains
|
|
1066
|
+
chains: _nullishCoalesce(config.chains, () => ( [])),
|
|
1067
1067
|
data,
|
|
1068
1068
|
error,
|
|
1069
1069
|
isError,
|
|
1070
1070
|
isIdle,
|
|
1071
1071
|
isLoading,
|
|
1072
1072
|
isSuccess,
|
|
1073
|
-
pendingChainId: variables
|
|
1073
|
+
pendingChainId: _optionalChain([variables, 'optionalAccess', _33 => _33.chainId]),
|
|
1074
1074
|
reset,
|
|
1075
1075
|
status,
|
|
1076
1076
|
switchNetwork: switchNetwork2,
|
|
@@ -1080,7 +1080,7 @@ function useSwitchNetwork({
|
|
|
1080
1080
|
}
|
|
1081
1081
|
|
|
1082
1082
|
// src/hooks/contracts/useContractEvent.ts
|
|
1083
|
-
|
|
1083
|
+
|
|
1084
1084
|
function useContractEvent({
|
|
1085
1085
|
address,
|
|
1086
1086
|
chainId,
|
|
@@ -1102,14 +1102,14 @@ function useContractEvent({
|
|
|
1102
1102
|
onLogs: listener
|
|
1103
1103
|
});
|
|
1104
1104
|
return unwatch.current;
|
|
1105
|
-
}, [abi, address, eventName, publicClient.uid, webSocketPublicClient
|
|
1105
|
+
}, [abi, address, eventName, publicClient.uid, _optionalChain([webSocketPublicClient, 'optionalAccess', _34 => _34.uid])]);
|
|
1106
1106
|
return unwatch.current;
|
|
1107
1107
|
}
|
|
1108
1108
|
|
|
1109
1109
|
// src/hooks/contracts/useContractInfiniteReads.ts
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
1113
|
function queryKey5({
|
|
1114
1114
|
allowFailure,
|
|
1115
1115
|
blockNumber,
|
|
@@ -1135,7 +1135,7 @@ function queryFn5({
|
|
|
1135
1135
|
queryKey: [{ allowFailure, blockNumber, blockTag }],
|
|
1136
1136
|
pageParam
|
|
1137
1137
|
}) => {
|
|
1138
|
-
return readContracts({
|
|
1138
|
+
return _core.readContracts.call(void 0, {
|
|
1139
1139
|
allowFailure,
|
|
1140
1140
|
blockNumber,
|
|
1141
1141
|
blockTag,
|
|
@@ -1160,7 +1160,7 @@ function useContractInfiniteReads({
|
|
|
1160
1160
|
scopeKey,
|
|
1161
1161
|
select,
|
|
1162
1162
|
staleTime,
|
|
1163
|
-
structuralSharing = (oldData, newData) =>
|
|
1163
|
+
structuralSharing = (oldData, newData) => _core.deepEqual.call(void 0, oldData, newData) ? oldData : _reactquery.replaceEqualDeep.call(void 0, oldData, newData),
|
|
1164
1164
|
suspense
|
|
1165
1165
|
}) {
|
|
1166
1166
|
const queryKey_ = React16.useMemo(
|
|
@@ -1197,15 +1197,15 @@ function paginatedIndexesConfig(fn, {
|
|
|
1197
1197
|
return {
|
|
1198
1198
|
contracts,
|
|
1199
1199
|
getNextPageParam(lastPage, pages) {
|
|
1200
|
-
return lastPage
|
|
1200
|
+
return _optionalChain([lastPage, 'optionalAccess', _35 => _35.length]) === perPage ? pages.length : void 0;
|
|
1201
1201
|
}
|
|
1202
1202
|
};
|
|
1203
1203
|
}
|
|
1204
1204
|
|
|
1205
1205
|
// src/hooks/contracts/useContractRead.ts
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
1209
|
function queryKey6({
|
|
1210
1210
|
account,
|
|
1211
1211
|
address,
|
|
@@ -1240,7 +1240,7 @@ function queryFn6({ abi }) {
|
|
|
1240
1240
|
throw new Error("abi is required");
|
|
1241
1241
|
if (!address)
|
|
1242
1242
|
throw new Error("address is required");
|
|
1243
|
-
return await readContract({
|
|
1243
|
+
return await _asyncNullishCoalesce(await _core.readContract.call(void 0, {
|
|
1244
1244
|
account,
|
|
1245
1245
|
address,
|
|
1246
1246
|
args,
|
|
@@ -1249,7 +1249,7 @@ function queryFn6({ abi }) {
|
|
|
1249
1249
|
chainId,
|
|
1250
1250
|
abi,
|
|
1251
1251
|
functionName
|
|
1252
|
-
})
|
|
1252
|
+
}), async () => ( null));
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
1255
1255
|
function useContractRead({
|
|
@@ -1272,7 +1272,7 @@ function useContractRead({
|
|
|
1272
1272
|
scopeKey,
|
|
1273
1273
|
select,
|
|
1274
1274
|
staleTime,
|
|
1275
|
-
structuralSharing = (oldData, newData) =>
|
|
1275
|
+
structuralSharing = (oldData, newData) => _core.deepEqual.call(void 0, oldData, newData) ? oldData : _reactquery.replaceEqualDeep.call(void 0, oldData, newData),
|
|
1276
1276
|
suspense,
|
|
1277
1277
|
watch
|
|
1278
1278
|
} = {}) {
|
|
@@ -1283,7 +1283,7 @@ function useContractRead({
|
|
|
1283
1283
|
scopeKey: watch || cacheOnBlock ? void 0 : "idle",
|
|
1284
1284
|
watch
|
|
1285
1285
|
});
|
|
1286
|
-
const blockNumber = blockNumberOverride
|
|
1286
|
+
const blockNumber = _nullishCoalesce(blockNumberOverride, () => ( blockNumber_));
|
|
1287
1287
|
const queryKey_ = React17.useMemo(
|
|
1288
1288
|
() => queryKey6({
|
|
1289
1289
|
account,
|
|
@@ -1340,9 +1340,9 @@ function useContractRead({
|
|
|
1340
1340
|
}
|
|
1341
1341
|
|
|
1342
1342
|
// src/hooks/contracts/useContractReads.ts
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
1346
|
function queryKey7({
|
|
1347
1347
|
allowFailure,
|
|
1348
1348
|
blockNumber,
|
|
@@ -1359,7 +1359,7 @@ function queryKey7({
|
|
|
1359
1359
|
blockTag,
|
|
1360
1360
|
chainId,
|
|
1361
1361
|
scopeKey,
|
|
1362
|
-
contracts: (contracts
|
|
1362
|
+
contracts: (_nullishCoalesce(contracts, () => ( []))).map(({ address, args, chainId: chainId2, functionName }) => ({
|
|
1363
1363
|
address,
|
|
1364
1364
|
args,
|
|
1365
1365
|
chainId: chainId2,
|
|
@@ -1376,7 +1376,7 @@ function queryFn7({ abis }) {
|
|
|
1376
1376
|
...contract,
|
|
1377
1377
|
abi: abis[i]
|
|
1378
1378
|
}));
|
|
1379
|
-
return
|
|
1379
|
+
return _core.readContracts.call(void 0, {
|
|
1380
1380
|
allowFailure,
|
|
1381
1381
|
contracts,
|
|
1382
1382
|
blockNumber,
|
|
@@ -1400,17 +1400,17 @@ function useContractReads({
|
|
|
1400
1400
|
scopeKey,
|
|
1401
1401
|
select,
|
|
1402
1402
|
staleTime,
|
|
1403
|
-
structuralSharing = (oldData, newData) =>
|
|
1403
|
+
structuralSharing = (oldData, newData) => _core.deepEqual.call(void 0, oldData, newData) ? oldData : _reactquery.replaceEqualDeep.call(void 0, oldData, newData),
|
|
1404
1404
|
suspense,
|
|
1405
1405
|
watch
|
|
1406
1406
|
} = {}) {
|
|
1407
|
-
const allowFailure = allowFailure_
|
|
1407
|
+
const allowFailure = _nullishCoalesce(allowFailure_, () => ( true));
|
|
1408
1408
|
const { data: blockNumber_ } = useBlockNumber({
|
|
1409
1409
|
enabled: watch || cacheOnBlock,
|
|
1410
1410
|
watch
|
|
1411
1411
|
});
|
|
1412
1412
|
const chainId = useChainId();
|
|
1413
|
-
const blockNumber = blockNumberOverride
|
|
1413
|
+
const blockNumber = _nullishCoalesce(blockNumberOverride, () => ( blockNumber_));
|
|
1414
1414
|
const queryKey_ = React18.useMemo(
|
|
1415
1415
|
() => queryKey7({
|
|
1416
1416
|
allowFailure,
|
|
@@ -1432,9 +1432,9 @@ function useContractReads({
|
|
|
1432
1432
|
);
|
|
1433
1433
|
const enabled = React18.useMemo(() => {
|
|
1434
1434
|
let enabled2 = Boolean(
|
|
1435
|
-
enabled_ && contracts
|
|
1435
|
+
enabled_ && _optionalChain([contracts, 'optionalAccess', _36 => _36.every, 'call', _37 => _37(
|
|
1436
1436
|
(x) => x.abi && x.address && x.functionName
|
|
1437
|
-
)
|
|
1437
|
+
)])
|
|
1438
1438
|
);
|
|
1439
1439
|
if (cacheOnBlock)
|
|
1440
1440
|
enabled2 = Boolean(enabled2 && blockNumber);
|
|
@@ -1444,7 +1444,7 @@ function useContractReads({
|
|
|
1444
1444
|
enabled: Boolean(enabled && watch && !cacheOnBlock),
|
|
1445
1445
|
queryKey: queryKey_
|
|
1446
1446
|
});
|
|
1447
|
-
const abis = (contracts
|
|
1447
|
+
const abis = (_nullishCoalesce(contracts, () => ( []))).map(
|
|
1448
1448
|
({ abi }) => abi
|
|
1449
1449
|
);
|
|
1450
1450
|
return useQuery(queryKey_, queryFn7({ abis }), {
|
|
@@ -1463,9 +1463,9 @@ function useContractReads({
|
|
|
1463
1463
|
}
|
|
1464
1464
|
|
|
1465
1465
|
// src/hooks/contracts/useContractWrite.ts
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1466
|
+
|
|
1467
|
+
var _internal = require('@wagmi/core/internal');
|
|
1468
|
+
|
|
1469
1469
|
function mutationKey6({
|
|
1470
1470
|
address,
|
|
1471
1471
|
abi,
|
|
@@ -1509,7 +1509,7 @@ function mutationFn6(config) {
|
|
|
1509
1509
|
if (config.mode === "prepared") {
|
|
1510
1510
|
if (!config.request)
|
|
1511
1511
|
throw new Error("request is required");
|
|
1512
|
-
return writeContract({
|
|
1512
|
+
return _core.writeContract.call(void 0, {
|
|
1513
1513
|
mode: "prepared",
|
|
1514
1514
|
request: config.request
|
|
1515
1515
|
});
|
|
@@ -1520,7 +1520,7 @@ function mutationFn6(config) {
|
|
|
1520
1520
|
throw new Error("abi is required");
|
|
1521
1521
|
if (!config.functionName)
|
|
1522
1522
|
throw new Error("functionName is required");
|
|
1523
|
-
return writeContract({
|
|
1523
|
+
return _core.writeContract.call(void 0, {
|
|
1524
1524
|
address: config.address,
|
|
1525
1525
|
args: config.args,
|
|
1526
1526
|
chainId: config.chainId,
|
|
@@ -1557,7 +1557,7 @@ function useContractWrite(config) {
|
|
|
1557
1557
|
maxPriorityFeePerGas,
|
|
1558
1558
|
nonce,
|
|
1559
1559
|
value
|
|
1560
|
-
} = getSendTransactionParameters(config);
|
|
1560
|
+
} = _internal.getSendTransactionParameters.call(void 0, config);
|
|
1561
1561
|
const {
|
|
1562
1562
|
data,
|
|
1563
1563
|
error,
|
|
@@ -1707,8 +1707,8 @@ function useContractWrite(config) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
|
|
1709
1709
|
// src/hooks/contracts/usePrepareContractWrite.ts
|
|
1710
|
-
|
|
1711
|
-
|
|
1710
|
+
|
|
1711
|
+
|
|
1712
1712
|
function queryKey8({
|
|
1713
1713
|
accessList,
|
|
1714
1714
|
account,
|
|
@@ -1784,7 +1784,7 @@ function queryFn8({
|
|
|
1784
1784
|
throw new Error("address is required");
|
|
1785
1785
|
if (!functionName)
|
|
1786
1786
|
throw new Error("functionName is required");
|
|
1787
|
-
return prepareWriteContract({
|
|
1787
|
+
return _core.prepareWriteContract.call(void 0, {
|
|
1788
1788
|
abi,
|
|
1789
1789
|
accessList,
|
|
1790
1790
|
account,
|
|
@@ -1835,12 +1835,12 @@ function usePrepareContractWrite({
|
|
|
1835
1835
|
maxPriorityFeePerGas,
|
|
1836
1836
|
nonce,
|
|
1837
1837
|
value
|
|
1838
|
-
} = getCallParameters(config);
|
|
1838
|
+
} = _internal.getCallParameters.call(void 0, config);
|
|
1839
1839
|
const prepareContractWriteQuery = useQuery(
|
|
1840
1840
|
queryKey8({
|
|
1841
1841
|
accessList,
|
|
1842
1842
|
account,
|
|
1843
|
-
activeChainId: activeChain
|
|
1843
|
+
activeChainId: _optionalChain([activeChain, 'optionalAccess', _38 => _38.id]),
|
|
1844
1844
|
address,
|
|
1845
1845
|
args,
|
|
1846
1846
|
blockNumber,
|
|
@@ -1854,7 +1854,7 @@ function usePrepareContractWrite({
|
|
|
1854
1854
|
maxPriorityFeePerGas,
|
|
1855
1855
|
nonce,
|
|
1856
1856
|
scopeKey,
|
|
1857
|
-
walletClientAddress: walletClient
|
|
1857
|
+
walletClientAddress: _optionalChain([walletClient, 'optionalAccess', _39 => _39.account, 'access', _40 => _40.address]),
|
|
1858
1858
|
value
|
|
1859
1859
|
}),
|
|
1860
1860
|
queryFn8({
|
|
@@ -1884,7 +1884,7 @@ function usePrepareContractWrite({
|
|
|
1884
1884
|
}
|
|
1885
1885
|
|
|
1886
1886
|
// src/hooks/contracts/useToken.ts
|
|
1887
|
-
|
|
1887
|
+
|
|
1888
1888
|
function queryKey9({
|
|
1889
1889
|
address,
|
|
1890
1890
|
chainId,
|
|
@@ -1898,7 +1898,7 @@ function queryFn9({
|
|
|
1898
1898
|
}) {
|
|
1899
1899
|
if (!address)
|
|
1900
1900
|
throw new Error("address is required");
|
|
1901
|
-
return fetchToken({ address, chainId, formatUnits });
|
|
1901
|
+
return _core.fetchToken.call(void 0, { address, chainId, formatUnits });
|
|
1902
1902
|
}
|
|
1903
1903
|
function useToken({
|
|
1904
1904
|
address,
|
|
@@ -1930,7 +1930,7 @@ function useToken({
|
|
|
1930
1930
|
}
|
|
1931
1931
|
|
|
1932
1932
|
// src/hooks/ens/useEnsAddress.ts
|
|
1933
|
-
|
|
1933
|
+
|
|
1934
1934
|
function queryKey10({ chainId, name, scopeKey }) {
|
|
1935
1935
|
return [{ entity: "ensAddress", chainId, name, scopeKey }];
|
|
1936
1936
|
}
|
|
@@ -1939,7 +1939,7 @@ function queryFn10({
|
|
|
1939
1939
|
}) {
|
|
1940
1940
|
if (!name)
|
|
1941
1941
|
throw new Error("name is required");
|
|
1942
|
-
return fetchEnsAddress({ chainId, name });
|
|
1942
|
+
return _core.fetchEnsAddress.call(void 0, { chainId, name });
|
|
1943
1943
|
}
|
|
1944
1944
|
function useEnsAddress({
|
|
1945
1945
|
cacheTime,
|
|
@@ -1966,7 +1966,7 @@ function useEnsAddress({
|
|
|
1966
1966
|
}
|
|
1967
1967
|
|
|
1968
1968
|
// src/hooks/ens/useEnsAvatar.ts
|
|
1969
|
-
|
|
1969
|
+
|
|
1970
1970
|
function queryKey11({ name, chainId, scopeKey }) {
|
|
1971
1971
|
return [{ entity: "ensAvatar", name, chainId, scopeKey }];
|
|
1972
1972
|
}
|
|
@@ -1975,7 +1975,7 @@ function queryFn11({
|
|
|
1975
1975
|
}) {
|
|
1976
1976
|
if (!name)
|
|
1977
1977
|
throw new Error("name is required");
|
|
1978
|
-
return fetchEnsAvatar({ name, chainId });
|
|
1978
|
+
return _core.fetchEnsAvatar.call(void 0, { name, chainId });
|
|
1979
1979
|
}
|
|
1980
1980
|
function useEnsAvatar({
|
|
1981
1981
|
cacheTime,
|
|
@@ -2002,7 +2002,7 @@ function useEnsAvatar({
|
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
2004
2004
|
// src/hooks/ens/useEnsName.ts
|
|
2005
|
-
|
|
2005
|
+
|
|
2006
2006
|
function queryKey12({
|
|
2007
2007
|
address,
|
|
2008
2008
|
chainId,
|
|
@@ -2015,7 +2015,7 @@ function queryFn12({
|
|
|
2015
2015
|
}) {
|
|
2016
2016
|
if (!address)
|
|
2017
2017
|
throw new Error("address is required");
|
|
2018
|
-
return fetchEnsName({ address, chainId });
|
|
2018
|
+
return _core.fetchEnsName.call(void 0, { address, chainId });
|
|
2019
2019
|
}
|
|
2020
2020
|
function useEnsName({
|
|
2021
2021
|
address,
|
|
@@ -2042,7 +2042,7 @@ function useEnsName({
|
|
|
2042
2042
|
}
|
|
2043
2043
|
|
|
2044
2044
|
// src/hooks/ens/useEnsResolver.ts
|
|
2045
|
-
|
|
2045
|
+
|
|
2046
2046
|
function queryKey13({ chainId, name, scopeKey }) {
|
|
2047
2047
|
return [
|
|
2048
2048
|
{ entity: "ensResolver", chainId, name, scopeKey, persist: false }
|
|
@@ -2053,7 +2053,7 @@ function queryFn13({
|
|
|
2053
2053
|
}) {
|
|
2054
2054
|
if (!name)
|
|
2055
2055
|
throw new Error("name is required");
|
|
2056
|
-
return fetchEnsResolver({ chainId, name });
|
|
2056
|
+
return _core.fetchEnsResolver.call(void 0, { chainId, name });
|
|
2057
2057
|
}
|
|
2058
2058
|
function useEnsResolver({
|
|
2059
2059
|
chainId: chainId_,
|
|
@@ -2077,7 +2077,7 @@ function useEnsResolver({
|
|
|
2077
2077
|
}
|
|
2078
2078
|
|
|
2079
2079
|
// src/hooks/transactions/usePrepareSendTransaction.ts
|
|
2080
|
-
|
|
2080
|
+
|
|
2081
2081
|
function queryKey14({
|
|
2082
2082
|
accessList,
|
|
2083
2083
|
account,
|
|
@@ -2134,7 +2134,7 @@ function queryFn14({ walletClient }) {
|
|
|
2134
2134
|
}) => {
|
|
2135
2135
|
if (!to)
|
|
2136
2136
|
throw new Error("to is required");
|
|
2137
|
-
return prepareSendTransaction({
|
|
2137
|
+
return _core.prepareSendTransaction.call(void 0, {
|
|
2138
2138
|
accessList,
|
|
2139
2139
|
account,
|
|
2140
2140
|
chainId,
|
|
@@ -2176,7 +2176,7 @@ function usePrepareSendTransaction({
|
|
|
2176
2176
|
const prepareSendTransactionQuery = useQuery(
|
|
2177
2177
|
queryKey14({
|
|
2178
2178
|
accessList,
|
|
2179
|
-
activeChainId: activeChain
|
|
2179
|
+
activeChainId: _optionalChain([activeChain, 'optionalAccess', _41 => _41.id]),
|
|
2180
2180
|
account,
|
|
2181
2181
|
chainId,
|
|
2182
2182
|
data,
|
|
@@ -2188,7 +2188,7 @@ function usePrepareSendTransaction({
|
|
|
2188
2188
|
scopeKey,
|
|
2189
2189
|
to,
|
|
2190
2190
|
value,
|
|
2191
|
-
walletClientAddress: walletClient
|
|
2191
|
+
walletClientAddress: _optionalChain([walletClient, 'optionalAccess', _42 => _42.account, 'access', _43 => _43.address])
|
|
2192
2192
|
}),
|
|
2193
2193
|
queryFn14({ walletClient }),
|
|
2194
2194
|
{
|
|
@@ -2210,8 +2210,8 @@ function usePrepareSendTransaction({
|
|
|
2210
2210
|
}
|
|
2211
2211
|
|
|
2212
2212
|
// src/hooks/transactions/useSendTransaction.ts
|
|
2213
|
-
|
|
2214
|
-
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
2215
|
var mutationKey7 = (args) => [{ entity: "sendTransaction", ...args }];
|
|
2216
2216
|
var mutationFn7 = ({
|
|
2217
2217
|
accessList,
|
|
@@ -2229,7 +2229,7 @@ var mutationFn7 = ({
|
|
|
2229
2229
|
}) => {
|
|
2230
2230
|
if (!to)
|
|
2231
2231
|
throw new Error("to is required.");
|
|
2232
|
-
return sendTransaction({
|
|
2232
|
+
return _core.sendTransaction.call(void 0, {
|
|
2233
2233
|
accessList,
|
|
2234
2234
|
account,
|
|
2235
2235
|
chainId,
|
|
@@ -2383,7 +2383,7 @@ function useSendTransaction({
|
|
|
2383
2383
|
}
|
|
2384
2384
|
|
|
2385
2385
|
// src/hooks/transactions/useTransaction.ts
|
|
2386
|
-
|
|
2386
|
+
|
|
2387
2387
|
function queryKey15({ chainId, hash, scopeKey }) {
|
|
2388
2388
|
return [{ entity: "transaction", chainId, hash, scopeKey }];
|
|
2389
2389
|
}
|
|
@@ -2392,7 +2392,7 @@ function queryFn15({
|
|
|
2392
2392
|
}) {
|
|
2393
2393
|
if (!hash)
|
|
2394
2394
|
throw new Error("hash is required");
|
|
2395
|
-
return fetchTransaction({ chainId, hash });
|
|
2395
|
+
return _core.fetchTransaction.call(void 0, { chainId, hash });
|
|
2396
2396
|
}
|
|
2397
2397
|
function useTransaction({
|
|
2398
2398
|
cacheTime = 0,
|
|
@@ -2419,7 +2419,7 @@ function useTransaction({
|
|
|
2419
2419
|
}
|
|
2420
2420
|
|
|
2421
2421
|
// src/hooks/transactions/useWaitForTransaction.ts
|
|
2422
|
-
|
|
2422
|
+
|
|
2423
2423
|
function queryKey16({
|
|
2424
2424
|
confirmations,
|
|
2425
2425
|
chainId,
|
|
@@ -2446,7 +2446,7 @@ function queryFn16({
|
|
|
2446
2446
|
}) => {
|
|
2447
2447
|
if (!hash)
|
|
2448
2448
|
throw new Error("hash is required");
|
|
2449
|
-
return waitForTransaction({
|
|
2449
|
+
return _core.waitForTransaction.call(void 0, {
|
|
2450
2450
|
chainId,
|
|
2451
2451
|
confirmations,
|
|
2452
2452
|
hash,
|
|
@@ -2487,7 +2487,7 @@ function useWaitForTransaction({
|
|
|
2487
2487
|
}
|
|
2488
2488
|
|
|
2489
2489
|
// src/hooks/transactions/useWatchPendingTransactions.ts
|
|
2490
|
-
|
|
2490
|
+
|
|
2491
2491
|
function useWatchPendingTransactions({
|
|
2492
2492
|
chainId: chainId_,
|
|
2493
2493
|
enabled = true,
|
|
@@ -2499,7 +2499,7 @@ function useWatchPendingTransactions({
|
|
|
2499
2499
|
React21.useEffect(() => {
|
|
2500
2500
|
if (!enabled)
|
|
2501
2501
|
return;
|
|
2502
|
-
const publicClient_ = webSocketPublicClient
|
|
2502
|
+
const publicClient_ = _nullishCoalesce(webSocketPublicClient, () => ( publicClient));
|
|
2503
2503
|
return publicClient_.watchPendingTransactions({
|
|
2504
2504
|
onTransactions: listener
|
|
2505
2505
|
});
|
|
@@ -2507,81 +2507,81 @@ function useWatchPendingTransactions({
|
|
|
2507
2507
|
}
|
|
2508
2508
|
|
|
2509
2509
|
// src/index.ts
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
|
|
2520
|
+
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
var _chains = require('viem/chains');
|
|
2529
|
+
|
|
2530
|
+
|
|
2531
|
+
|
|
2532
|
+
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
|
|
2536
|
+
|
|
2537
|
+
|
|
2538
|
+
|
|
2539
|
+
|
|
2540
|
+
|
|
2541
|
+
|
|
2542
|
+
|
|
2543
|
+
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
|
|
2550
|
+
|
|
2551
|
+
|
|
2552
|
+
|
|
2553
|
+
|
|
2554
|
+
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
|
|
2558
|
+
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
|
|
2564
|
+
|
|
2565
|
+
|
|
2566
|
+
|
|
2567
|
+
|
|
2568
|
+
|
|
2569
|
+
|
|
2570
|
+
|
|
2571
|
+
|
|
2572
|
+
|
|
2573
|
+
|
|
2574
|
+
|
|
2575
|
+
|
|
2576
|
+
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
|
|
2583
|
+
|
|
2584
|
+
|
|
2585
|
+
|
|
2586
|
+
|
|
2587
|
+
exports.ChainMismatchError = _core.ChainMismatchError; exports.ChainNotConfiguredError = _core.ChainNotConfiguredError; exports.ConfigChainsNotFound = _core.ConfigChainsNotFound; exports.Connector = _core.Connector; exports.ConnectorAlreadyConnectedError = _core.ConnectorAlreadyConnectedError; exports.ConnectorNotFoundError = _core.ConnectorNotFoundError; exports.Context = Context; exports.SwitchChainNotSupportedError = _core.SwitchChainNotSupportedError; exports.WagmiConfig = WagmiConfig; exports.configureChains = _core.configureChains; exports.createConfig = createConfig; exports.createStorage = _core.createStorage; exports.deepEqual = _core.deepEqual; exports.deserialize = _core.deserialize; exports.erc20ABI = _core.erc20ABI; exports.erc4626ABI = _core.erc4626ABI; exports.erc721ABI = _core.erc721ABI; exports.mainnet = _chains.mainnet; exports.paginatedIndexesConfig = paginatedIndexesConfig; exports.readContracts = _core.readContracts; exports.sepolia = _chains.sepolia; exports.serialize = _core.serialize; exports.useAccount = useAccount; exports.useBalance = useBalance; exports.useBlockNumber = useBlockNumber; exports.useChainId = useChainId; exports.useConfig = useConfig; exports.useConnect = useConnect; exports.useContractEvent = useContractEvent; exports.useContractInfiniteReads = useContractInfiniteReads; exports.useContractRead = useContractRead; exports.useContractReads = useContractReads; exports.useContractWrite = useContractWrite; exports.useDisconnect = useDisconnect; exports.useEnsAddress = useEnsAddress; exports.useEnsAvatar = useEnsAvatar; exports.useEnsName = useEnsName; exports.useEnsResolver = useEnsResolver; exports.useFeeData = useFeeData; exports.useInfiniteQuery = useInfiniteQuery; exports.useMutation = useMutation; exports.useNetwork = useNetwork; exports.usePrepareContractWrite = usePrepareContractWrite; exports.usePrepareSendTransaction = usePrepareSendTransaction; exports.usePublicClient = usePublicClient; exports.useQuery = useQuery; exports.useQueryClient = useQueryClient2; exports.useSendTransaction = useSendTransaction; exports.useSignMessage = useSignMessage; exports.useSignTypedData = useSignTypedData; exports.useSwitchNetwork = useSwitchNetwork; exports.useToken = useToken; exports.useTransaction = useTransaction; exports.useWaitForTransaction = useWaitForTransaction; exports.useWalletClient = useWalletClient; exports.useWatchPendingTransactions = useWatchPendingTransactions; exports.useWebSocketPublicClient = useWebSocketPublicClient;
|