@funkit/connect 12.14.0 → 12.15.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 (46) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/clients/axiom.d.ts +12 -0
  3. package/dist/clients/axiom.js +27 -0
  4. package/dist/clients/{chunk-YMBIRJQF.js → chunk-6IH7AWFA.js} +1 -1
  5. package/dist/clients/{chunk-P6UM36G5.js → chunk-7JYLS7IF.js} +32 -0
  6. package/dist/clients/{chunk-ZOQQL2QX.js → chunk-BKK2BFIP.js} +1 -1
  7. package/dist/clients/{chunk-R6E3NH5A.js → chunk-FLREOB24.js} +1 -1
  8. package/dist/clients/{chunk-U33QNTIA.js → chunk-IUVVGGP4.js} +66 -5
  9. package/dist/clients/{chunk-5GX6G7JR.js → chunk-OB5GKTP2.js} +1 -1
  10. package/dist/clients/{chunk-I5GSXPFE.js → chunk-TKEBGMVW.js} +1 -7
  11. package/dist/clients/{chunk-I75AI3N7.js → chunk-UZ3NA7HN.js} +3 -3
  12. package/dist/clients/fanatics.js +2 -2
  13. package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
  14. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  15. package/dist/clients/internal/nado/withdrawalForm.js +3 -3
  16. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  17. package/dist/clients/lighter.css +46 -0
  18. package/dist/clients/lighter.js +3 -3
  19. package/dist/clients/mallard.js +2 -2
  20. package/dist/clients/nado.js +4 -4
  21. package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +5 -5
  22. package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
  23. package/dist/clients/polymarket/index.js +3 -3
  24. package/dist/clients/polymarket/polymarket.js +2 -2
  25. package/dist/components/TokenSwapWidget/AmountUnitToggle/AmountUnitToggle.d.ts +2 -1
  26. package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +17 -6
  27. package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +9 -7
  28. package/dist/consts/customers.d.ts +2 -2
  29. package/dist/domains/clientMetadata.d.ts +4 -3
  30. package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
  31. package/dist/hooks/track/analytics/events.d.ts +1 -1
  32. package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +17 -2
  33. package/dist/index.css +46 -0
  34. package/dist/index.js +1905 -1418
  35. package/dist/modals/CheckoutModal/Convert/ConvertStep.d.ts +6 -0
  36. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +1 -0
  37. package/dist/modals/CheckoutModal/HeaderTabs/CheckoutHeaderTabs.d.ts +12 -0
  38. package/dist/modals/CheckoutModal/HeaderTabs/headerTabs.d.ts +8 -0
  39. package/dist/modals/CheckoutModal/HeaderTabs/useCheckoutHeaderTabsState.d.ts +4 -0
  40. package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -0
  41. package/dist/modals/PolymarketPerpsTransfer/usePerpsHeaderTabsState.d.ts +1 -21
  42. package/dist/providers/FunkitCheckoutContext/types.d.ts +40 -0
  43. package/dist/shadow-css.js +1 -1
  44. package/dist/wallets/walletConnectors/index.js +45 -45
  45. package/package.json +4 -4
  46. package/dist/modals/PolymarketPerpsTransfer/PerpsHeaderTabs.d.ts +0 -29
@@ -9,8 +9,8 @@ import {
9
9
  VAULT_DEPOSITOR_POLYGON,
10
10
  createPerpsGenerateActionParams,
11
11
  createPolymarketWithdrawalConfig
12
- } from "../chunk-R6E3NH5A.js";
13
- import "../chunk-I5GSXPFE.js";
12
+ } from "../chunk-FLREOB24.js";
13
+ import "../chunk-TKEBGMVW.js";
14
14
  import "../chunk-AHYOV7AV.js";
15
15
  export {
16
16
  AMOUNT_PLACEHOLDER,
@@ -4,10 +4,11 @@ export interface AmountUnitToggleProps {
4
4
  convertedAmount: string;
5
5
  /** Omit to show the amount without the switch (e.g. price unknown). */
6
6
  onToggle?: () => void;
7
+ isDisabled?: boolean;
7
8
  testId?: string;
8
9
  }
9
10
  /**
10
11
  * "28.05 ⇅": shows the other unit and switches the input to it on click.
11
12
  * Without `onToggle` it's plain text, so it isn't a dead tab stop.
12
13
  */
13
- export declare function AmountUnitToggle({ convertedAmount, onToggle, testId, }: AmountUnitToggleProps): React.JSX.Element;
14
+ export declare function AmountUnitToggle({ convertedAmount, onToggle, isDisabled, testId, }: AmountUnitToggleProps): React.JSX.Element;
@@ -1,8 +1,17 @@
1
1
  import React from 'react';
2
2
  import { type TokenSwapToken } from '../TokenSelectButton/TokenSelectButton';
3
- export interface TokenSwapCardProps {
3
+ export type TokenSwapDepositState = {
4
+ /** No funds available to swap. */
5
+ isDepositRequired: true;
6
+ onDeposit: () => void;
7
+ } | {
8
+ isDepositRequired?: false;
9
+ onDeposit?: never;
10
+ };
11
+ interface TokenSwapCardContentProps {
12
+ variant: 'from' | 'to';
4
13
  label: string;
5
- token: TokenSwapToken;
14
+ token?: TokenSwapToken;
6
15
  onTokenClick?: () => void;
7
16
  /** The big amount, without prefix/suffix. */
8
17
  amount: string;
@@ -16,9 +25,11 @@ export interface TokenSwapCardProps {
16
25
  isLoading?: boolean;
17
26
  testId: string;
18
27
  }
28
+ export type TokenSwapCardProps = TokenSwapCardContentProps & TokenSwapDepositState;
19
29
  /**
20
- * One side of the swap widget.
21
- * - Editable (has `onAmountChange`): filled background, unit toggle, highlighted balance.
22
- * - Read-only: outlined, amount comes from the quote.
30
+ * One card of the swap widget.
31
+ * - `from`: filled background, unit toggle, highlighted balance; editable unless a deposit is required.
32
+ * - `to`: outlined, read-only, amount comes from the quote.
23
33
  */
24
- export declare function TokenSwapCard({ label, token, onTokenClick, amount, amountPrefix, onAmountChange, convertedAmount, onToggleUnit, balance, isLoading, testId, }: TokenSwapCardProps): React.JSX.Element;
34
+ export declare function TokenSwapCard({ variant, label, token, isDepositRequired, onDeposit, onTokenClick, amount, amountPrefix, onAmountChange, convertedAmount, onToggleUnit, balance, isLoading, testId, }: TokenSwapCardProps): React.JSX.Element;
35
+ export {};
@@ -1,27 +1,29 @@
1
1
  import React from 'react';
2
2
  import type { AmountUnit } from './AmountUnitToggle/useAmountUnitToggle';
3
3
  import type { TokenSwapToken } from './TokenSelectButton/TokenSelectButton';
4
+ import { type TokenSwapDepositState } from './TokenSwapCard/TokenSwapCard';
4
5
  export type { TokenSwapToken };
5
- interface TokenSwapSideAmounts {
6
- token: TokenSwapToken;
6
+ interface TokenSwapAmounts {
7
+ /** Omit when there's no token to show (e.g. nothing held). */
8
+ token?: TokenSwapToken;
7
9
  onTokenClick?: () => void;
8
10
  usdAmount: number | undefined;
9
11
  tokenAmount: number | undefined;
10
12
  /** The user's holding of `token`, in token units. */
11
13
  tokenBalance?: number;
12
14
  }
13
- export interface TokenSwapFromSide extends TokenSwapSideAmounts {
15
+ export type TokenSwapFrom = TokenSwapAmounts & TokenSwapDepositState & {
14
16
  /** What the user typed, in `unit`. */
15
17
  inputValue: string;
16
18
  onInputChange: (next: string) => void;
17
- }
18
- export interface TokenSwapToSide extends TokenSwapSideAmounts {
19
+ };
20
+ export interface TokenSwapTo extends TokenSwapAmounts {
19
21
  /** Shows a skeleton in place of the amount while the quote loads. */
20
22
  isLoading?: boolean;
21
23
  }
22
24
  export interface TokenSwapWidgetProps {
23
- from: TokenSwapFromSide;
24
- to: TokenSwapToSide;
25
+ from: TokenSwapFrom;
26
+ to: TokenSwapTo;
25
27
  /** Unit the amounts are entered and shown in. */
26
28
  unit: AmountUnit;
27
29
  /** Omit to hide the unit switch (e.g. price unknown). */
@@ -2,12 +2,10 @@ import type { FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
2
2
  export declare function isPolymarketCustomer(apiKey: string): boolean;
3
3
  export declare function isOstiumCustomer(apiKey: string): apiKey is "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN";
4
4
  export declare function isBsxCustomer(apiKey: string): apiKey is "zN1zrkmLQn4oZtLUW9Qt02uuBI3Jvrgj8Ni40Gf1";
5
- export declare function isEtherealCustomer(apiKey: string): apiKey is "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um";
6
5
  export declare function isHyperdashCustomer(apiKey: string): apiKey is "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe";
7
6
  export declare function isMonadCustomer(apiKey: string): apiKey is "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc";
8
7
  export declare function isMonkeyTiltCustomer(apiKey: string): apiKey is "2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX";
9
8
  export declare function isBasedCustomer(apiKey: string): apiKey is "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e";
10
- export declare function isHyenaCustomer(apiKey: string): apiKey is "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW";
11
9
  export declare function isAvantisCustomer(apiKey: string): apiKey is "6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2";
12
10
  export declare function isPerplCustomer(apiKey: string): apiKey is "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu";
13
11
  export declare function isLighterxyzCustomer(apiKey: string): apiKey is "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2";
@@ -15,6 +13,8 @@ export declare function isFanaticsCustomer(apiKey: string): apiKey is "lI7amueGK
15
13
  export declare function isAaveCustomer(apiKey: string): apiKey is "EWzSv8tWnQ7UcZ2IsDqFw1dYo3Df56FX6KBJ5ztS";
16
14
  export declare function isNadoCustomer(apiKey: string): apiKey is "iFwbI36PWs6egzqjemCVz8PRmDwaANr51WtaARhV";
17
15
  export declare function isMallardCustomer(apiKey: string): apiKey is "hxiC33LDFN9BekjyOXfYo597NQ6TdkBG9soUGyW2";
16
+ /** Whether a wallet balance must be kept out of this customer's balance UI. */
17
+ export declare function isTokenHiddenForCustomer(apiKey: string, chainId: string, tokenAddress: string): boolean;
18
18
  /**
19
19
  * Gates the source-select "Native" fast-path: when the connected wallet
20
20
  * already holds `checkoutConfig.targetAsset`, surface a one-click row
@@ -17,7 +17,7 @@ type SerializedCandidate = Omit<DynamicTargetAssetCandidate, 'generateActionsPar
17
17
  * Historical Checkout Configuration stored in the server
18
18
  * This is similar to FunkitCheckoutConfig but with some fields changed to serializable types
19
19
  * */
20
- export type ServerCheckoutConfig = Omit<DeepSerialize<FunkitCheckoutConfig>, 'dynamicTargetAssetCandidates'> & {
20
+ export type ServerCheckoutConfig = Omit<DeepSerialize<FunkitCheckoutConfig>, 'dynamicTargetAssetCandidates' | 'headerTabs'> & {
21
21
  dynamicTargetAssetCandidates?: SerializedCandidate[];
22
22
  };
23
23
  type HistoricalCheckoutItemKey = 'id' | 'startTimestampMs' | 'finalDollarValue' | 'latestQuote' | 'depositAddress' | 'selectedSourceAssetInfo' | 'selectedPaymentMethodInfo';
@@ -45,8 +45,9 @@ export interface HistoricalCheckoutItem extends Pick<FunkitActiveCheckoutItem, H
45
45
  * - `modalTitle` is restored whenever a live config exists (falling back to the
46
46
  * serializable value) so validation passes;
47
47
  * - the remaining live-only closures (`getMinDepositUSD`,
48
- * `generateActionsParams`, `polymarketPerpsTransfer`, `resolveHealthFactor`)
49
- * are carried forward only when re-starting the still-active checkout.
48
+ * `generateActionsParams`, `polymarketPerpsTransfer`, `headerTabs`,
49
+ * `resolveHealthFactor`) are carried forward only when re-starting the
50
+ * still-active checkout.
50
51
  */
51
52
  export declare function createNewCheckoutConfig({ serializedConfig, liveConfig, isActiveCheckout, }: {
52
53
  serializedConfig: ServerCheckoutConfig;
@@ -25,6 +25,7 @@ export declare enum CheckoutModalEvent {
25
25
  NAVIGATE_BROKERAGE_SUCCESS = "fc::navigate::brokerage_success",
26
26
  NAVIGATE_SWAPPED_IFRAME = "fc::navigate::swapped_iframe",
27
27
  NAVIGATE_PERPS_TRANSFER = "fc::navigate::perps_transfer",
28
+ NAVIGATE_CONVERT = "fc::navigate::convert",
28
29
  READY_CONFIRMATION = "fc::ready::confirmation",
29
30
  READY_INPUT_AMOUNT = "fc::ready::input_amount",
30
31
  READY_SELECT_ASSET = "fc::ready::select_asset",
@@ -43,7 +43,7 @@ export declare enum AnalyticsEvent {
43
43
  WITHDRAWAL_TRANSACTION_SUBMITTED = "fc_withdrawal_transaction_submitted"
44
44
  }
45
45
  export type ConnectionStatus = 'new' | 'existing';
46
- export type AnalyticsFlow = 'deposit' | 'withdraw';
46
+ export type AnalyticsFlow = 'deposit' | 'withdraw' | 'convert';
47
47
  export type AnalyticsPaymentRail = 'bluvo' | 'swapped' | 'meld' | 'bridge';
48
48
  export type AnalyticsStep = Lowercase<FunCheckoutStep | WithdrawalModalStep>;
49
49
  export type ModalClosedAction = 'close' | 'new_deposit' | 'new_withdrawal';
@@ -1,6 +1,6 @@
1
1
  import type { NotificationItem } from '../../../modals/CheckoutModal/TransferToken/types';
2
2
  import { type ExecutionTransactionSubmittedArgs } from './resolveExecutionProgressContext';
3
- import { type AnalyticsFlow, type ExecutionTransactionSnapshotProperties } from './events';
3
+ import { AnalyticsEvent, type ExecutionTransactionSnapshotProperties } from './events';
4
4
  export type TrackExecutionSucceededArgs = ExecutionTransactionSubmittedArgs & {
5
5
  fulfillmentTimeMs: number | null;
6
6
  };
@@ -8,11 +8,26 @@ export type TrackExecutionFailedArgs = ExecutionTransactionSubmittedArgs & {
8
8
  errorCode: string | null;
9
9
  errorMessage: string | null;
10
10
  };
11
+ declare const eventNames: {
12
+ readonly deposit: {
13
+ readonly failed: AnalyticsEvent.DEPOSIT_FAILED;
14
+ readonly submitted: AnalyticsEvent.DEPOSIT_TRANSACTION_SUBMITTED;
15
+ readonly succeeded: AnalyticsEvent.DEPOSIT_SUCCEEDED;
16
+ };
17
+ readonly withdraw: {
18
+ readonly failed: AnalyticsEvent.WITHDRAWAL_FAILED;
19
+ readonly submitted: AnalyticsEvent.WITHDRAWAL_TRANSACTION_SUBMITTED;
20
+ readonly succeeded: AnalyticsEvent.WITHDRAWAL_SUCCEEDED;
21
+ };
22
+ };
11
23
  export declare function buildExecutionTransactionSnapshotProperties(args: ExecutionTransactionSubmittedArgs, connectorId: string | undefined): ExecutionTransactionSnapshotProperties;
24
+ /** Flows with execution lifecycle events; Convert's arrive with its execution. */
25
+ type ExecutionFlow = keyof typeof eventNames;
12
26
  /** Builds and emits execution lifecycle events without owning any polling. */
13
- export declare function useTrackExecutionProgressEvents(flow: AnalyticsFlow): {
27
+ export declare function useTrackExecutionProgressEvents(flow: ExecutionFlow): {
14
28
  trackExecutionFailed: (args: TrackExecutionFailedArgs, claimKey: string) => void;
15
29
  trackExecutionProgressEvents: (historyItem: NotificationItem) => void;
16
30
  trackExecutionSucceeded: (args: TrackExecutionSucceededArgs, claimKey: string) => void;
17
31
  trackExecutionTransactionSubmitted: (args: ExecutionTransactionSubmittedArgs, claimKey: string) => void;
18
32
  };
33
+ export {};
package/dist/index.css CHANGED
@@ -17299,6 +17299,52 @@
17299
17299
  opacity: 1;
17300
17300
  }
17301
17301
 
17302
+ /* vanilla-extract-css-ns:src/components/LargeAmountInput/LargeAmountInput.css.ts.vanilla.css?source=LmxpcTY5dTAgewogIGFwcGVhcmFuY2U6IG5vbmU7CiAgLXdlYmtpdC1hcHBlYXJhbmNlOiBub25lOwogIGJvcmRlcjogbm9uZTsKICBvdXRsaW5lOiBub25lOwogIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50OwogIHBhZGRpbmc6IDA7CiAgbWFyZ2luOiAwOwogIHdpZHRoOiAxMDAlOwogIG1pbi13aWR0aDogMDsKICBmb250LWZhbWlseTogaW5oZXJpdDsKICBmb250LXNpemU6IGluaGVyaXQgIWltcG9ydGFudDsKICBsaW5lLWhlaWdodDogaW5oZXJpdDsKICBmb250LXdlaWdodDogaW5oZXJpdDsKICBjb2xvcjogdmFyKC0tcmstY29sb3JzLXByaW1hcnlUZXh0KTsKICBjYXJldC1jb2xvcjogdmFyKC0tcmstY29sb3JzLXByaW1hcnlUZXh0KTsKfQoubGlxNjl1MDo6cGxhY2Vob2xkZXIgewogIGNvbG9yOiB2YXIoLS1yay1jb2xvcnMtc2Vjb25kYXJ5VGV4dCk7CiAgb3BhY2l0eTogMTsKfQoubGlxNjl1MDpyZWFkLW9ubHkgewogIGN1cnNvcjogZGVmYXVsdDsKfQ */
17303
+ [data-rk] .liq69u0 {
17304
+ -moz-appearance: none;
17305
+ appearance: none;
17306
+ -webkit-appearance: none;
17307
+ border: none;
17308
+ outline: none;
17309
+ background: transparent;
17310
+ padding: 0;
17311
+ margin: 0;
17312
+ width: 100%;
17313
+ min-width: 0;
17314
+ font-family: inherit;
17315
+ font-size: inherit !important;
17316
+ line-height: inherit;
17317
+ font-weight: inherit;
17318
+ color: var(--rk-colors-primaryText);
17319
+ caret-color: var(--rk-colors-primaryText);
17320
+ }
17321
+ [data-rk] .liq69u0::-moz-placeholder {
17322
+ color: var(--rk-colors-secondaryText);
17323
+ opacity: 1;
17324
+ }
17325
+ [data-rk] .liq69u0::placeholder {
17326
+ color: var(--rk-colors-secondaryText);
17327
+ opacity: 1;
17328
+ }
17329
+ [data-rk] .liq69u0:-moz-read-only {
17330
+ cursor: default;
17331
+ }
17332
+ [data-rk] .liq69u0:read-only {
17333
+ cursor: default;
17334
+ }
17335
+
17336
+ /* vanilla-extract-css-ns:src/components/TokenSwapWidget/TokenSwapWidget.css.ts.vanilla.css?source=LnhpOWM3ajAgewogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICB0b3A6IDUwJTsKICBsZWZ0OiA1MCU7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGUoLTUwJSwgLTUwJSk7CiAgei1pbmRleDogMTsKICBwYWRkaW5nOiA0cHg7CiAgYm9yZGVyLXJhZGl1czogNTAlOwogIGJhY2tncm91bmQ6IHZhcigtLXJrLWNvbG9ycy1tb2RhbEJhY2tncm91bmQpOwp9 */
17337
+ [data-rk] .xi9c7j0 {
17338
+ position: absolute;
17339
+ top: 50%;
17340
+ left: 50%;
17341
+ transform: translate(-50%, -50%);
17342
+ z-index: 1;
17343
+ padding: 4px;
17344
+ border-radius: 50%;
17345
+ background: var(--rk-colors-modalBackground);
17346
+ }
17347
+
17302
17348
  /* vanilla-extract-css-ns:src/components/FunSelectBrokerage/FunBrokerageItem.css.ts.vanilla.css?source=LmFuMzR5OTAgewogIGRpc3BsYXk6IGZsZXg7CiAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgZmxleDogMTsKfQ */
17303
17349
  [data-rk] .an34y90 {
17304
17350
  display: flex;