@chipi-stack/chipi-react 11.15.0 → 11.16.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 +177 -2
- package/dist/hooks.d.ts +177 -2
- package/dist/hooks.js +53 -0
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +53 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/hooks.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, TransferHookInput, ApproveHookInput, CreateSkuTransactionParams, SkuTransaction, GetSkuListQuery,
|
|
1
|
+
import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, TransferHookInput, ApproveHookInput, GetTransactionListQuery, PaginatedResponse, Transaction, CreateSkuTransactionParams, SkuTransaction, GetSkuListQuery, Sku, StakeVesuUsdcHookInputParams, WithdrawVesuUsdcHookInputParams, CallAnyContractParams, RecordSendTransactionParams, GetTokenBalanceParams, GetTokenBalanceResponse, GetUserParams, User, CreateUserParams } from '@chipi-stack/types';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -275,6 +275,181 @@ declare function useApprove(): {
|
|
|
275
275
|
reset: () => void;
|
|
276
276
|
};
|
|
277
277
|
|
|
278
|
+
type TransactionListInput = {
|
|
279
|
+
query: GetTransactionListQuery;
|
|
280
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
281
|
+
queryOptions?: Omit<UseQueryOptions<PaginatedResponse<Transaction>, Error>, 'queryKey' | 'queryFn'>;
|
|
282
|
+
};
|
|
283
|
+
declare function useGetTransactionList(input?: TransactionListInput): {
|
|
284
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
285
|
+
data: PaginatedResponse<Transaction>;
|
|
286
|
+
error: Error;
|
|
287
|
+
isError: true;
|
|
288
|
+
isPending: false;
|
|
289
|
+
isLoading: false;
|
|
290
|
+
isLoadingError: false;
|
|
291
|
+
isRefetchError: true;
|
|
292
|
+
isSuccess: false;
|
|
293
|
+
isPlaceholderData: false;
|
|
294
|
+
status: "error";
|
|
295
|
+
dataUpdatedAt: number;
|
|
296
|
+
errorUpdatedAt: number;
|
|
297
|
+
failureCount: number;
|
|
298
|
+
failureReason: Error | null;
|
|
299
|
+
errorUpdateCount: number;
|
|
300
|
+
isFetched: boolean;
|
|
301
|
+
isFetchedAfterMount: boolean;
|
|
302
|
+
isFetching: boolean;
|
|
303
|
+
isInitialLoading: boolean;
|
|
304
|
+
isPaused: boolean;
|
|
305
|
+
isRefetching: boolean;
|
|
306
|
+
isStale: boolean;
|
|
307
|
+
isEnabled: boolean;
|
|
308
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
309
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
310
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
311
|
+
} | {
|
|
312
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
313
|
+
data: PaginatedResponse<Transaction>;
|
|
314
|
+
error: null;
|
|
315
|
+
isError: false;
|
|
316
|
+
isPending: false;
|
|
317
|
+
isLoading: false;
|
|
318
|
+
isLoadingError: false;
|
|
319
|
+
isRefetchError: false;
|
|
320
|
+
isSuccess: true;
|
|
321
|
+
isPlaceholderData: false;
|
|
322
|
+
status: "success";
|
|
323
|
+
dataUpdatedAt: number;
|
|
324
|
+
errorUpdatedAt: number;
|
|
325
|
+
failureCount: number;
|
|
326
|
+
failureReason: Error | null;
|
|
327
|
+
errorUpdateCount: number;
|
|
328
|
+
isFetched: boolean;
|
|
329
|
+
isFetchedAfterMount: boolean;
|
|
330
|
+
isFetching: boolean;
|
|
331
|
+
isInitialLoading: boolean;
|
|
332
|
+
isPaused: boolean;
|
|
333
|
+
isRefetching: boolean;
|
|
334
|
+
isStale: boolean;
|
|
335
|
+
isEnabled: boolean;
|
|
336
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
337
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
338
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
339
|
+
} | {
|
|
340
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
341
|
+
data: undefined;
|
|
342
|
+
error: Error;
|
|
343
|
+
isError: true;
|
|
344
|
+
isPending: false;
|
|
345
|
+
isLoading: false;
|
|
346
|
+
isLoadingError: true;
|
|
347
|
+
isRefetchError: false;
|
|
348
|
+
isSuccess: false;
|
|
349
|
+
isPlaceholderData: false;
|
|
350
|
+
status: "error";
|
|
351
|
+
dataUpdatedAt: number;
|
|
352
|
+
errorUpdatedAt: number;
|
|
353
|
+
failureCount: number;
|
|
354
|
+
failureReason: Error | null;
|
|
355
|
+
errorUpdateCount: number;
|
|
356
|
+
isFetched: boolean;
|
|
357
|
+
isFetchedAfterMount: boolean;
|
|
358
|
+
isFetching: boolean;
|
|
359
|
+
isInitialLoading: boolean;
|
|
360
|
+
isPaused: boolean;
|
|
361
|
+
isRefetching: boolean;
|
|
362
|
+
isStale: boolean;
|
|
363
|
+
isEnabled: boolean;
|
|
364
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
365
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
366
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
367
|
+
} | {
|
|
368
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
369
|
+
data: undefined;
|
|
370
|
+
error: null;
|
|
371
|
+
isError: false;
|
|
372
|
+
isPending: true;
|
|
373
|
+
isLoading: true;
|
|
374
|
+
isLoadingError: false;
|
|
375
|
+
isRefetchError: false;
|
|
376
|
+
isSuccess: false;
|
|
377
|
+
isPlaceholderData: false;
|
|
378
|
+
status: "pending";
|
|
379
|
+
dataUpdatedAt: number;
|
|
380
|
+
errorUpdatedAt: number;
|
|
381
|
+
failureCount: number;
|
|
382
|
+
failureReason: Error | null;
|
|
383
|
+
errorUpdateCount: number;
|
|
384
|
+
isFetched: boolean;
|
|
385
|
+
isFetchedAfterMount: boolean;
|
|
386
|
+
isFetching: boolean;
|
|
387
|
+
isInitialLoading: boolean;
|
|
388
|
+
isPaused: boolean;
|
|
389
|
+
isRefetching: boolean;
|
|
390
|
+
isStale: boolean;
|
|
391
|
+
isEnabled: boolean;
|
|
392
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
393
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
394
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
395
|
+
} | {
|
|
396
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
397
|
+
data: undefined;
|
|
398
|
+
error: null;
|
|
399
|
+
isError: false;
|
|
400
|
+
isPending: true;
|
|
401
|
+
isLoadingError: false;
|
|
402
|
+
isRefetchError: false;
|
|
403
|
+
isSuccess: false;
|
|
404
|
+
isPlaceholderData: false;
|
|
405
|
+
status: "pending";
|
|
406
|
+
dataUpdatedAt: number;
|
|
407
|
+
errorUpdatedAt: number;
|
|
408
|
+
failureCount: number;
|
|
409
|
+
failureReason: Error | null;
|
|
410
|
+
errorUpdateCount: number;
|
|
411
|
+
isFetched: boolean;
|
|
412
|
+
isFetchedAfterMount: boolean;
|
|
413
|
+
isFetching: boolean;
|
|
414
|
+
isLoading: boolean;
|
|
415
|
+
isInitialLoading: boolean;
|
|
416
|
+
isPaused: boolean;
|
|
417
|
+
isRefetching: boolean;
|
|
418
|
+
isStale: boolean;
|
|
419
|
+
isEnabled: boolean;
|
|
420
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
421
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
422
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
423
|
+
} | {
|
|
424
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
425
|
+
data: PaginatedResponse<Transaction>;
|
|
426
|
+
isError: false;
|
|
427
|
+
error: null;
|
|
428
|
+
isPending: false;
|
|
429
|
+
isLoading: false;
|
|
430
|
+
isLoadingError: false;
|
|
431
|
+
isRefetchError: false;
|
|
432
|
+
isSuccess: true;
|
|
433
|
+
isPlaceholderData: true;
|
|
434
|
+
status: "success";
|
|
435
|
+
dataUpdatedAt: number;
|
|
436
|
+
errorUpdatedAt: number;
|
|
437
|
+
failureCount: number;
|
|
438
|
+
failureReason: Error | null;
|
|
439
|
+
errorUpdateCount: number;
|
|
440
|
+
isFetched: boolean;
|
|
441
|
+
isFetchedAfterMount: boolean;
|
|
442
|
+
isFetching: boolean;
|
|
443
|
+
isInitialLoading: boolean;
|
|
444
|
+
isPaused: boolean;
|
|
445
|
+
isRefetching: boolean;
|
|
446
|
+
isStale: boolean;
|
|
447
|
+
isEnabled: boolean;
|
|
448
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
449
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
450
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
451
|
+
};
|
|
452
|
+
|
|
278
453
|
type CreateSkuTransactionInput = {
|
|
279
454
|
params: CreateSkuTransactionParams;
|
|
280
455
|
bearerToken: string;
|
|
@@ -1255,4 +1430,4 @@ declare function useCreateUser(): {
|
|
|
1255
1430
|
reset: () => void;
|
|
1256
1431
|
};
|
|
1257
1432
|
|
|
1258
|
-
export { useApprove, useCallAnyContract, useCreateSkuTransaction, useCreateUser, useCreateWallet, useGetSku, useGetSkuList, useGetSkuTransaction, useGetTokenBalance, useGetUser, useGetWallet, useRecordSendTransaction, useStakeVesuUsdc, useTransfer, useWithdrawVesuUsdc };
|
|
1433
|
+
export { useApprove, useCallAnyContract, useCreateSkuTransaction, useCreateUser, useCreateWallet, useGetSku, useGetSkuList, useGetSkuTransaction, useGetTokenBalance, useGetTransactionList, useGetUser, useGetWallet, useRecordSendTransaction, useStakeVesuUsdc, useTransfer, useWithdrawVesuUsdc };
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, TransferHookInput, ApproveHookInput, CreateSkuTransactionParams, SkuTransaction, GetSkuListQuery,
|
|
1
|
+
import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, TransferHookInput, ApproveHookInput, GetTransactionListQuery, PaginatedResponse, Transaction, CreateSkuTransactionParams, SkuTransaction, GetSkuListQuery, Sku, StakeVesuUsdcHookInputParams, WithdrawVesuUsdcHookInputParams, CallAnyContractParams, RecordSendTransactionParams, GetTokenBalanceParams, GetTokenBalanceResponse, GetUserParams, User, CreateUserParams } from '@chipi-stack/types';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -275,6 +275,181 @@ declare function useApprove(): {
|
|
|
275
275
|
reset: () => void;
|
|
276
276
|
};
|
|
277
277
|
|
|
278
|
+
type TransactionListInput = {
|
|
279
|
+
query: GetTransactionListQuery;
|
|
280
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
281
|
+
queryOptions?: Omit<UseQueryOptions<PaginatedResponse<Transaction>, Error>, 'queryKey' | 'queryFn'>;
|
|
282
|
+
};
|
|
283
|
+
declare function useGetTransactionList(input?: TransactionListInput): {
|
|
284
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
285
|
+
data: PaginatedResponse<Transaction>;
|
|
286
|
+
error: Error;
|
|
287
|
+
isError: true;
|
|
288
|
+
isPending: false;
|
|
289
|
+
isLoading: false;
|
|
290
|
+
isLoadingError: false;
|
|
291
|
+
isRefetchError: true;
|
|
292
|
+
isSuccess: false;
|
|
293
|
+
isPlaceholderData: false;
|
|
294
|
+
status: "error";
|
|
295
|
+
dataUpdatedAt: number;
|
|
296
|
+
errorUpdatedAt: number;
|
|
297
|
+
failureCount: number;
|
|
298
|
+
failureReason: Error | null;
|
|
299
|
+
errorUpdateCount: number;
|
|
300
|
+
isFetched: boolean;
|
|
301
|
+
isFetchedAfterMount: boolean;
|
|
302
|
+
isFetching: boolean;
|
|
303
|
+
isInitialLoading: boolean;
|
|
304
|
+
isPaused: boolean;
|
|
305
|
+
isRefetching: boolean;
|
|
306
|
+
isStale: boolean;
|
|
307
|
+
isEnabled: boolean;
|
|
308
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
309
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
310
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
311
|
+
} | {
|
|
312
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
313
|
+
data: PaginatedResponse<Transaction>;
|
|
314
|
+
error: null;
|
|
315
|
+
isError: false;
|
|
316
|
+
isPending: false;
|
|
317
|
+
isLoading: false;
|
|
318
|
+
isLoadingError: false;
|
|
319
|
+
isRefetchError: false;
|
|
320
|
+
isSuccess: true;
|
|
321
|
+
isPlaceholderData: false;
|
|
322
|
+
status: "success";
|
|
323
|
+
dataUpdatedAt: number;
|
|
324
|
+
errorUpdatedAt: number;
|
|
325
|
+
failureCount: number;
|
|
326
|
+
failureReason: Error | null;
|
|
327
|
+
errorUpdateCount: number;
|
|
328
|
+
isFetched: boolean;
|
|
329
|
+
isFetchedAfterMount: boolean;
|
|
330
|
+
isFetching: boolean;
|
|
331
|
+
isInitialLoading: boolean;
|
|
332
|
+
isPaused: boolean;
|
|
333
|
+
isRefetching: boolean;
|
|
334
|
+
isStale: boolean;
|
|
335
|
+
isEnabled: boolean;
|
|
336
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
337
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
338
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
339
|
+
} | {
|
|
340
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
341
|
+
data: undefined;
|
|
342
|
+
error: Error;
|
|
343
|
+
isError: true;
|
|
344
|
+
isPending: false;
|
|
345
|
+
isLoading: false;
|
|
346
|
+
isLoadingError: true;
|
|
347
|
+
isRefetchError: false;
|
|
348
|
+
isSuccess: false;
|
|
349
|
+
isPlaceholderData: false;
|
|
350
|
+
status: "error";
|
|
351
|
+
dataUpdatedAt: number;
|
|
352
|
+
errorUpdatedAt: number;
|
|
353
|
+
failureCount: number;
|
|
354
|
+
failureReason: Error | null;
|
|
355
|
+
errorUpdateCount: number;
|
|
356
|
+
isFetched: boolean;
|
|
357
|
+
isFetchedAfterMount: boolean;
|
|
358
|
+
isFetching: boolean;
|
|
359
|
+
isInitialLoading: boolean;
|
|
360
|
+
isPaused: boolean;
|
|
361
|
+
isRefetching: boolean;
|
|
362
|
+
isStale: boolean;
|
|
363
|
+
isEnabled: boolean;
|
|
364
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
365
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
366
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
367
|
+
} | {
|
|
368
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
369
|
+
data: undefined;
|
|
370
|
+
error: null;
|
|
371
|
+
isError: false;
|
|
372
|
+
isPending: true;
|
|
373
|
+
isLoading: true;
|
|
374
|
+
isLoadingError: false;
|
|
375
|
+
isRefetchError: false;
|
|
376
|
+
isSuccess: false;
|
|
377
|
+
isPlaceholderData: false;
|
|
378
|
+
status: "pending";
|
|
379
|
+
dataUpdatedAt: number;
|
|
380
|
+
errorUpdatedAt: number;
|
|
381
|
+
failureCount: number;
|
|
382
|
+
failureReason: Error | null;
|
|
383
|
+
errorUpdateCount: number;
|
|
384
|
+
isFetched: boolean;
|
|
385
|
+
isFetchedAfterMount: boolean;
|
|
386
|
+
isFetching: boolean;
|
|
387
|
+
isInitialLoading: boolean;
|
|
388
|
+
isPaused: boolean;
|
|
389
|
+
isRefetching: boolean;
|
|
390
|
+
isStale: boolean;
|
|
391
|
+
isEnabled: boolean;
|
|
392
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
393
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
394
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
395
|
+
} | {
|
|
396
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
397
|
+
data: undefined;
|
|
398
|
+
error: null;
|
|
399
|
+
isError: false;
|
|
400
|
+
isPending: true;
|
|
401
|
+
isLoadingError: false;
|
|
402
|
+
isRefetchError: false;
|
|
403
|
+
isSuccess: false;
|
|
404
|
+
isPlaceholderData: false;
|
|
405
|
+
status: "pending";
|
|
406
|
+
dataUpdatedAt: number;
|
|
407
|
+
errorUpdatedAt: number;
|
|
408
|
+
failureCount: number;
|
|
409
|
+
failureReason: Error | null;
|
|
410
|
+
errorUpdateCount: number;
|
|
411
|
+
isFetched: boolean;
|
|
412
|
+
isFetchedAfterMount: boolean;
|
|
413
|
+
isFetching: boolean;
|
|
414
|
+
isLoading: boolean;
|
|
415
|
+
isInitialLoading: boolean;
|
|
416
|
+
isPaused: boolean;
|
|
417
|
+
isRefetching: boolean;
|
|
418
|
+
isStale: boolean;
|
|
419
|
+
isEnabled: boolean;
|
|
420
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
421
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
422
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
423
|
+
} | {
|
|
424
|
+
fetchTransactionList: (newInput: TransactionListInput) => Promise<PaginatedResponse<Transaction>>;
|
|
425
|
+
data: PaginatedResponse<Transaction>;
|
|
426
|
+
isError: false;
|
|
427
|
+
error: null;
|
|
428
|
+
isPending: false;
|
|
429
|
+
isLoading: false;
|
|
430
|
+
isLoadingError: false;
|
|
431
|
+
isRefetchError: false;
|
|
432
|
+
isSuccess: true;
|
|
433
|
+
isPlaceholderData: true;
|
|
434
|
+
status: "success";
|
|
435
|
+
dataUpdatedAt: number;
|
|
436
|
+
errorUpdatedAt: number;
|
|
437
|
+
failureCount: number;
|
|
438
|
+
failureReason: Error | null;
|
|
439
|
+
errorUpdateCount: number;
|
|
440
|
+
isFetched: boolean;
|
|
441
|
+
isFetchedAfterMount: boolean;
|
|
442
|
+
isFetching: boolean;
|
|
443
|
+
isInitialLoading: boolean;
|
|
444
|
+
isPaused: boolean;
|
|
445
|
+
isRefetching: boolean;
|
|
446
|
+
isStale: boolean;
|
|
447
|
+
isEnabled: boolean;
|
|
448
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
|
|
449
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
450
|
+
promise: Promise<PaginatedResponse<Transaction>>;
|
|
451
|
+
};
|
|
452
|
+
|
|
278
453
|
type CreateSkuTransactionInput = {
|
|
279
454
|
params: CreateSkuTransactionParams;
|
|
280
455
|
bearerToken: string;
|
|
@@ -1255,4 +1430,4 @@ declare function useCreateUser(): {
|
|
|
1255
1430
|
reset: () => void;
|
|
1256
1431
|
};
|
|
1257
1432
|
|
|
1258
|
-
export { useApprove, useCallAnyContract, useCreateSkuTransaction, useCreateUser, useCreateWallet, useGetSku, useGetSkuList, useGetSkuTransaction, useGetTokenBalance, useGetUser, useGetWallet, useRecordSendTransaction, useStakeVesuUsdc, useTransfer, useWithdrawVesuUsdc };
|
|
1433
|
+
export { useApprove, useCallAnyContract, useCreateSkuTransaction, useCreateUser, useCreateWallet, useGetSku, useGetSkuList, useGetSkuTransaction, useGetTokenBalance, useGetTransactionList, useGetUser, useGetWallet, useRecordSendTransaction, useStakeVesuUsdc, useTransfer, useWithdrawVesuUsdc };
|
package/dist/hooks.js
CHANGED
|
@@ -128,6 +128,58 @@ function useApprove() {
|
|
|
128
128
|
reset: mutation.reset
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
+
function useGetTransactionList(input) {
|
|
132
|
+
const { chipiSDK } = useChipiContext();
|
|
133
|
+
const queryClient = reactQuery.useQueryClient();
|
|
134
|
+
const buildQueryKey = (q) => [
|
|
135
|
+
"transaction-list",
|
|
136
|
+
q?.page ?? 1,
|
|
137
|
+
q?.limit ?? 10,
|
|
138
|
+
q?.calledFunction ?? null,
|
|
139
|
+
q?.senderAddress ?? null,
|
|
140
|
+
q?.day ?? null,
|
|
141
|
+
q?.month ?? null,
|
|
142
|
+
q?.year ?? null
|
|
143
|
+
];
|
|
144
|
+
const query = reactQuery.useQuery({
|
|
145
|
+
queryKey: buildQueryKey(input?.query),
|
|
146
|
+
queryFn: async () => {
|
|
147
|
+
if (!input?.getBearerToken) throw new Error("getBearerToken is required");
|
|
148
|
+
const bearerToken = await input.getBearerToken();
|
|
149
|
+
if (!bearerToken) throw new Error("Bearer token is required");
|
|
150
|
+
return chipiSDK.getTransactionList(input.query, bearerToken);
|
|
151
|
+
},
|
|
152
|
+
enabled: Boolean(input?.getBearerToken),
|
|
153
|
+
retry: (failureCount, error) => {
|
|
154
|
+
if (error instanceof shared.ChipiApiError || error?.status) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
return failureCount < 3;
|
|
158
|
+
},
|
|
159
|
+
...input?.queryOptions
|
|
160
|
+
});
|
|
161
|
+
const fetchTransactionList = async (newInput) => {
|
|
162
|
+
return queryClient.fetchQuery({
|
|
163
|
+
queryKey: buildQueryKey(newInput?.query),
|
|
164
|
+
queryFn: async () => {
|
|
165
|
+
if (!newInput?.getBearerToken) throw new Error("getBearerToken is required");
|
|
166
|
+
const bearerToken = await newInput.getBearerToken();
|
|
167
|
+
if (!bearerToken) throw new Error("Bearer token is required");
|
|
168
|
+
return chipiSDK.getTransactionList(newInput.query, bearerToken);
|
|
169
|
+
},
|
|
170
|
+
retry: (failureCount, error) => {
|
|
171
|
+
if (error instanceof shared.ChipiApiError || error?.status) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
return failureCount < 3;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
return {
|
|
179
|
+
...query,
|
|
180
|
+
fetchTransactionList
|
|
181
|
+
};
|
|
182
|
+
}
|
|
131
183
|
function useCreateSkuTransaction() {
|
|
132
184
|
const { chipiSDK } = useChipiContext();
|
|
133
185
|
const mutation = reactQuery.useMutation({
|
|
@@ -489,6 +541,7 @@ exports.useGetSku = useGetSku;
|
|
|
489
541
|
exports.useGetSkuList = useGetSkuList;
|
|
490
542
|
exports.useGetSkuTransaction = useGetSkuTransaction;
|
|
491
543
|
exports.useGetTokenBalance = useGetTokenBalance;
|
|
544
|
+
exports.useGetTransactionList = useGetTransactionList;
|
|
492
545
|
exports.useGetUser = useGetUser;
|
|
493
546
|
exports.useGetWallet = useGetWallet;
|
|
494
547
|
exports.useRecordSendTransaction = useRecordSendTransaction;
|