@chipi-stack/chipi-react 11.3.0 → 11.4.0
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/hooks.d.mts +351 -10
- package/dist/hooks.d.ts +351 -10
- package/dist/hooks.js +50 -30
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +51 -32
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +50 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/hooks.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { CreateWalletParams, CreateWalletResponse, GetWalletParams, WalletData, TransferParams, ApproveParams, StakeVesuUsdcParams, WithdrawVesuUsdcParams, CallAnyContractParams, RecordSendTransactionParams, Transaction } from '@chipi-stack/types';
|
|
1
|
+
import { CreateWalletParams, CreateWalletResponse, GetWalletParams, WalletData, TransferParams, ApproveParams, StakeVesuUsdcParams, WithdrawVesuUsdcParams, CallAnyContractParams, RecordSendTransactionParams, Transaction, GetTokenBalanceParams, GetTokenBalanceResponse } from '@chipi-stack/types';
|
|
2
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
4
|
|
|
3
5
|
type CreateWalletInput = {
|
|
4
6
|
params: CreateWalletParams;
|
|
@@ -18,15 +20,179 @@ declare function useCreateWallet(): {
|
|
|
18
20
|
reset: () => void;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
type GetWalletInput = {
|
|
24
|
+
params?: GetWalletParams;
|
|
25
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
26
|
+
queryOptions?: Omit<UseQueryOptions<WalletData, Error>, 'queryKey' | 'queryFn'>;
|
|
27
|
+
};
|
|
28
|
+
declare function useGetWallet(input?: GetWalletInput): {
|
|
29
|
+
fetchWallet: (newInput: GetWalletInput) => Promise<WalletData>;
|
|
30
|
+
data: WalletData;
|
|
31
|
+
error: Error;
|
|
32
|
+
isError: true;
|
|
33
|
+
isPending: false;
|
|
34
|
+
isLoading: false;
|
|
35
|
+
isLoadingError: false;
|
|
36
|
+
isRefetchError: true;
|
|
37
|
+
isSuccess: false;
|
|
38
|
+
isPlaceholderData: false;
|
|
39
|
+
status: "error";
|
|
40
|
+
dataUpdatedAt: number;
|
|
41
|
+
errorUpdatedAt: number;
|
|
42
|
+
failureCount: number;
|
|
43
|
+
failureReason: Error | null;
|
|
44
|
+
errorUpdateCount: number;
|
|
45
|
+
isFetched: boolean;
|
|
46
|
+
isFetchedAfterMount: boolean;
|
|
47
|
+
isFetching: boolean;
|
|
48
|
+
isInitialLoading: boolean;
|
|
49
|
+
isPaused: boolean;
|
|
50
|
+
isRefetching: boolean;
|
|
51
|
+
isStale: boolean;
|
|
52
|
+
isEnabled: boolean;
|
|
53
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<WalletData, Error>>;
|
|
54
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
55
|
+
promise: Promise<WalletData>;
|
|
56
|
+
} | {
|
|
57
|
+
fetchWallet: (newInput: GetWalletInput) => Promise<WalletData>;
|
|
58
|
+
data: WalletData;
|
|
59
|
+
error: null;
|
|
60
|
+
isError: false;
|
|
61
|
+
isPending: false;
|
|
62
|
+
isLoading: false;
|
|
63
|
+
isLoadingError: false;
|
|
64
|
+
isRefetchError: false;
|
|
65
|
+
isSuccess: true;
|
|
66
|
+
isPlaceholderData: false;
|
|
67
|
+
status: "success";
|
|
68
|
+
dataUpdatedAt: number;
|
|
69
|
+
errorUpdatedAt: number;
|
|
70
|
+
failureCount: number;
|
|
71
|
+
failureReason: Error | null;
|
|
72
|
+
errorUpdateCount: number;
|
|
73
|
+
isFetched: boolean;
|
|
74
|
+
isFetchedAfterMount: boolean;
|
|
75
|
+
isFetching: boolean;
|
|
76
|
+
isInitialLoading: boolean;
|
|
77
|
+
isPaused: boolean;
|
|
78
|
+
isRefetching: boolean;
|
|
79
|
+
isStale: boolean;
|
|
80
|
+
isEnabled: boolean;
|
|
81
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<WalletData, Error>>;
|
|
82
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
83
|
+
promise: Promise<WalletData>;
|
|
84
|
+
} | {
|
|
85
|
+
fetchWallet: (newInput: GetWalletInput) => Promise<WalletData>;
|
|
86
|
+
data: undefined;
|
|
87
|
+
error: Error;
|
|
88
|
+
isError: true;
|
|
89
|
+
isPending: false;
|
|
90
|
+
isLoading: false;
|
|
91
|
+
isLoadingError: true;
|
|
92
|
+
isRefetchError: false;
|
|
93
|
+
isSuccess: false;
|
|
94
|
+
isPlaceholderData: false;
|
|
95
|
+
status: "error";
|
|
96
|
+
dataUpdatedAt: number;
|
|
97
|
+
errorUpdatedAt: number;
|
|
98
|
+
failureCount: number;
|
|
99
|
+
failureReason: Error | null;
|
|
100
|
+
errorUpdateCount: number;
|
|
101
|
+
isFetched: boolean;
|
|
102
|
+
isFetchedAfterMount: boolean;
|
|
103
|
+
isFetching: boolean;
|
|
104
|
+
isInitialLoading: boolean;
|
|
105
|
+
isPaused: boolean;
|
|
106
|
+
isRefetching: boolean;
|
|
107
|
+
isStale: boolean;
|
|
108
|
+
isEnabled: boolean;
|
|
109
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<WalletData, Error>>;
|
|
110
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
111
|
+
promise: Promise<WalletData>;
|
|
112
|
+
} | {
|
|
113
|
+
fetchWallet: (newInput: GetWalletInput) => Promise<WalletData>;
|
|
114
|
+
data: undefined;
|
|
115
|
+
error: null;
|
|
116
|
+
isError: false;
|
|
117
|
+
isPending: true;
|
|
118
|
+
isLoading: true;
|
|
119
|
+
isLoadingError: false;
|
|
120
|
+
isRefetchError: false;
|
|
121
|
+
isSuccess: false;
|
|
122
|
+
isPlaceholderData: false;
|
|
123
|
+
status: "pending";
|
|
124
|
+
dataUpdatedAt: number;
|
|
125
|
+
errorUpdatedAt: number;
|
|
126
|
+
failureCount: number;
|
|
127
|
+
failureReason: Error | null;
|
|
128
|
+
errorUpdateCount: number;
|
|
129
|
+
isFetched: boolean;
|
|
130
|
+
isFetchedAfterMount: boolean;
|
|
131
|
+
isFetching: boolean;
|
|
132
|
+
isInitialLoading: boolean;
|
|
133
|
+
isPaused: boolean;
|
|
134
|
+
isRefetching: boolean;
|
|
135
|
+
isStale: boolean;
|
|
136
|
+
isEnabled: boolean;
|
|
137
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<WalletData, Error>>;
|
|
138
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
139
|
+
promise: Promise<WalletData>;
|
|
140
|
+
} | {
|
|
141
|
+
fetchWallet: (newInput: GetWalletInput) => Promise<WalletData>;
|
|
142
|
+
data: undefined;
|
|
143
|
+
error: null;
|
|
144
|
+
isError: false;
|
|
145
|
+
isPending: true;
|
|
146
|
+
isLoadingError: false;
|
|
147
|
+
isRefetchError: false;
|
|
148
|
+
isSuccess: false;
|
|
149
|
+
isPlaceholderData: false;
|
|
150
|
+
status: "pending";
|
|
151
|
+
dataUpdatedAt: number;
|
|
152
|
+
errorUpdatedAt: number;
|
|
153
|
+
failureCount: number;
|
|
154
|
+
failureReason: Error | null;
|
|
155
|
+
errorUpdateCount: number;
|
|
156
|
+
isFetched: boolean;
|
|
157
|
+
isFetchedAfterMount: boolean;
|
|
158
|
+
isFetching: boolean;
|
|
25
159
|
isLoading: boolean;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
160
|
+
isInitialLoading: boolean;
|
|
161
|
+
isPaused: boolean;
|
|
162
|
+
isRefetching: boolean;
|
|
163
|
+
isStale: boolean;
|
|
164
|
+
isEnabled: boolean;
|
|
165
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<WalletData, Error>>;
|
|
166
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
167
|
+
promise: Promise<WalletData>;
|
|
168
|
+
} | {
|
|
169
|
+
fetchWallet: (newInput: GetWalletInput) => Promise<WalletData>;
|
|
170
|
+
data: WalletData;
|
|
171
|
+
isError: false;
|
|
172
|
+
error: null;
|
|
173
|
+
isPending: false;
|
|
174
|
+
isLoading: false;
|
|
175
|
+
isLoadingError: false;
|
|
176
|
+
isRefetchError: false;
|
|
177
|
+
isSuccess: true;
|
|
178
|
+
isPlaceholderData: true;
|
|
179
|
+
status: "success";
|
|
180
|
+
dataUpdatedAt: number;
|
|
181
|
+
errorUpdatedAt: number;
|
|
182
|
+
failureCount: number;
|
|
183
|
+
failureReason: Error | null;
|
|
184
|
+
errorUpdateCount: number;
|
|
185
|
+
isFetched: boolean;
|
|
186
|
+
isFetchedAfterMount: boolean;
|
|
187
|
+
isFetching: boolean;
|
|
188
|
+
isInitialLoading: boolean;
|
|
189
|
+
isPaused: boolean;
|
|
190
|
+
isRefetching: boolean;
|
|
191
|
+
isStale: boolean;
|
|
192
|
+
isEnabled: boolean;
|
|
193
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<WalletData, Error>>;
|
|
194
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
195
|
+
promise: Promise<WalletData>;
|
|
30
196
|
};
|
|
31
197
|
|
|
32
198
|
type TransferInput = {
|
|
@@ -134,4 +300,179 @@ declare function useRecordSendTransaction(): {
|
|
|
134
300
|
reset: () => void;
|
|
135
301
|
};
|
|
136
302
|
|
|
137
|
-
|
|
303
|
+
type GetTokenBalanceInput = {
|
|
304
|
+
params?: GetTokenBalanceParams;
|
|
305
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
306
|
+
queryOptions?: Omit<UseQueryOptions<GetTokenBalanceResponse, Error>, 'queryKey' | 'queryFn'>;
|
|
307
|
+
};
|
|
308
|
+
declare function useGetTokenBalance(input?: GetTokenBalanceInput): {
|
|
309
|
+
fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
|
|
310
|
+
data: GetTokenBalanceResponse;
|
|
311
|
+
error: Error;
|
|
312
|
+
isError: true;
|
|
313
|
+
isPending: false;
|
|
314
|
+
isLoading: false;
|
|
315
|
+
isLoadingError: false;
|
|
316
|
+
isRefetchError: true;
|
|
317
|
+
isSuccess: false;
|
|
318
|
+
isPlaceholderData: false;
|
|
319
|
+
status: "error";
|
|
320
|
+
dataUpdatedAt: number;
|
|
321
|
+
errorUpdatedAt: number;
|
|
322
|
+
failureCount: number;
|
|
323
|
+
failureReason: Error | null;
|
|
324
|
+
errorUpdateCount: number;
|
|
325
|
+
isFetched: boolean;
|
|
326
|
+
isFetchedAfterMount: boolean;
|
|
327
|
+
isFetching: boolean;
|
|
328
|
+
isInitialLoading: boolean;
|
|
329
|
+
isPaused: boolean;
|
|
330
|
+
isRefetching: boolean;
|
|
331
|
+
isStale: boolean;
|
|
332
|
+
isEnabled: boolean;
|
|
333
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
|
|
334
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
335
|
+
promise: Promise<GetTokenBalanceResponse>;
|
|
336
|
+
} | {
|
|
337
|
+
fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
|
|
338
|
+
data: GetTokenBalanceResponse;
|
|
339
|
+
error: null;
|
|
340
|
+
isError: false;
|
|
341
|
+
isPending: false;
|
|
342
|
+
isLoading: false;
|
|
343
|
+
isLoadingError: false;
|
|
344
|
+
isRefetchError: false;
|
|
345
|
+
isSuccess: true;
|
|
346
|
+
isPlaceholderData: false;
|
|
347
|
+
status: "success";
|
|
348
|
+
dataUpdatedAt: number;
|
|
349
|
+
errorUpdatedAt: number;
|
|
350
|
+
failureCount: number;
|
|
351
|
+
failureReason: Error | null;
|
|
352
|
+
errorUpdateCount: number;
|
|
353
|
+
isFetched: boolean;
|
|
354
|
+
isFetchedAfterMount: boolean;
|
|
355
|
+
isFetching: boolean;
|
|
356
|
+
isInitialLoading: boolean;
|
|
357
|
+
isPaused: boolean;
|
|
358
|
+
isRefetching: boolean;
|
|
359
|
+
isStale: boolean;
|
|
360
|
+
isEnabled: boolean;
|
|
361
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
|
|
362
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
363
|
+
promise: Promise<GetTokenBalanceResponse>;
|
|
364
|
+
} | {
|
|
365
|
+
fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
|
|
366
|
+
data: undefined;
|
|
367
|
+
error: Error;
|
|
368
|
+
isError: true;
|
|
369
|
+
isPending: false;
|
|
370
|
+
isLoading: false;
|
|
371
|
+
isLoadingError: true;
|
|
372
|
+
isRefetchError: false;
|
|
373
|
+
isSuccess: false;
|
|
374
|
+
isPlaceholderData: false;
|
|
375
|
+
status: "error";
|
|
376
|
+
dataUpdatedAt: number;
|
|
377
|
+
errorUpdatedAt: number;
|
|
378
|
+
failureCount: number;
|
|
379
|
+
failureReason: Error | null;
|
|
380
|
+
errorUpdateCount: number;
|
|
381
|
+
isFetched: boolean;
|
|
382
|
+
isFetchedAfterMount: boolean;
|
|
383
|
+
isFetching: boolean;
|
|
384
|
+
isInitialLoading: boolean;
|
|
385
|
+
isPaused: boolean;
|
|
386
|
+
isRefetching: boolean;
|
|
387
|
+
isStale: boolean;
|
|
388
|
+
isEnabled: boolean;
|
|
389
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
|
|
390
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
391
|
+
promise: Promise<GetTokenBalanceResponse>;
|
|
392
|
+
} | {
|
|
393
|
+
fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
|
|
394
|
+
data: undefined;
|
|
395
|
+
error: null;
|
|
396
|
+
isError: false;
|
|
397
|
+
isPending: true;
|
|
398
|
+
isLoading: true;
|
|
399
|
+
isLoadingError: false;
|
|
400
|
+
isRefetchError: false;
|
|
401
|
+
isSuccess: false;
|
|
402
|
+
isPlaceholderData: false;
|
|
403
|
+
status: "pending";
|
|
404
|
+
dataUpdatedAt: number;
|
|
405
|
+
errorUpdatedAt: number;
|
|
406
|
+
failureCount: number;
|
|
407
|
+
failureReason: Error | null;
|
|
408
|
+
errorUpdateCount: number;
|
|
409
|
+
isFetched: boolean;
|
|
410
|
+
isFetchedAfterMount: boolean;
|
|
411
|
+
isFetching: boolean;
|
|
412
|
+
isInitialLoading: boolean;
|
|
413
|
+
isPaused: boolean;
|
|
414
|
+
isRefetching: boolean;
|
|
415
|
+
isStale: boolean;
|
|
416
|
+
isEnabled: boolean;
|
|
417
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
|
|
418
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
419
|
+
promise: Promise<GetTokenBalanceResponse>;
|
|
420
|
+
} | {
|
|
421
|
+
fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
|
|
422
|
+
data: undefined;
|
|
423
|
+
error: null;
|
|
424
|
+
isError: false;
|
|
425
|
+
isPending: true;
|
|
426
|
+
isLoadingError: false;
|
|
427
|
+
isRefetchError: false;
|
|
428
|
+
isSuccess: false;
|
|
429
|
+
isPlaceholderData: false;
|
|
430
|
+
status: "pending";
|
|
431
|
+
dataUpdatedAt: number;
|
|
432
|
+
errorUpdatedAt: number;
|
|
433
|
+
failureCount: number;
|
|
434
|
+
failureReason: Error | null;
|
|
435
|
+
errorUpdateCount: number;
|
|
436
|
+
isFetched: boolean;
|
|
437
|
+
isFetchedAfterMount: boolean;
|
|
438
|
+
isFetching: boolean;
|
|
439
|
+
isLoading: boolean;
|
|
440
|
+
isInitialLoading: boolean;
|
|
441
|
+
isPaused: boolean;
|
|
442
|
+
isRefetching: boolean;
|
|
443
|
+
isStale: boolean;
|
|
444
|
+
isEnabled: boolean;
|
|
445
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
|
|
446
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
447
|
+
promise: Promise<GetTokenBalanceResponse>;
|
|
448
|
+
} | {
|
|
449
|
+
fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
|
|
450
|
+
data: GetTokenBalanceResponse;
|
|
451
|
+
isError: false;
|
|
452
|
+
error: null;
|
|
453
|
+
isPending: false;
|
|
454
|
+
isLoading: false;
|
|
455
|
+
isLoadingError: false;
|
|
456
|
+
isRefetchError: false;
|
|
457
|
+
isSuccess: true;
|
|
458
|
+
isPlaceholderData: true;
|
|
459
|
+
status: "success";
|
|
460
|
+
dataUpdatedAt: number;
|
|
461
|
+
errorUpdatedAt: number;
|
|
462
|
+
failureCount: number;
|
|
463
|
+
failureReason: Error | null;
|
|
464
|
+
errorUpdateCount: number;
|
|
465
|
+
isFetched: boolean;
|
|
466
|
+
isFetchedAfterMount: boolean;
|
|
467
|
+
isFetching: boolean;
|
|
468
|
+
isInitialLoading: boolean;
|
|
469
|
+
isPaused: boolean;
|
|
470
|
+
isRefetching: boolean;
|
|
471
|
+
isStale: boolean;
|
|
472
|
+
isEnabled: boolean;
|
|
473
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
|
|
474
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
475
|
+
promise: Promise<GetTokenBalanceResponse>;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
export { useApprove, useCallAnyContract, useCreateWallet, useGetTokenBalance, useGetWallet, useRecordSendTransaction, useStakeVesuUsdc, useTransfer, useWithdrawVesuUsdc };
|