@funkit/connect 10.5.0 → 11.0.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/clients/chunk-2FSEE3AW.js +277 -0
  3. package/dist/clients/chunk-5MY7WMEJ.js +20 -0
  4. package/dist/clients/chunk-6CYZKITE.js +33 -0
  5. package/dist/clients/{chunk-QHS5N7GP.js → chunk-C4SHJFOV.js} +2 -2
  6. package/dist/clients/{chunk-WRS7AFM2.js → chunk-FNB7OPJI.js} +12 -199
  7. package/dist/clients/{chunk-2NBYHUIW.js → chunk-HZP4DXIZ.js} +1 -0
  8. package/dist/clients/{chunk-F6P4CN27.js → chunk-JD2J5K6S.js} +16 -8
  9. package/dist/clients/chunk-LT4EWLDA.js +30 -0
  10. package/dist/clients/chunk-MGQLVTSH.js +100 -0
  11. package/dist/clients/{chunk-FJ6GCMJ4.js → chunk-OODIKHYE.js} +3 -1
  12. package/dist/clients/chunk-SFDEST63.js +18 -0
  13. package/dist/clients/{chunk-OZ3KD24N.js → chunk-ZCCLJW6F.js} +0 -8
  14. package/dist/clients/fanatics.js +5 -6
  15. package/dist/clients/internal/nado/encoding.js +4 -25
  16. package/dist/clients/internal/nado/gateway.d.ts +0 -21
  17. package/dist/clients/internal/nado/gateway.js +1 -5
  18. package/dist/clients/internal/nado/hooks.d.ts +0 -158
  19. package/dist/clients/internal/nado/hooks.js +10 -121
  20. package/dist/clients/internal/nado/withdrawalConfig.js +3 -12
  21. package/dist/clients/internal/nado/withdrawalForm.css +17529 -0
  22. package/dist/clients/internal/nado/withdrawalForm.d.ts +41 -0
  23. package/dist/clients/internal/nado/withdrawalForm.js +283 -0
  24. package/dist/clients/internal/nado/withdrawalTypes.d.ts +7 -2
  25. package/dist/clients/lighter.css +5 -1
  26. package/dist/clients/lighter.d.ts +29 -1
  27. package/dist/clients/lighter.js +105 -100
  28. package/dist/clients/mallard.js +24 -3
  29. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +5 -1
  30. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +6 -3
  31. package/dist/clients/polymarket/index.css +5 -1
  32. package/dist/clients/polymarket/index.js +6 -3
  33. package/dist/components/BottomLinks/BottomLinks.d.ts +3 -1
  34. package/dist/consts/meld.d.ts +1 -1
  35. package/dist/domains/swapped.d.ts +1 -10
  36. package/dist/hooks/queries/useSwappedDefaultCurrency.d.ts +3 -3
  37. package/dist/hooks/queries/useWithdrawFops.d.ts +0 -1
  38. package/dist/hooks/track/useTrack.d.ts +1 -0
  39. package/dist/hooks/useTokenAndChainDropdown.d.ts +8 -1
  40. package/dist/index.css +5 -1
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.js +2325 -1552
  43. package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +1 -2
  44. package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +6 -9
  45. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +54 -48
  46. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +5 -9
  47. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +1 -61
  48. package/dist/modals/WithdrawalModal/withdrawalFormHelpers.d.ts +53 -0
  49. package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +38 -0
  50. package/dist/providers/FunkitCheckoutContext/types.d.ts +61 -4
  51. package/dist/providers/FunkitConfigContext.d.ts +2 -2
  52. package/dist/utils/consts.d.ts +1 -1
  53. package/dist/utils/customer.d.ts +367 -3
  54. package/dist/utils/withdrawal.d.ts +19 -6
  55. package/dist/wagmi/actions.d.ts +1 -1
  56. package/dist/wallets/Wallet.d.ts +21 -1
  57. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  58. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  59. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  60. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  61. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  62. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  63. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  64. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  65. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  66. package/dist/wallets/walletConnectors/index.js +34 -34
  67. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  68. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  69. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  70. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  71. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  72. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  73. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  74. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  75. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  76. package/package.json +3 -3
  77. package/dist/clients/chunk-A4WQS6QG.js +0 -207
  78. package/dist/clients/internal/nado/products.d.ts +0 -36
  79. package/dist/clients/internal/nado/products.js +0 -19
  80. package/dist/wallets/walletConnectors/{chunk-RB3HR4R2.js → chunk-4NV5BYRP.js} +3 -3
  81. package/dist/wallets/walletConnectors/{chunk-YEZM4CK4.js → chunk-AVDUNQUW.js} +3 -3
  82. package/dist/wallets/walletConnectors/{chunk-MIQTHJ6X.js → chunk-GUQM4QSL.js} +3 -3
  83. package/dist/wallets/walletConnectors/{chunk-4T6ZSRJF.js → chunk-IULPZP2Q.js} +3 -3
  84. package/dist/wallets/walletConnectors/{chunk-HNRB7KJU.js → chunk-JPN6TWIT.js} +3 -3
  85. package/dist/wallets/walletConnectors/{chunk-ZNX4EMPB.js → chunk-KCRO2AGO.js} +3 -3
  86. package/dist/wallets/walletConnectors/{chunk-STVVP43G.js → chunk-KI5Y2BBF.js} +3 -3
  87. package/dist/wallets/walletConnectors/{chunk-X6CGV36L.js → chunk-NR2OGDHQ.js} +3 -3
  88. package/dist/wallets/walletConnectors/{chunk-UK7C2JXW.js → chunk-OEEGYENV.js} +3 -3
  89. package/dist/wallets/walletConnectors/{chunk-F5XEEVG6.js → chunk-OX37G4YT.js} +3 -3
  90. package/dist/wallets/walletConnectors/{chunk-RVOY537T.js → chunk-SWFF3TWJ.js} +3 -3
  91. package/dist/wallets/walletConnectors/{chunk-CPI4TD43.js → chunk-TKB2OY6G.js} +3 -3
  92. package/dist/wallets/walletConnectors/{chunk-2VP2F6EK.js → chunk-W2LCLDPX.js} +3 -3
  93. package/dist/wallets/walletConnectors/{chunk-6BW3HLBG.js → chunk-WAHGI5L7.js} +3 -3
  94. package/dist/wallets/walletConnectors/{chunk-HTHAK6XB.js → chunk-WKNQMP4A.js} +3 -3
  95. package/dist/wallets/walletConnectors/{chunk-VTM6EECM.js → chunk-XCNHV3HS.js} +3 -3
  96. package/dist/wallets/walletConnectors/{chunk-CCQV2ZET.js → chunk-YO2K4MBH.js} +3 -3
  97. package/dist/wallets/walletConnectors/{chunk-VAPGUPHO.js → chunk-YQFGVZGR.js} +3 -3
@@ -52,9 +52,14 @@ export type LighterAsset = {
52
52
  locked_balance: string;
53
53
  };
54
54
  /**
55
- * A user's stake in a Lighter public pool. The staking pool is identified by
56
- * matching `public_pool_index` against the known staking pool index;
57
- * `principal_amount` is the staked USDC principal (decimal string).
55
+ * A user's stake in a Lighter public pool, identified by matching
56
+ * `public_pool_index` against the known pool index.
57
+ *
58
+ * Carries only *entry* state — there is no current-value field:
59
+ * - `principal_amount` — deposited at entry, in the pool's own asset (Lighter's
60
+ * UI shows this as "Your Deposits"). Never grows with accrued yield.
61
+ * - `shares_amount` — pool shares held. Current value ("Your Stake") is this
62
+ * times the pool's share price, so it needs the pool account too.
58
63
  */
59
64
  export type LighterShare = {
60
65
  public_pool_index: number;
@@ -63,6 +68,14 @@ export type LighterShare = {
63
68
  principal_amount: string;
64
69
  entry_timestamp: number;
65
70
  };
71
+ /**
72
+ * Public-pool accounting, present only on pool accounts (`account_type: 4`).
73
+ * Share price is `<pool asset balance> / total_shares`.
74
+ */
75
+ export type LighterPoolInfo = {
76
+ total_shares: number;
77
+ operator_shares: number;
78
+ };
66
79
  export type LighterAccount = {
67
80
  code: number;
68
81
  account_type: number;
@@ -90,6 +103,8 @@ export type LighterAccount = {
90
103
  cross_asset_value: string;
91
104
  shares: LighterShare[];
92
105
  pending_unlocks: unknown[];
106
+ /** Pool accounts only — absent on user accounts. */
107
+ pool_info?: LighterPoolInfo;
93
108
  };
94
109
  export type LighterAccountResponse = {
95
110
  code: number;
@@ -269,6 +284,177 @@ export declare function useLighterAccount(lookup: LighterAccountLookup | null, o
269
284
  fetchStatus: import("@tanstack/react-query").FetchStatus;
270
285
  promise: Promise<LighterAccountResponse>;
271
286
  };
287
+ /**
288
+ * Ungated {@link useLighterAccount}. For callers whose module is Lighter-specific
289
+ * by construction — `clients/lighter` is a separate bundle entry with its own copy
290
+ * of the config context, so `useFunkitConfig()` there yields no api key and a
291
+ * customer check would disable the query forever.
292
+ */
293
+ export declare function useLighterAccountQuery(lookup: LighterAccountLookup | null, options?: {
294
+ activeOnly?: boolean;
295
+ }): {
296
+ account: LighterAccount | undefined;
297
+ data: LighterAccountResponse;
298
+ error: Error;
299
+ isError: true;
300
+ isPending: false;
301
+ isLoading: false;
302
+ isLoadingError: false;
303
+ isRefetchError: true;
304
+ isSuccess: false;
305
+ isPlaceholderData: false;
306
+ status: "error";
307
+ dataUpdatedAt: number;
308
+ errorUpdatedAt: number;
309
+ failureCount: number;
310
+ failureReason: Error | null;
311
+ errorUpdateCount: number;
312
+ isFetched: boolean;
313
+ isFetchedAfterMount: boolean;
314
+ isFetching: boolean;
315
+ isInitialLoading: boolean;
316
+ isPaused: boolean;
317
+ isRefetching: boolean;
318
+ isStale: boolean;
319
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
320
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
321
+ promise: Promise<LighterAccountResponse>;
322
+ } | {
323
+ account: LighterAccount | undefined;
324
+ data: LighterAccountResponse;
325
+ error: null;
326
+ isError: false;
327
+ isPending: false;
328
+ isLoading: false;
329
+ isLoadingError: false;
330
+ isRefetchError: false;
331
+ isSuccess: true;
332
+ isPlaceholderData: false;
333
+ status: "success";
334
+ dataUpdatedAt: number;
335
+ errorUpdatedAt: number;
336
+ failureCount: number;
337
+ failureReason: Error | null;
338
+ errorUpdateCount: number;
339
+ isFetched: boolean;
340
+ isFetchedAfterMount: boolean;
341
+ isFetching: boolean;
342
+ isInitialLoading: boolean;
343
+ isPaused: boolean;
344
+ isRefetching: boolean;
345
+ isStale: boolean;
346
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
347
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
348
+ promise: Promise<LighterAccountResponse>;
349
+ } | {
350
+ account: LighterAccount | undefined;
351
+ data: undefined;
352
+ error: Error;
353
+ isError: true;
354
+ isPending: false;
355
+ isLoading: false;
356
+ isLoadingError: true;
357
+ isRefetchError: false;
358
+ isSuccess: false;
359
+ isPlaceholderData: false;
360
+ status: "error";
361
+ dataUpdatedAt: number;
362
+ errorUpdatedAt: number;
363
+ failureCount: number;
364
+ failureReason: Error | null;
365
+ errorUpdateCount: number;
366
+ isFetched: boolean;
367
+ isFetchedAfterMount: boolean;
368
+ isFetching: boolean;
369
+ isInitialLoading: boolean;
370
+ isPaused: boolean;
371
+ isRefetching: boolean;
372
+ isStale: boolean;
373
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
374
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
375
+ promise: Promise<LighterAccountResponse>;
376
+ } | {
377
+ account: LighterAccount | undefined;
378
+ data: undefined;
379
+ error: null;
380
+ isError: false;
381
+ isPending: true;
382
+ isLoading: true;
383
+ isLoadingError: false;
384
+ isRefetchError: false;
385
+ isSuccess: false;
386
+ isPlaceholderData: false;
387
+ status: "pending";
388
+ dataUpdatedAt: number;
389
+ errorUpdatedAt: number;
390
+ failureCount: number;
391
+ failureReason: Error | null;
392
+ errorUpdateCount: number;
393
+ isFetched: boolean;
394
+ isFetchedAfterMount: boolean;
395
+ isFetching: boolean;
396
+ isInitialLoading: boolean;
397
+ isPaused: boolean;
398
+ isRefetching: boolean;
399
+ isStale: boolean;
400
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
401
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
402
+ promise: Promise<LighterAccountResponse>;
403
+ } | {
404
+ account: LighterAccount | undefined;
405
+ data: undefined;
406
+ error: null;
407
+ isError: false;
408
+ isPending: true;
409
+ isLoadingError: false;
410
+ isRefetchError: false;
411
+ isSuccess: false;
412
+ isPlaceholderData: false;
413
+ status: "pending";
414
+ dataUpdatedAt: number;
415
+ errorUpdatedAt: number;
416
+ failureCount: number;
417
+ failureReason: Error | null;
418
+ errorUpdateCount: number;
419
+ isFetched: boolean;
420
+ isFetchedAfterMount: boolean;
421
+ isFetching: boolean;
422
+ isLoading: boolean;
423
+ isInitialLoading: boolean;
424
+ isPaused: boolean;
425
+ isRefetching: boolean;
426
+ isStale: boolean;
427
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
428
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
429
+ promise: Promise<LighterAccountResponse>;
430
+ } | {
431
+ account: LighterAccount | undefined;
432
+ data: LighterAccountResponse;
433
+ isError: false;
434
+ error: null;
435
+ isPending: false;
436
+ isLoading: false;
437
+ isLoadingError: false;
438
+ isRefetchError: false;
439
+ isSuccess: true;
440
+ isPlaceholderData: true;
441
+ status: "success";
442
+ dataUpdatedAt: number;
443
+ errorUpdatedAt: number;
444
+ failureCount: number;
445
+ failureReason: Error | null;
446
+ errorUpdateCount: number;
447
+ isFetched: boolean;
448
+ isFetchedAfterMount: boolean;
449
+ isFetching: boolean;
450
+ isInitialLoading: boolean;
451
+ isPaused: boolean;
452
+ isRefetching: boolean;
453
+ isStale: boolean;
454
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
455
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
456
+ promise: Promise<LighterAccountResponse>;
457
+ };
272
458
  export declare function useLighterAccounts({ address, }: {
273
459
  address: Address | '' | undefined;
274
460
  }): {
@@ -446,6 +632,184 @@ export declare function useLighterAccounts({ address, }: {
446
632
  fetchStatus: import("@tanstack/react-query").FetchStatus;
447
633
  promise: Promise<LighterAccountsByL1AddressResponse>;
448
634
  };
635
+ /** Ungated {@link useLighterAccounts}. See {@link useLighterAccountQuery}. */
636
+ export declare function useLighterAccountsQuery({ address, }: {
637
+ address: Address | '' | undefined;
638
+ }): {
639
+ mainAccountIndex: string | undefined;
640
+ isUnifiedTradingMode: boolean;
641
+ subAccounts: LighterSubAccount[] | undefined;
642
+ data: LighterAccountsByL1AddressResponse;
643
+ error: Error;
644
+ isError: true;
645
+ isPending: false;
646
+ isLoading: false;
647
+ isLoadingError: false;
648
+ isRefetchError: true;
649
+ isSuccess: false;
650
+ isPlaceholderData: false;
651
+ status: "error";
652
+ dataUpdatedAt: number;
653
+ errorUpdatedAt: number;
654
+ failureCount: number;
655
+ failureReason: Error | null;
656
+ errorUpdateCount: number;
657
+ isFetched: boolean;
658
+ isFetchedAfterMount: boolean;
659
+ isFetching: boolean;
660
+ isInitialLoading: boolean;
661
+ isPaused: boolean;
662
+ isRefetching: boolean;
663
+ isStale: boolean;
664
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
665
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
666
+ promise: Promise<LighterAccountsByL1AddressResponse>;
667
+ } | {
668
+ mainAccountIndex: string | undefined;
669
+ isUnifiedTradingMode: boolean;
670
+ subAccounts: LighterSubAccount[] | undefined;
671
+ data: LighterAccountsByL1AddressResponse;
672
+ error: null;
673
+ isError: false;
674
+ isPending: false;
675
+ isLoading: false;
676
+ isLoadingError: false;
677
+ isRefetchError: false;
678
+ isSuccess: true;
679
+ isPlaceholderData: false;
680
+ status: "success";
681
+ dataUpdatedAt: number;
682
+ errorUpdatedAt: number;
683
+ failureCount: number;
684
+ failureReason: Error | null;
685
+ errorUpdateCount: number;
686
+ isFetched: boolean;
687
+ isFetchedAfterMount: boolean;
688
+ isFetching: boolean;
689
+ isInitialLoading: boolean;
690
+ isPaused: boolean;
691
+ isRefetching: boolean;
692
+ isStale: boolean;
693
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
694
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
695
+ promise: Promise<LighterAccountsByL1AddressResponse>;
696
+ } | {
697
+ mainAccountIndex: string | undefined;
698
+ isUnifiedTradingMode: boolean;
699
+ subAccounts: LighterSubAccount[] | undefined;
700
+ data: undefined;
701
+ error: Error;
702
+ isError: true;
703
+ isPending: false;
704
+ isLoading: false;
705
+ isLoadingError: true;
706
+ isRefetchError: false;
707
+ isSuccess: false;
708
+ isPlaceholderData: false;
709
+ status: "error";
710
+ dataUpdatedAt: number;
711
+ errorUpdatedAt: number;
712
+ failureCount: number;
713
+ failureReason: Error | null;
714
+ errorUpdateCount: number;
715
+ isFetched: boolean;
716
+ isFetchedAfterMount: boolean;
717
+ isFetching: boolean;
718
+ isInitialLoading: boolean;
719
+ isPaused: boolean;
720
+ isRefetching: boolean;
721
+ isStale: boolean;
722
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
723
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
724
+ promise: Promise<LighterAccountsByL1AddressResponse>;
725
+ } | {
726
+ mainAccountIndex: string | undefined;
727
+ isUnifiedTradingMode: boolean;
728
+ subAccounts: LighterSubAccount[] | undefined;
729
+ data: undefined;
730
+ error: null;
731
+ isError: false;
732
+ isPending: true;
733
+ isLoading: true;
734
+ isLoadingError: false;
735
+ isRefetchError: false;
736
+ isSuccess: false;
737
+ isPlaceholderData: false;
738
+ status: "pending";
739
+ dataUpdatedAt: number;
740
+ errorUpdatedAt: number;
741
+ failureCount: number;
742
+ failureReason: Error | null;
743
+ errorUpdateCount: number;
744
+ isFetched: boolean;
745
+ isFetchedAfterMount: boolean;
746
+ isFetching: boolean;
747
+ isInitialLoading: boolean;
748
+ isPaused: boolean;
749
+ isRefetching: boolean;
750
+ isStale: boolean;
751
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
752
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
753
+ promise: Promise<LighterAccountsByL1AddressResponse>;
754
+ } | {
755
+ mainAccountIndex: string | undefined;
756
+ isUnifiedTradingMode: boolean;
757
+ subAccounts: LighterSubAccount[] | undefined;
758
+ data: undefined;
759
+ error: null;
760
+ isError: false;
761
+ isPending: true;
762
+ isLoadingError: false;
763
+ isRefetchError: false;
764
+ isSuccess: false;
765
+ isPlaceholderData: false;
766
+ status: "pending";
767
+ dataUpdatedAt: number;
768
+ errorUpdatedAt: number;
769
+ failureCount: number;
770
+ failureReason: Error | null;
771
+ errorUpdateCount: number;
772
+ isFetched: boolean;
773
+ isFetchedAfterMount: boolean;
774
+ isFetching: boolean;
775
+ isLoading: boolean;
776
+ isInitialLoading: boolean;
777
+ isPaused: boolean;
778
+ isRefetching: boolean;
779
+ isStale: boolean;
780
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
781
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
782
+ promise: Promise<LighterAccountsByL1AddressResponse>;
783
+ } | {
784
+ mainAccountIndex: string | undefined;
785
+ isUnifiedTradingMode: boolean;
786
+ subAccounts: LighterSubAccount[] | undefined;
787
+ data: LighterAccountsByL1AddressResponse;
788
+ isError: false;
789
+ error: null;
790
+ isPending: false;
791
+ isLoading: false;
792
+ isLoadingError: false;
793
+ isRefetchError: false;
794
+ isSuccess: true;
795
+ isPlaceholderData: true;
796
+ status: "success";
797
+ dataUpdatedAt: number;
798
+ errorUpdatedAt: number;
799
+ failureCount: number;
800
+ failureReason: Error | null;
801
+ errorUpdateCount: number;
802
+ isFetched: boolean;
803
+ isFetchedAfterMount: boolean;
804
+ isFetching: boolean;
805
+ isInitialLoading: boolean;
806
+ isPaused: boolean;
807
+ isRefetching: boolean;
808
+ isStale: boolean;
809
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
810
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
811
+ promise: Promise<LighterAccountsByL1AddressResponse>;
812
+ };
449
813
  /**
450
814
  * Returns a callback that invalidates the cached Lighter account queries so the
451
815
  * balance refetches eagerly (e.g. right after a withdrawal). No-op for
@@ -1,11 +1,24 @@
1
- import type { CustomWithdrawalConfig, FunkitWithdrawalConfig, MultiMethodWithdrawalConfig, WalletWithdrawalConfig } from '../providers/FunkitCheckoutContext';
1
+ import type { CustomWithdrawalConfig, FunkitWithdrawalConfig, MultiMethodWithdrawalConfig, WalletWithdrawalConfig, WithdrawalSourceTokenBalanceParams } from '../providers/FunkitCheckoutContext';
2
2
  /**
3
- * Evaluates the integrator's `withdrawalSourceTokenBalance` callback to a safe
4
- * numeric string. Returns `'0'` (with a warn) for missing/empty/NaN/negative
5
- * values, or if the callback throws. Shared by the withdrawal amount screen and
6
- * the Swapped cash cap.
3
+ * Deducts a flat fee (in token units) from a withdrawal input amount, clamped
4
+ * at 0. Uses `dnum` fixed-point math so decimal strings straight off the amount
5
+ * field stay exact.
7
6
  */
8
- export declare function safeEvaluateWithdrawalSourceTokenBalance(fn: (() => string | number) | undefined): string;
7
+ export declare function deductFlatFee(inputAmount: string, feeTokens: number): string;
8
+ /**
9
+ * Resolves the integrator's `withdrawalSourceTokenBalance` callback to a numeric
10
+ * string. Shared by the withdrawal amount screen and the Swapped cash cap.
11
+ *
12
+ * Named `resolve*`, not `safeEvaluate*`: it may legitimately not resolve. It
13
+ * never throws either way.
14
+ *
15
+ * - `undefined` means the integrator supplied no callback — distinct from a
16
+ * callback returning `0`, which means "nothing withdrawable". Callers that
17
+ * only display a number should coalesce to `'0'`.
18
+ * - A throw or an unusable value yields `'0'` (with a warn), never `undefined`:
19
+ * a broken callback must not silently fall through to another balance source.
20
+ */
21
+ export declare function resolveWithdrawalSourceTokenBalance(fn: ((params: WithdrawalSourceTokenBalanceParams) => string | number) | undefined, params: WithdrawalSourceTokenBalanceParams): string | undefined;
9
22
  /**
10
23
  * Type guard to check if withdrawal config uses wallet-based flow
11
24
  */
@@ -1,6 +1,6 @@
1
1
  import type { Config } from 'wagmi';
2
2
  import { type GetBalanceParameters, type GetBalanceReturnType } from 'wagmi/actions';
3
- export { estimateGas, getAccount, getGasPrice, getTransaction, getWalletClient, multicall, readContract, sendTransaction, signTypedData, switchChain, waitForTransactionReceipt, } from 'wagmi/actions';
3
+ export { estimateGas, getAccount, getGasPrice, getTransaction, getWalletClient, multicall, readContract, sendTransaction, signMessage, signTypedData, switchChain, waitForTransactionReceipt, } from 'wagmi/actions';
4
4
  export type GetBalanceReturnTypeCompat = GetBalanceReturnType & {
5
5
  formatted: string;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import type { WalletConnectParameters } from '../wagmi/connectors';
2
2
  import type { Connector, CreateConnectorFn } from '../wagmi/hooks';
3
- import type { TransactionReceipt } from 'viem';
3
+ import type { TransactionReceipt, TypedDataDomain } from 'viem';
4
4
  import type { CoinbaseWalletOptions } from './walletConnectors/coinbaseWallet/coinbaseWallet';
5
5
  import type { WalletConnectWalletOptions } from './walletConnectors/walletConnectWallet/walletConnectWallet';
6
6
  export type InstructionStepName = 'install' | 'create' | 'scan' | 'connect' | 'refresh';
@@ -104,6 +104,16 @@ export type WithdrawalTransaction = {
104
104
  data: string;
105
105
  value: string;
106
106
  };
107
+ /** EIP-712 payload passed to {@link WithdrawalClient.signTypedData}. */
108
+ export type WithdrawalTypedData = {
109
+ domain: TypedDataDomain;
110
+ types: Record<string, readonly {
111
+ name: string;
112
+ type: string;
113
+ }[]>;
114
+ primaryType: string;
115
+ message: Record<string, unknown>;
116
+ };
107
117
  export interface WithdrawalClient {
108
118
  getChainId: () => Promise<number>;
109
119
  switchChain: (chainId: number) => Promise<void>;
@@ -121,6 +131,16 @@ export interface WithdrawalClient {
121
131
  sendTransactions?: (chainId: number, transactions: WithdrawalTransaction[]) => Promise<string>;
122
132
  confirmTransaction: (txHash: string, chainId: number) => Promise<TransactionReceipt>;
123
133
  address: () => string;
134
+ /**
135
+ * Optional signers for gasless relay routes (permit / EIP-3009), where Relay
136
+ * returns a signature step instead of a transaction. Implemented by
137
+ * connected-wallet clients (see `clients/mallard.tsx`).
138
+ */
139
+ signTypedData?: (typedData: WithdrawalTypedData) => Promise<string>;
140
+ /** 32-byte hashes arrive as `{ raw }` — sign as raw bytes. */
141
+ signMessage?: (message: string | {
142
+ raw: string;
143
+ }) => Promise<string>;
124
144
  }
125
145
  /**
126
146
  * WithdrawalClient variant for Lighter (LVM). Satisfies WithdrawalClient for
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bifrostWallet
4
- } from "../chunk-4T6ZSRJF.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-IULPZP2Q.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  bifrostWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bitgetWallet
4
- } from "../chunk-CPI4TD43.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-TKB2OY6G.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  bitgetWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bybitWallet
4
- } from "../chunk-F5XEEVG6.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-OX37G4YT.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  bybitWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  clvWallet
4
- } from "../chunk-UK7C2JXW.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-OEEGYENV.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  clvWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  coin98Wallet
4
- } from "../chunk-6BW3HLBG.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-WAHGI5L7.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  coin98Wallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  coreWallet
4
- } from "../chunk-RB3HR4R2.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-4NV5BYRP.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  coreWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  foxWallet
4
- } from "../chunk-MIQTHJ6X.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-GUQM4QSL.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  foxWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  frontierWallet
4
- } from "../chunk-YEZM4CK4.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-AVDUNQUW.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  frontierWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  gateWallet
4
- } from "../chunk-HNRB7KJU.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-JPN6TWIT.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  gateWallet