@funkit/connect 12.12.0 → 12.13.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 (33) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/clients/{chunk-GPI6LBBB.js → chunk-5GX6G7JR.js} +1 -1
  3. package/dist/clients/{chunk-PK7BKCPR.js → chunk-I75AI3N7.js} +2 -2
  4. package/dist/clients/{chunk-JN52EBYV.js → chunk-P6UM36G5.js} +64 -0
  5. package/dist/clients/{chunk-RBMOSICG.js → chunk-YMBIRJQF.js} +1 -1
  6. package/dist/clients/{chunk-WXHSEFYH.js → chunk-ZOQQL2QX.js} +1 -1
  7. package/dist/clients/fanatics.js +2 -2
  8. package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
  9. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  10. package/dist/clients/internal/nado/withdrawalForm.js +3 -3
  11. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  12. package/dist/clients/lighter.js +3 -3
  13. package/dist/clients/mallard.js +2 -2
  14. package/dist/clients/nado.js +3 -3
  15. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +6 -1
  16. package/dist/components/LargeAmountInput/LargeAmountInput.css.d.ts +8 -0
  17. package/dist/components/LargeAmountInput/LargeAmountInput.d.ts +26 -0
  18. package/dist/components/SwapDirectionButton/SwapDirectionButton.d.ts +12 -0
  19. package/dist/components/TokenSwapWidget/AmountUnitToggle/AmountUnitToggle.d.ts +13 -0
  20. package/dist/components/TokenSwapWidget/AmountUnitToggle/useAmountUnitToggle.d.ts +46 -0
  21. package/dist/components/TokenSwapWidget/TokenSelectButton/TokenSelectButton.d.ts +17 -0
  22. package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +24 -0
  23. package/dist/components/TokenSwapWidget/TokenSwapWidget.css.d.ts +5 -0
  24. package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +36 -0
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +589 -394
  27. package/dist/modals/CheckoutModal/isSourceChangeLike.d.ts +3 -0
  28. package/dist/modals/ProfileDetails/FunProfileViews/Home/index.d.ts +3 -0
  29. package/dist/modals/WithdrawalModal/useWithdrawalExtraFeeItems.d.ts +8 -0
  30. package/dist/providers/FunkitCheckoutContext/types.d.ts +29 -0
  31. package/dist/providers/FunkitQuoteContext.d.ts +2 -1
  32. package/dist/wallets/walletConnectors/index.js +30 -30
  33. package/package.json +3 -3
@@ -0,0 +1,3 @@
1
+ import { FunCheckoutStartingStep } from '../../providers/FunkitCheckoutContext';
2
+ import type { CheckoutModalState } from './stepTransition';
3
+ export declare function isSourceChangeLike({ step }: CheckoutModalState, startingStep: FunCheckoutStartingStep | undefined): boolean;
@@ -1,11 +1,14 @@
1
1
  import React from 'react';
2
2
  import { type AnimationState } from '../../../../hooks/useAnimatedNavigation';
3
+ import type { MergedCheckoutHistoryItem } from '../../../../utils/checkout';
3
4
  import { type BaseActivitySelection } from '../../ActivityTraversalContext';
4
5
  import type { FunProfileView } from '../../ProfileDetails';
5
6
  export declare enum SelectedHomeTab {
6
7
  ASSETS = "assets",
7
8
  CHECKOUTS = "checkouts"
8
9
  }
10
+ /** Buckets checkouts by calendar day, newest day first, each under its date label. */
11
+ export declare function groupCheckoutsByDay(checkouts: MergedCheckoutHistoryItem[]): [string, MergedCheckoutHistoryItem[]][];
9
12
  export declare function Home({ onClose, onChangeView, onSelectActivity, defaultHomeTab, animation, }: {
10
13
  onClose: () => void;
11
14
  onChangeView: (newView: FunProfileView) => void;
@@ -0,0 +1,8 @@
1
+ import type { FeeItem } from '../../components/FunTransactionSummary/PaymentFeesSummary';
2
+ import type { WithdrawalConfigBase, WithdrawalFeeItemContext } from '../../providers/FunkitCheckoutContext';
3
+ export declare const MAX_WITHDRAWAL_FEE_ITEMS = 3;
4
+ /**
5
+ * Resolves integrator rows for the withdrawal transaction breakdown.
6
+ * - Integrator code, so a throw hides the rows rather than the screen.
7
+ */
8
+ export declare function useWithdrawalExtraFeeItems(resolveWithdrawalFeeItems: WithdrawalConfigBase['resolveWithdrawalFeeItems'], ctx: WithdrawalFeeItemContext): FeeItem[] | undefined;
@@ -339,6 +339,35 @@ export interface WithdrawalConfigBase {
339
339
  * {@link WalletWithdrawalConfig.preWithdrawalAction}.
340
340
  */
341
341
  onBeforeSign?: () => Promise<void> | void;
342
+ /**
343
+ * Additional rows rendered first in the withdrawal screen's transaction
344
+ * breakdown. Called synchronously whenever live amounts change.
345
+ * Text is displayed as provided, without translation, and never changes the total.
346
+ * Return `null` or `[]` to omit rows; only the first 3 are shown.
347
+ *
348
+ * @example
349
+ * resolveWithdrawalFeeItems: ({ sourceAmount }) => [
350
+ * { id: 'margin-after', label: 'Margin after withdrawal', value: projectMargin(sourceAmount) },
351
+ * ]
352
+ */
353
+ resolveWithdrawalFeeItems?: (ctx: WithdrawalFeeItemContext) => WithdrawalFeeItem[] | null;
354
+ }
355
+ /** Display-only row rendered in the withdrawal transaction breakdown. See `resolveWithdrawalFeeItems`. */
356
+ export interface WithdrawalFeeItem {
357
+ id: string;
358
+ label: string;
359
+ value: string;
360
+ tooltip?: string;
361
+ }
362
+ /** Live withdrawal amounts handed to `resolveWithdrawalFeeItems`. */
363
+ export interface WithdrawalFeeItemContext {
364
+ /** Amount being quoted, in source-token units, after any fee the SDK deducts before quoting. */
365
+ sourceAmount: string;
366
+ sourceTokenSymbol: string;
367
+ sourceChainId: string;
368
+ receiveAmount: string | null;
369
+ receiveTokenSymbol: string | null;
370
+ destinationChainId: string | null;
342
371
  }
343
372
  export interface WalletWithdrawalConfig extends WithdrawalConfigBase {
344
373
  /** Wallet instance used to execute the quote */
@@ -1,6 +1,6 @@
1
1
  import type { Dnum } from 'dnum';
2
2
  import React, { type Dispatch, type ReactNode } from 'react';
3
- import type { FunkitCheckoutQuoteResult } from '../domains/quote';
3
+ import type { CheckedAssetAmount, FunkitCheckoutQuoteResult } from '../domains/quote';
4
4
  import { type FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
5
5
  import type { DisplayedError } from '../components/FunNotification/FunNotification';
6
6
  export type ApprovalMethod = 'approve' | 'sign';
@@ -83,6 +83,7 @@ export declare function shouldShowApprovalMethodToggle({ isPermitToggleGateOn, i
83
83
  targetAssetSupportsPermit: boolean | undefined;
84
84
  targetAssetAllowanceCoversAmount: boolean;
85
85
  }): boolean;
86
+ export declare function getQuoteErrorResponse(error: Error, checkedAmount: CheckedAssetAmount | undefined, newCheckoutItem: FunkitActiveCheckoutItem, quoteState: CheckoutQuoteState): GetCheckoutQuoteResponse;
86
87
  export declare function FunkitQuoteProvider({ children }: {
87
88
  children: ReactNode;
88
89
  }): React.JSX.Element;
@@ -1,19 +1,19 @@
1
1
  "use client";
2
2
  import {
3
- xdefiWallet
4
- } from "./chunk-HXX4PRE2.js";
3
+ walletConnectWallet
4
+ } from "./chunk-DUX4XCDV.js";
5
5
  import {
6
6
  zealWallet
7
7
  } from "./chunk-GLX5FULK.js";
8
8
  import {
9
9
  zerionWallet
10
10
  } from "./chunk-OVDCDVFX.js";
11
- import {
12
- subWallet
13
- } from "./chunk-A5POD5SV.js";
14
11
  import {
15
12
  tahoWallet
16
13
  } from "./chunk-U74RFZOL.js";
14
+ import {
15
+ subWallet
16
+ } from "./chunk-A5POD5SV.js";
17
17
  import {
18
18
  talismanWallet
19
19
  } from "./chunk-IAYYWCVB.js";
@@ -30,8 +30,8 @@ import {
30
30
  uniswapWallet
31
31
  } from "./chunk-UNDWHCDH.js";
32
32
  import {
33
- walletConnectWallet
34
- } from "./chunk-DUX4XCDV.js";
33
+ xdefiWallet
34
+ } from "./chunk-HXX4PRE2.js";
35
35
  import {
36
36
  phantomWallet
37
37
  } from "./chunk-Q27YVDDH.js";
@@ -71,24 +71,24 @@ import {
71
71
  import {
72
72
  okxWallet
73
73
  } from "./chunk-53MYTA42.js";
74
- import {
75
- oneInchWallet
76
- } from "./chunk-GFS2AVAH.js";
77
74
  import {
78
75
  omniWallet
79
76
  } from "./chunk-2TAUCVX7.js";
77
+ import {
78
+ oneInchWallet
79
+ } from "./chunk-GFS2AVAH.js";
80
80
  import {
81
81
  oneKeyWallet
82
82
  } from "./chunk-KN32ITJ7.js";
83
83
  import {
84
84
  enkryptWallet
85
85
  } from "./chunk-Z6LDN2AN.js";
86
- import {
87
- foxWallet
88
- } from "./chunk-F45CUFRR.js";
89
86
  import {
90
87
  frameWallet
91
88
  } from "./chunk-B572YIAQ.js";
89
+ import {
90
+ foxWallet
91
+ } from "./chunk-F45CUFRR.js";
92
92
  import {
93
93
  frontierWallet
94
94
  } from "./chunk-ASTCNVJC.js";
@@ -105,50 +105,50 @@ import {
105
105
  kresusWallet
106
106
  } from "./chunk-V77ATGZT.js";
107
107
  import {
108
- clvWallet
109
- } from "./chunk-JJBLW4IU.js";
108
+ bybitWallet
109
+ } from "./chunk-IWPW26AL.js";
110
110
  import {
111
111
  coin98Wallet
112
112
  } from "./chunk-RQYEGJKL.js";
113
- import {
114
- customWallet
115
- } from "./chunk-VKM5M5UK.js";
116
113
  import {
117
114
  coinbaseWallet
118
115
  } from "./chunk-SM2A3OSG.js";
116
+ import {
117
+ bitverseWallet
118
+ } from "./chunk-5AEWIKRA.js";
119
119
  import {
120
120
  coreWallet
121
121
  } from "./chunk-TIHTQ3OB.js";
122
122
  import {
123
- braveWallet
124
- } from "./chunk-U2XXV45G.js";
123
+ customWallet
124
+ } from "./chunk-VKM5M5UK.js";
125
125
  import {
126
126
  dawnWallet
127
127
  } from "./chunk-LV6YV3DE.js";
128
128
  import {
129
129
  desigWallet
130
130
  } from "./chunk-DFHP75HV.js";
131
- import {
132
- bitgetWallet
133
- } from "./chunk-USLZMUJ3.js";
134
- import {
135
- bitskiWallet
136
- } from "./chunk-NPITCCJE.js";
137
131
  import {
138
132
  argentWallet
139
133
  } from "./chunk-XSDTNMQY.js";
134
+ import {
135
+ bitgetWallet
136
+ } from "./chunk-USLZMUJ3.js";
140
137
  import {
141
138
  bifrostWallet
142
139
  } from "./chunk-TM7UBV3Q.js";
143
140
  import {
144
- bitverseWallet
145
- } from "./chunk-5AEWIKRA.js";
141
+ bitskiWallet
142
+ } from "./chunk-NPITCCJE.js";
143
+ import {
144
+ braveWallet
145
+ } from "./chunk-U2XXV45G.js";
146
146
  import {
147
147
  bloomWallet
148
148
  } from "./chunk-PNHDOC77.js";
149
149
  import {
150
- bybitWallet
151
- } from "./chunk-IWPW26AL.js";
150
+ clvWallet
151
+ } from "./chunk-JJBLW4IU.js";
152
152
  import "./chunk-EYWGX5LT.js";
153
153
  import "./chunk-AALSJCUR.js";
154
154
  import "./chunk-B454LLKJ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "12.12.0",
3
+ "version": "12.13.0",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -119,10 +119,10 @@
119
119
  "ua-parser-js": "^1.0.37",
120
120
  "use-debounce": "^10.0.5",
121
121
  "uuid": "^11.1.1",
122
- "@funkit/api-base": "8.5.2",
123
- "@funkit/connect-core": "8.5.0",
122
+ "@funkit/api-base": "8.6.0",
124
123
  "@funkit/chains": "2.4.2",
125
124
  "@funkit/utils": "5.0.2",
125
+ "@funkit/connect-core": "8.6.0",
126
126
  "@funkit/fun-relay": "3.1.2"
127
127
  },
128
128
  "repository": {