@funkit/connect 9.6.1 → 9.7.1

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 (40) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/__generated__/default_configs.d.ts +8 -4
  3. package/dist/__generated__/default_feature_gates.d.ts +6 -1
  4. package/dist/{chunk-VLAOBEJN.js → chunk-76E6MOLR.js} +1 -0
  5. package/dist/{chunk-S65TG73G.js → chunk-AVVB5AIE.js} +1 -0
  6. package/dist/clients/fanatics.css +3381 -3318
  7. package/dist/clients/fanatics.js +2 -2
  8. package/dist/clients/polymarket.d.ts +0 -1
  9. package/dist/clients/polymarket.js +0 -2
  10. package/dist/components/Box/Box.d.ts +21 -21
  11. package/dist/components/FunPayments/FunPaymentMethods.d.ts +8 -4
  12. package/dist/components/SwappedIframeSkeleton.d.ts +7 -0
  13. package/dist/css/sprinkles.css.d.ts +23 -21
  14. package/dist/domains/quoteMode/gasEstimate.d.ts +2 -8
  15. package/dist/domains/quoteMode/index.d.ts +1 -1
  16. package/dist/hooks/queries/useFops.d.ts +4 -0
  17. package/dist/hooks/queries/useHasSavedFops.d.ts +2 -0
  18. package/dist/hooks/track/CheckoutModalEvent.d.ts +3 -1
  19. package/dist/hooks/useIsUserUnderComplianceReview.d.ts +1 -0
  20. package/dist/hooks/useSwappedIframeLifecycle.d.ts +12 -0
  21. package/dist/index.css +3381 -3318
  22. package/dist/index.js +5281 -4894
  23. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +3 -1
  24. package/dist/modals/CheckoutModal/SourceChange/ComplianceReviewBanner.d.ts +6 -0
  25. package/dist/modals/CheckoutModal/SourceChange/ConnectedSource.d.ts +2 -1
  26. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +2 -1
  27. package/dist/modals/CheckoutModal/SwappedIframe/{SwappedIframeContainer.d.ts → SwappedIframeController.d.ts} +1 -1
  28. package/dist/modals/CheckoutModal/SwappedIframe/index.d.ts +1 -1
  29. package/dist/modals/CheckoutModal/TransferToken/DirectExecutionNotification.d.ts +10 -0
  30. package/dist/providers/FunkitThemeProvider.d.ts +3 -0
  31. package/dist/providers/SwappedProvider.d.ts +0 -11
  32. package/dist/themes/darkTheme.js +1 -1
  33. package/dist/themes/lightTheme.js +1 -1
  34. package/dist/utils/customer.d.ts +213 -0
  35. package/dist/utils/directExecution.d.ts +9 -1
  36. package/dist/utils/flags/config.d.ts +8 -1
  37. package/dist/utils/safeBigInt.d.ts +5 -0
  38. package/dist/utils/swapped.d.ts +2 -0
  39. package/dist/wallets/walletConnectors/index.js +22 -22
  40. package/package.json +5 -5
@@ -1,15 +1,9 @@
1
1
  import type { Dnum } from 'dnum';
2
- /**
3
- * Hardcoded gas-unit estimate for a checkout transaction involving a
4
- * native token. Checkout relay/swap transactions typically consume
5
- * 300k–500k gas; we use 1M as a conservative baseline. The builder
6
- * applies an additional 1.5x multiplier on top, giving ~1.5M effective.
7
- */
8
- export declare const CHECKOUT_GAS_UNITS = 1000000n;
9
2
  /**
10
3
  * Compute a gas cost estimate in wei as an 18-decimal Dnum.
11
4
  *
12
5
  * @param gasPriceWei - Current gas price in wei (e.g. from `getGasPrice`)
6
+ * @param gasUnits - Conservative gas-unit buffer reserved for the checkout tx
13
7
  * @returns Gas estimate as a Dnum: [gasUnits * gasPriceWei, 18]
14
8
  */
15
- export declare function getGasEstimateWei(gasPriceWei: bigint): Dnum;
9
+ export declare function getGasEstimateWei(gasPriceWei: bigint, gasUnits: bigint): Dnum;
@@ -6,4 +6,4 @@ export { createExactInBuilder } from './exactIn';
6
6
  export { createOneToOneBuilder } from './oneToOne';
7
7
  export { resolveQuoteBuilder, _resolveQuoteMode } from './resolveQuoteMode';
8
8
  export type { ResolveQuoteBuilderParams } from './resolveQuoteMode';
9
- export { getGasEstimateWei, CHECKOUT_GAS_UNITS } from './gasEstimate';
9
+ export { getGasEstimateWei } from './gasEstimate';
@@ -8,6 +8,10 @@ export declare const useFops: () => {
8
8
  genericFormsOfPayments: GenericFormOfPayment[];
9
9
  savedFormsOfPayments: SavedFormOfPayment[];
10
10
  } | undefined;
11
+ realQueryData: {
12
+ genericFormsOfPayments: GenericFormOfPayment[];
13
+ savedFormsOfPayments: SavedFormOfPayment[];
14
+ } | undefined;
11
15
  isLoading: boolean;
12
16
  isFetching: boolean;
13
17
  };
@@ -0,0 +1,2 @@
1
+ export declare function clearHasSavedFopsCache(): void;
2
+ export declare function useHasSavedFops(): boolean | undefined;
@@ -70,5 +70,7 @@ export declare enum CheckoutModalEvent {
70
70
  DEPOSIT_TRANSFER_NOTIFICATION_DISPLAYED = "fc::deposit::transfer::notification::displayed",
71
71
  DEPOSIT_TRANSFER_NOTIFICATION_DISMISSED = "fc::deposit::transfer::notification::dismissed",
72
72
  DEPOSIT_TRANSFER_NOTIFICATION_EXPANDED = "fc::deposit::transfer::notification::expanded",
73
- DEPOSIT_TRANSFER_NOTIFICATION_HIDDEN = "fc::deposit::transfer::notification::hidden"
73
+ DEPOSIT_TRANSFER_NOTIFICATION_HIDDEN = "fc::deposit::transfer::notification::hidden",
74
+ COMPLIANCE_REVIEW_BANNER_SHOWN = "fc::compliance_review::banner_shown",
75
+ COMPLIANCE_REVIEW_GET_HELP_CLICKED = "fc::compliance_review::get_help_clicked"
74
76
  }
@@ -0,0 +1 @@
1
+ export declare function useIsUserUnderComplianceReview(): boolean;
@@ -0,0 +1,12 @@
1
+ import type { FormOfPaymentType } from '@funkit/api-base';
2
+ /**
3
+ * Shared lifecycle hook for Swapped iframe containers (deposit + withdrawal).
4
+ * Handles activate/deactivate on mount/unmount and timeout error detection.
5
+ *
6
+ * `onTimeout` is stabilized internally via useEffectEvent — callers do not
7
+ * need to memoize it.
8
+ */
9
+ export declare function useSwappedIframeLifecycle({ fopType, onTimeout, }: {
10
+ fopType: FormOfPaymentType;
11
+ onTimeout: () => void;
12
+ }): void;