Commit eccb7dc
authored
refactor: extract query from hook files & implement proper query lifecycle + tests (#58)
* refactor: extract tanstack queries from hooks
fix(test): fix activity-feed decryptHandles mock setup
refactor token(react-sdk): remove local query key aliases
fix(query): align query exports and fee manager key typing
refactor(sdk): deduplicate ZERO_HANDLE source
refactor(react-sdk): dedupe optimistic callback context unwrapping
🐛 fix(tests): extend timeouts for PBKDF2-heavy credential tests
Credentials-manager tests with 2+ allow() calls and events.test.ts
CredentialsExpired test run PBKDF2 with 600k iterations per encrypt/decrypt
operation, which can exceed the default 5000ms vitest timeout on CI.
Increase affected tests to 30000ms to prevent flaky timeouts.
chore: api
fix missing invalidation
chore: bump size limits
fix: jsdoc
fix: address query hook findings
fix query lifecycle and public surfaces
* minify bundle size
* chore: rebase fixes
* chore: address review
* chore: rename normalizeAddress
* refactor: align QueryFactoryOptions with TanStack types
Derive QueryFactoryOptions from QueryObserverOptions (wagmi pattern)
instead of a custom hand-rolled interface. This removes the
`as unknown as UseQueryOptions` double-cast from every React hook.
- Rewrite QueryFactoryOptions to wrap QueryObserverOptions from
@tanstack/query-core, making queryKey required and queryFn non-optional
- Delete QueryContext (replaced by TanStack's QueryFunctionContext)
- Add shared useQuery/useSuspenseQuery wrapper in react-sdk that injects
queryKeyHashFn in one place (single `as any`, wagmi pattern)
- Remove all `as unknown as UseQueryOptions<...>` casts from 11 hooks
- Add mockQueryContext helper and update 15 test files to pass real
TanStack context shape (client, signal, meta) without `as any`
* chore: api-report1 parent a830251 commit eccb7dc
190 files changed
Lines changed: 10385 additions & 4036 deletions
File tree
- docs/gitbook/src/guides/react-sdk
- packages
- react-sdk
- etc
- src
- __tests__
- relayer
- __tests__
- token
- __tests__
- utils
- wagmi
- sdk
- etc
- src
- __tests__
- query
- __tests__
- token
- __tests__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
| 636 | + | |
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 48 | + | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| |||
365 | 363 | | |
366 | 364 | | |
367 | 365 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
| 797 | + | |
798 | 798 | | |
799 | 799 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
| 800 | + | |
811 | 801 | | |
812 | 802 | | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
824 | 814 | | |
825 | 815 | | |
826 | 816 | | |
827 | | - | |
| 817 | + | |
828 | 818 | | |
829 | 819 | | |
830 | 820 | | |
831 | 821 | | |
832 | | - | |
| 822 | + | |
833 | 823 | | |
834 | 824 | | |
835 | 825 | | |
836 | | - | |
| 826 | + | |
837 | 827 | | |
838 | 828 | | |
839 | 829 | | |
| |||
984 | 974 | | |
985 | 975 | | |
986 | 976 | | |
987 | | - | |
| 977 | + | |
988 | 978 | | |
989 | 979 | | |
990 | 980 | | |
| |||
0 commit comments