@funkit/connect 11.1.0 → 11.3.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 (100) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/dist/clients/{chunk-YZSO4EMO.js → chunk-2576N7PQ.js} +1 -1
  3. package/dist/clients/{chunk-II5CZTBC.js → chunk-3P2C436B.js} +3 -1
  4. package/dist/clients/{chunk-YMGRBJAS.js → chunk-46L2KJJ4.js} +14 -16
  5. package/dist/clients/chunk-6EU6CXNH.js +20 -0
  6. package/dist/clients/{chunk-2QYQNTOI.js → chunk-C45VNQXY.js} +24 -16
  7. package/dist/clients/{chunk-SO756ELD.js → chunk-DGBIV3ZS.js} +1 -0
  8. package/dist/clients/{chunk-SYFHMTUO.js → chunk-FM7SFGAV.js} +2 -2
  9. package/dist/clients/{chunk-EJKHMZW3.js → chunk-IYCZWLAF.js} +2 -1
  10. package/dist/clients/{chunk-OJZNF6EM.js → chunk-JFDRLSYM.js} +1 -1
  11. package/dist/clients/{chunk-QIMCURVA.js → chunk-L2XMI4EX.js} +9 -9
  12. package/dist/clients/{chunk-A6OXZWCN.js → chunk-QQEGNLGD.js} +1 -1
  13. package/dist/clients/{chunk-A44M6EAG.js → chunk-TZGKB6WY.js} +1 -1
  14. package/dist/clients/{chunk-C53FRCUM.js → chunk-UK64SY6N.js} +1 -1
  15. package/dist/clients/{chunk-WVM4ZJD2.js → chunk-VIAEAD75.js} +1 -1
  16. package/dist/clients/{chunk-SH3MHRHX.js → chunk-Y7WLUPTX.js} +1 -1
  17. package/dist/clients/{chunk-FAYBQQNB.js → chunk-YUZ3B2Q3.js} +1 -1
  18. package/dist/clients/fanatics.js +2 -2
  19. package/dist/clients/internal/nado/consts.d.ts +6 -0
  20. package/dist/clients/internal/nado/consts.js +5 -3
  21. package/dist/clients/internal/nado/gateway.js +2 -2
  22. package/dist/clients/internal/nado/hooks.js +4 -4
  23. package/dist/clients/internal/nado/indexer.js +2 -2
  24. package/dist/clients/internal/nado/typedData.js +2 -2
  25. package/dist/clients/internal/nado/withdrawalCallback.js +7 -7
  26. package/dist/clients/internal/nado/withdrawalConfig.d.ts +4 -4
  27. package/dist/clients/internal/nado/withdrawalConfig.js +2 -2
  28. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  29. package/dist/clients/internal/nado/withdrawalForm.css +43 -35
  30. package/dist/clients/internal/nado/withdrawalForm.d.ts +3 -0
  31. package/dist/clients/internal/nado/withdrawalForm.js +15 -11
  32. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  33. package/dist/clients/lighter.css +43 -35
  34. package/dist/clients/lighter.d.ts +4 -30
  35. package/dist/clients/lighter.js +74 -260
  36. package/dist/clients/mallard.js +2 -2
  37. package/dist/clients/nado.js +9 -9
  38. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +43 -35
  39. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +8 -8
  40. package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +6 -0
  41. package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
  42. package/dist/clients/polymarket/index.css +43 -35
  43. package/dist/clients/polymarket/index.js +11 -11
  44. package/dist/clients/polymarket/polymarket.js +1 -1
  45. package/dist/components/Dialog/Dialog.d.ts +3 -1
  46. package/dist/components/Dialog/DialogContent.css.d.ts +6 -0
  47. package/dist/components/FunCheckbox/FunCheckbox.d.ts +3 -1
  48. package/dist/components/FunCheckoutHistory/FunCheckoutHistoryContent.d.ts +3 -1
  49. package/dist/components/FunCheckoutHistory/PendingSuccessScreen.d.ts +3 -1
  50. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +2 -1
  51. package/dist/domains/checkout.d.ts +2 -1
  52. package/dist/domains/nado.d.ts +11 -2
  53. package/dist/domains/quoteMode/types.d.ts +16 -0
  54. package/dist/domains/relay.d.ts +0 -3
  55. package/dist/hooks/track/analytics/claimAnalyticsEvent.d.ts +5 -0
  56. package/dist/hooks/track/analytics/events.d.ts +203 -7
  57. package/dist/hooks/track/analytics/mappers.d.ts +17 -0
  58. package/dist/hooks/track/analytics/quote.d.ts +12 -0
  59. package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +40 -0
  60. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +87 -2
  61. package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +48 -0
  62. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +18 -0
  63. package/dist/hooks/track/useTrack.d.ts +1 -1
  64. package/dist/hooks/useFunkitTranslation.d.ts +5 -0
  65. package/dist/hooks/useIsBlacklistedWithdrawalAddress.d.ts +4 -1
  66. package/dist/hooks/useTokenAndChainDropdown.d.ts +4 -1
  67. package/dist/index.css +43 -35
  68. package/dist/index.js +5301 -3619
  69. package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +2 -1
  70. package/dist/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.d.ts +5 -1
  71. package/dist/modals/CheckoutModal/ConfirmationStep/useTrackDepositQuoteEvents.d.ts +20 -0
  72. package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +5 -1
  73. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +13 -0
  74. package/dist/modals/CheckoutModal/InputAmount/useMeld.d.ts +4 -3
  75. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +9 -1
  76. package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +3 -1
  77. package/dist/modals/CheckoutModal/MeldQuotes/useMeldQuotes.d.ts +1 -1
  78. package/dist/modals/CheckoutModal/MeldRedirect/MeldRedirect.d.ts +4 -1
  79. package/dist/modals/CheckoutModal/SourceChange/useBottomBarCloseLabel.d.ts +7 -0
  80. package/dist/modals/CheckoutModal/SourceChange/useTrackSourceChangeEvents.d.ts +10 -0
  81. package/dist/modals/CheckoutModal/TransferToken/useTrackDepositNotificationEvents.d.ts +6 -0
  82. package/dist/modals/CheckoutModal/TransferToken/useTransferTokenTracking.d.ts +9 -3
  83. package/dist/modals/PolymarketPerpsTransfer/recordPerpsTransfer.d.ts +40 -0
  84. package/dist/modals/PolymarketPerpsTransfer/useRecordPerpsTransfer.d.ts +24 -0
  85. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +14 -92
  86. package/dist/modals/WithdrawalModal/LockedReceiveDisplay.d.ts +22 -0
  87. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +3 -1
  88. package/dist/modals/WithdrawalModal/useTrackWithdrawalEvents.d.ts +1 -0
  89. package/dist/modals/WithdrawalModal/withdrawalFormHelpers.d.ts +18 -1
  90. package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +1 -1
  91. package/dist/providers/FunkitCheckoutContext/index.d.ts +10 -2
  92. package/dist/providers/FunkitCheckoutContext/types.d.ts +21 -4
  93. package/dist/providers/FunkitStatsigProvider.d.ts +7 -0
  94. package/dist/utils/customer.d.ts +45 -504
  95. package/dist/utils/lighter.d.ts +1 -83
  96. package/dist/utils/signature.d.ts +1 -2
  97. package/dist/utils/withdrawal.d.ts +11 -1
  98. package/dist/wallets/walletConnectors/index.js +49 -49
  99. package/package.json +4 -5
  100. package/dist/clients/chunk-NAVU6W7V.js +0 -89
@@ -1,4 +1,5 @@
1
1
  import type { FunAddress } from '@funkit/api-base';
2
+ import type { LighterRouteType } from '@funkit/connect-core/clients/lighter';
2
3
  import type { ApiCheckoutClientMetadata, ApiFunkitCheckoutActionParams, ApiFunkitCheckoutConfig } from '@funkit/utils';
3
4
  import type { ReactNode } from 'react';
4
5
  import type { Address } from 'viem';
@@ -8,8 +9,8 @@ import type { CheckoutBlockedReason } from '../../modals/CheckoutModal/CheckoutB
8
9
  import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
9
10
  import type { FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
10
11
  export type FunkitCheckoutActionParams = ApiFunkitCheckoutActionParams;
11
- import type { DynamicTargetAssetCandidate, TokenInfo } from '@funkit/connect-core';
12
- export type { DynamicTargetAssetCandidate, TokenInfo, } from '@funkit/connect-core';
12
+ import type { AssetClass, DynamicTargetAssetCandidate, TokenInfo } from '@funkit/connect-core';
13
+ export type { AssetClass, DynamicTargetAssetCandidate, TokenInfo, } from '@funkit/connect-core';
13
14
  /**
14
15
  * Argument passed to a dynamic {@link FunkitCheckoutConfig.modalTitle} resolver.
15
16
  * Extends {@link TokenInfo} with the active dynamic routing id so titles can be
@@ -54,6 +55,15 @@ export declare enum FunCheckoutStartingStep {
54
55
  }
55
56
  /** Token a Polymarket account can be topped up with. */
56
57
  export type PolymarketTopupToken = 'pUSD';
58
+ /**
59
+ * What a transfer rail returns once it accepts. `id` is whatever identifies the
60
+ * transfer on the venue's side and can later be joined against it — an on-chain
61
+ * transaction hash, a relayer id, or a perps API withdraw id, depending on how
62
+ * the integrator implements that direction.
63
+ */
64
+ export interface PolymarketTransferResult {
65
+ id: string;
66
+ }
57
67
  /**
58
68
  * A Polymarket account in the transfer step. Both accounts share the same shape
59
69
  * so each direction is symmetrical and integrator-owned.
@@ -69,11 +79,16 @@ export interface PolymarketTransferAccount {
69
79
  * source account's transfer when the user confirms. `amountUsd` is the exact
70
80
  * string the user entered (validated numeric, ≤6 decimals) — never a parsed
71
81
  * number — so no float precision is lost before the integrator scales it.
82
+ *
83
+ * Returning {@link PolymarketTransferResult} is optional and recommended: the
84
+ * rail's own id becomes the tracking record's key, which is the only thing
85
+ * that can later join a Fun record to the venue's side of the same transfer.
86
+ * Returning nothing still records the transfer under a locally minted id.
72
87
  */
73
88
  transfer: (params: {
74
89
  toAddress: Address;
75
90
  amountUsd: string;
76
- }) => Promise<void>;
91
+ }) => Promise<void | PolymarketTransferResult>;
77
92
  /**
78
93
  * Fetches this account's live balance (USD). The transfer step polls this so
79
94
  * the displayed balances reconcile with the real on-chain / perps-API state
@@ -211,6 +226,8 @@ export interface SourceTokenOption {
211
226
  * it — Nado addresses balances by product id, not by token address.
212
227
  */
213
228
  customData?: WithdrawalSourceCustomData;
229
+ /** Token class metadata, when this option isn't an ordinary ERC-20. */
230
+ assetClass?: AssetClass;
214
231
  }
215
232
  export interface WithdrawalConfigBase {
216
233
  /** Title to show in the checkout modal. Defaults to "Checkout" **/
@@ -322,7 +339,7 @@ export interface CustomWithdrawalConfig extends WithdrawalConfigBase {
322
339
  customerConfig?: WithdrawalCustomerConfig;
323
340
  }
324
341
  /** Lighter L2 route type: 0 = perps (USDC collateral), 1 = spot. */
325
- export type LighterRouteType = 0 | 1;
342
+ export type { LighterRouteType };
326
343
  /**
327
344
  * Lighter-specific data for quoteless Secure withdrawal. `assetIndex` selects
328
345
  * the L2 asset (avoids overloading targetChainId); `routeType` disambiguates
@@ -1,6 +1,13 @@
1
+ import { type StatsigClient } from '@statsig/react-bindings';
1
2
  import React from 'react';
2
3
  import type { ReactNode } from 'react';
3
4
  export declare const STATSIG_CLIENT_KEY: "client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM";
5
+ export declare const STATSIG_CLIENT_KEY_FUNWHN: "client-UrueDVSY9et85npGccWMFidPs00V5jzTYyzsDKlLAjr";
6
+ /**
7
+ * THIS IS THE TEMPORARY CLIENT FOR V2 ANALYTICS. IT DOES NOT CONTAIN ANY CONFIGS.
8
+ * DO NOT USE THIS CONTEXT DIRECTLY. USE useTrack.logEventV2 INSTEAD.
9
+ */
10
+ export declare function useFunWhnStatsigClient(): StatsigClient | null;
4
11
  interface FunkitStatsigProviderProps {
5
12
  children: ReactNode;
6
13
  isDevelopment?: boolean;