@funkit/connect 5.0.0 → 5.0.2

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 (38) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{chunk-2LVAEHB2.js → chunk-2T4ZDGAO.js} +3 -0
  3. package/dist/{chunk-ZQ7UHAVV.js → chunk-3OKZVQR2.js} +3 -1
  4. package/dist/{chunk-7RFJFAFX.js → chunk-LEZIQHUN.js} +3 -1
  5. package/dist/components/AnimatedDollarValue/AnimatedDollarValue.d.ts +7 -0
  6. package/dist/components/Box/Box.d.ts +28 -28
  7. package/dist/components/Dropdown/BaseActiveDropdownItem.d.ts +5 -1
  8. package/dist/components/Dropdown/BaseDropdown.css.d.ts +0 -3
  9. package/dist/components/Dropdown/BaseDropdown.d.ts +11 -3
  10. package/dist/components/Dropdown/BaseDropdownItem.d.ts +4 -1
  11. package/dist/components/Dropdown/ReceiveTokenDropdown.d.ts +10 -0
  12. package/dist/components/FunAssetAvatar/FunAssetAvatar.css.d.ts +2 -0
  13. package/dist/components/FunAssetAvatar/FunAssetAvatar.d.ts +3 -1
  14. package/dist/components/FunInfoBanner/EphemeralInfoBanner.d.ts +6 -0
  15. package/dist/components/FunInfoBanner/FunInfoBanner.d.ts +2 -0
  16. package/dist/components/FunInfoBanner/InfoBanner.css.d.ts +2 -0
  17. package/dist/components/FunInfoBanner/InfoBanner.d.ts +7 -0
  18. package/dist/css/sprinkles.css.d.ts +32 -28
  19. package/dist/domains/clientMetadata.d.ts +5 -3
  20. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +4 -3
  21. package/dist/hooks/useIsFunkitCheckoutActivated.d.ts +7 -0
  22. package/dist/index.css +1312 -1235
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +2451 -1882
  25. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +1 -0
  26. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +1 -1
  27. package/dist/modals/CheckoutModal/stepTransition.d.ts +1 -0
  28. package/dist/providers/FunkitCheckoutContext.d.ts +8 -10
  29. package/dist/providers/FunkitConfigContext.d.ts +2 -0
  30. package/dist/providers/FunkitThemeProvider.d.ts +6 -0
  31. package/dist/themes/baseTheme.d.ts +1 -1
  32. package/dist/themes/baseTheme.js +1 -1
  33. package/dist/themes/darkTheme.js +2 -2
  34. package/dist/themes/lightTheme.js +2 -2
  35. package/dist/utils/checkout.d.ts +4 -3
  36. package/dist/utils/flags/config.d.ts +4 -0
  37. package/dist/wallets/walletConnectors/index.js +62 -62
  38. package/package.json +15 -13
@@ -5,6 +5,7 @@ import type { FunCheckoutStep, ModalStepComponentProps } from '../stepTransition
5
5
  interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep.INPUT_AMOUNT> {
6
6
  sourceHolding: AssetHoldingsItem | null;
7
7
  checkoutConfig: FunkitCheckoutConfig;
8
+ /** unit price of target asset */
8
9
  unitPrice: number;
9
10
  isCardCheckout: boolean;
10
11
  }
@@ -4,4 +4,4 @@ export declare const USD_DECIMALS = 2;
4
4
  export declare const USD_INITIAL_AMOUNT = 100;
5
5
  export declare const USD_PREFIX = "$";
6
6
  export declare function getUsdMaxAmount(paymentMethod: PaymentMethod, maxUsd: number): number | null;
7
- export declare function getUsdMinAmount(paymentMethod: PaymentMethod, minUsd?: number): number;
7
+ export declare function getUsdMinAmount(paymentMethod: PaymentMethod, minUsd?: number | undefined): number;
@@ -42,6 +42,7 @@ export declare enum FunCheckoutStep {
42
42
  export type ModalStepInfo<S extends FunCheckoutStep> = {
43
43
  Component: ComponentType<ModalStepComponentProps<S>>;
44
44
  disableBack?: boolean;
45
+ onBack?(state: CheckoutModalState<S>, prevState: CheckoutModalState): CheckoutModalState;
45
46
  onNext(state: CheckoutModalState<S>, payload: NextPayload<S>): CheckoutModalState;
46
47
  showFullHeight?: boolean;
47
48
  /** Defaults to checkoutItem.initSettings.config.modalTitle (returning undefined uses default) */
@@ -1,16 +1,10 @@
1
- import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
1
+ import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutActionParams, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
2
2
  import React, { type ReactNode } from 'react';
3
- import { type Abi, type Address } from 'viem';
3
+ import { type Address } from 'viem';
4
4
  import type { AssetHoldingsItem } from '~/utils/assets';
5
- import type { PaymentMethodInfo } from '../domains/paymentMethods';
5
+ import { type PaymentMethodInfo } from '../domains/paymentMethods';
6
6
  import { type FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
7
- export interface FunkitCheckoutActionParams {
8
- contractAbi: Abi;
9
- contractAddress: Address;
10
- functionName: string;
11
- functionArgs: unknown[];
12
- value?: bigint;
13
- }
7
+ export type FunkitCheckoutActionParams = ApiFunkitCheckoutActionParams;
14
8
  export interface DynamicTargetAssetCandidate {
15
9
  tokenAddress: Address;
16
10
  tokenChainId: string;
@@ -18,6 +12,7 @@ export interface DynamicTargetAssetCandidate {
18
12
  tokenSymbol: string;
19
13
  isDefault?: boolean;
20
14
  badgeText?: string;
15
+ targetAssetMinAmount?: number;
21
16
  }
22
17
  export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'externalCheckoutUserId'> {
23
18
  /** List of contract action params **/
@@ -47,6 +42,8 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
47
42
  externalCheckoutUserId?: string;
48
43
  /** a list of candidate assets to be chosen dynamically */
49
44
  dynamicTargetAssetCandidates?: DynamicTargetAssetCandidate[];
45
+ /** minimal toAmount needed to proceed checkout. Checked after quote */
46
+ targetAssetMinAmount?: number;
50
47
  }
51
48
  interface FunkitCheckoutValidationResult {
52
49
  isValid: boolean;
@@ -110,6 +107,7 @@ interface FunkitCheckoutContextInterface {
110
107
  targetAsset: Address;
111
108
  targetChain: string;
112
109
  targetAssetTicker: string;
110
+ targetAssetMinAmount: number | undefined;
113
111
  iconSrc: string | undefined;
114
112
  }): void;
115
113
  updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
@@ -16,6 +16,8 @@ export interface FunkitUiDestinationConfig {
16
16
  icon?: ReactNode;
17
17
  /** What text to show in the `destination` row - defaults to formatted destination wallet address */
18
18
  text?: string;
19
+ /** Which url to redirect to. If not specified, defaults to the block explorer of the recipientAddr of the checkout*/
20
+ url?: string;
19
21
  }
20
22
  export interface FunkitUiCustomizationsConfig {
21
23
  confirmationScreen?: {
@@ -47,6 +47,7 @@ export declare const useActiveTheme: () => {
47
47
  modalBorder: string;
48
48
  notificationPrimary: string;
49
49
  offBackground: string;
50
+ offBackgroundComplimentary: string;
50
51
  hoverState: string;
51
52
  lightStroke: string;
52
53
  mediumStroke: string;
@@ -154,6 +155,7 @@ export declare const useActiveTheme: () => {
154
155
  selectedOption: string;
155
156
  selectedWallet: string;
156
157
  dropdown: string;
158
+ vertexDropdown: string;
157
159
  };
158
160
  blurs: {
159
161
  modalOverlay: string;
@@ -189,6 +191,7 @@ export declare const useActiveTheme: () => {
189
191
  modalBorder: string;
190
192
  notificationPrimary: string;
191
193
  offBackground: string;
194
+ offBackgroundComplimentary: string;
192
195
  hoverState: string;
193
196
  lightStroke: string;
194
197
  mediumStroke: string;
@@ -296,6 +299,7 @@ export declare const useActiveTheme: () => {
296
299
  selectedOption: string;
297
300
  selectedWallet: string;
298
301
  dropdown: string;
302
+ vertexDropdown: string;
299
303
  };
300
304
  blurs: {
301
305
  modalOverlay: string;
@@ -329,6 +333,7 @@ export declare const useActiveTheme: () => {
329
333
  modalBorder: string;
330
334
  notificationPrimary: string;
331
335
  offBackground: string;
336
+ offBackgroundComplimentary: string;
332
337
  hoverState: string;
333
338
  lightStroke: string;
334
339
  mediumStroke: string;
@@ -436,6 +441,7 @@ export declare const useActiveTheme: () => {
436
441
  selectedOption: string;
437
442
  selectedWallet: string;
438
443
  dropdown: string;
444
+ vertexDropdown: string;
439
445
  };
440
446
  blurs: {
441
447
  modalOverlay: string;
@@ -8,7 +8,7 @@ declare const fontStacks: {
8
8
  };
9
9
  type FontStack = keyof typeof fontStacks;
10
10
  type RadiusScale = 'large' | 'medium' | 'small' | 'none';
11
- type Blurs = 'small' | 'large' | 'none';
11
+ type Blurs = 'tiny' | 'small' | 'large' | 'none';
12
12
  type FontSizeType = 'regular' | 'small';
13
13
  interface BaseThemeOptions {
14
14
  customFontWeights?: Partial<ThemeVars['fontWeight']>;
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  baseTheme,
4
4
  systemFontStack
5
- } from "../chunk-2LVAEHB2.js";
5
+ } from "../chunk-2T4ZDGAO.js";
6
6
  export {
7
7
  baseTheme,
8
8
  systemFontStack
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-ZQ7UHAVV.js";
5
- import "../chunk-2LVAEHB2.js";
4
+ } from "../chunk-3OKZVQR2.js";
5
+ import "../chunk-2T4ZDGAO.js";
6
6
  export {
7
7
  darkTheme
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-7RFJFAFX.js";
5
- import "../chunk-2LVAEHB2.js";
4
+ } from "../chunk-LEZIQHUN.js";
5
+ import "../chunk-2T4ZDGAO.js";
6
6
  export {
7
7
  lightTheme
8
8
  };
@@ -50,14 +50,15 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
50
50
  };
51
51
  bypassInit: boolean;
52
52
  apiKey?: string;
53
+ nonce?: bigint | undefined;
53
54
  fee?: {
54
55
  token?: string;
55
56
  amount?: number;
56
57
  gasPercent?: number;
57
58
  recipient: Address;
58
- };
59
- skipDBAction?: boolean;
60
- nonce?: bigint;
59
+ } | undefined;
60
+ skipDBAction?: boolean | undefined;
61
+ logger?: import("@funkit/api-base").Logger | undefined;
61
62
  };
62
63
  export type TokenInfo = {
63
64
  symbol: string;
@@ -106,4 +106,8 @@ export declare const flagConfig: {
106
106
  type: "boolean";
107
107
  default_value: true;
108
108
  };
109
+ show_info_banner: {
110
+ type: "string";
111
+ default_value: string;
112
+ };
109
113
  };
@@ -1,76 +1,73 @@
1
1
  "use client";
2
2
  import {
3
- walletConnectWallet
4
- } from "./chunk-NP5QGWNL.js";
3
+ zealWallet
4
+ } from "./chunk-JROWU5BP.js";
5
5
  import {
6
6
  zerionWallet
7
7
  } from "./chunk-AXWP3GD4.js";
8
8
  import {
9
- zealWallet
10
- } from "./chunk-JROWU5BP.js";
9
+ tokenaryWallet
10
+ } from "./chunk-SLOIIJGP.js";
11
11
  import {
12
- talismanWallet
13
- } from "./chunk-ABFSXBE6.js";
12
+ tahoWallet
13
+ } from "./chunk-6P2EMPZI.js";
14
14
  import {
15
15
  safepalWallet
16
16
  } from "./chunk-MSFKSQBY.js";
17
- import {
18
- tokenPocketWallet
19
- } from "./chunk-IDKVN5CF.js";
20
- import {
21
- tokenaryWallet
22
- } from "./chunk-SLOIIJGP.js";
23
17
  import {
24
18
  trustWallet
25
19
  } from "./chunk-ISIBREBO.js";
26
20
  import {
27
- uniswapWallet
28
- } from "./chunk-LH7BMNFZ.js";
21
+ talismanWallet
22
+ } from "./chunk-ABFSXBE6.js";
29
23
  import {
30
- xdefiWallet
31
- } from "./chunk-NO7XMBB5.js";
24
+ tokenPocketWallet
25
+ } from "./chunk-IDKVN5CF.js";
32
26
  import {
33
- tahoWallet
34
- } from "./chunk-6P2EMPZI.js";
27
+ walletConnectWallet
28
+ } from "./chunk-NP5QGWNL.js";
35
29
  import {
36
- phantomWallet
37
- } from "./chunk-ZSVTX6EK.js";
30
+ xdefiWallet
31
+ } from "./chunk-NO7XMBB5.js";
38
32
  import {
39
- ramperWallet
40
- } from "./chunk-PIUNLQJG.js";
33
+ uniswapWallet
34
+ } from "./chunk-LH7BMNFZ.js";
41
35
  import {
42
36
  rabbyWallet
43
37
  } from "./chunk-BVX4XGNP.js";
44
38
  import {
45
- roninWallet
46
- } from "./chunk-63YLN6R5.js";
39
+ oneInchWallet
40
+ } from "./chunk-OESTDX6I.js";
47
41
  import {
48
42
  rainbowWallet
49
43
  } from "./chunk-2UCNRD7H.js";
50
44
  import {
51
- safeWallet
52
- } from "./chunk-BQQQL6UD.js";
45
+ roninWallet
46
+ } from "./chunk-63YLN6R5.js";
53
47
  import {
54
48
  safeheronWallet
55
49
  } from "./chunk-R6RWZRFF.js";
50
+ import {
51
+ ramperWallet
52
+ } from "./chunk-PIUNLQJG.js";
56
53
  import {
57
54
  subWallet
58
55
  } from "./chunk-AD2KIJB6.js";
59
56
  import {
60
- metaMaskWallet
61
- } from "./chunk-G73C6P5P.js";
57
+ safeWallet
58
+ } from "./chunk-BQQQL6UD.js";
59
+ import {
60
+ ledgerWallet
61
+ } from "./chunk-BRBKM4PW.js";
62
62
  import {
63
63
  mewWallet
64
64
  } from "./chunk-V57WLZEE.js";
65
+ import {
66
+ metaMaskWallet
67
+ } from "./chunk-G73C6P5P.js";
65
68
  import {
66
69
  oktoWallet
67
70
  } from "./chunk-ADIXAKUL.js";
68
- import {
69
- oneInchWallet
70
- } from "./chunk-OESTDX6I.js";
71
- import {
72
- oneKeyWallet
73
- } from "./chunk-4AD7VI2P.js";
74
71
  import {
75
72
  omniWallet
76
73
  } from "./chunk-7CUY5G6R.js";
@@ -78,11 +75,11 @@ import {
78
75
  okxWallet
79
76
  } from "./chunk-4WEHDI4Y.js";
80
77
  import {
81
- ledgerWallet
82
- } from "./chunk-BRBKM4PW.js";
78
+ oneKeyWallet
79
+ } from "./chunk-4AD7VI2P.js";
83
80
  import {
84
- foxWallet
85
- } from "./chunk-LMZMXEXL.js";
81
+ phantomWallet
82
+ } from "./chunk-ZSVTX6EK.js";
86
83
  import {
87
84
  frameWallet
88
85
  } from "./chunk-ZMYVTWDF.js";
@@ -90,63 +87,66 @@ import {
90
87
  frontierWallet
91
88
  } from "./chunk-3S2U24BJ.js";
92
89
  import {
93
- injectedWallet
94
- } from "./chunk-VCVVV2K7.js";
90
+ desigWallet
91
+ } from "./chunk-CTU6JCOK.js";
95
92
  import {
96
- gateWallet
97
- } from "./chunk-GSOYKKIS.js";
93
+ imTokenWallet
94
+ } from "./chunk-COZ7MIQS.js";
98
95
  import {
99
96
  kresusWallet
100
97
  } from "./chunk-MJXPRJZT.js";
101
98
  import {
102
- imTokenWallet
103
- } from "./chunk-COZ7MIQS.js";
99
+ injectedWallet
100
+ } from "./chunk-VCVVV2K7.js";
101
+ import {
102
+ gateWallet
103
+ } from "./chunk-GSOYKKIS.js";
104
104
  import {
105
105
  bybitWallet
106
106
  } from "./chunk-6ONTSPEY.js";
107
107
  import {
108
108
  clvWallet
109
109
  } from "./chunk-KR6JBW5E.js";
110
- import {
111
- coinbaseWallet
112
- } from "./chunk-H4IRCEZN.js";
113
- import {
114
- dawnWallet
115
- } from "./chunk-LN7OD5EC.js";
116
110
  import {
117
111
  coreWallet
118
112
  } from "./chunk-HBA36GW3.js";
119
113
  import {
120
- desigWallet
121
- } from "./chunk-CTU6JCOK.js";
114
+ bitgetWallet
115
+ } from "./chunk-A5APNTGL.js";
122
116
  import {
123
- coin98Wallet
124
- } from "./chunk-DTRYS3MO.js";
117
+ dawnWallet
118
+ } from "./chunk-LN7OD5EC.js";
119
+ import {
120
+ coinbaseWallet
121
+ } from "./chunk-H4IRCEZN.js";
125
122
  import {
126
123
  enkryptWallet
127
124
  } from "./chunk-SJTXS4ZW.js";
125
+ import {
126
+ foxWallet
127
+ } from "./chunk-LMZMXEXL.js";
128
128
  import {
129
129
  argentWallet
130
130
  } from "./chunk-WSQ2YJO2.js";
131
131
  import {
132
- bitgetWallet
133
- } from "./chunk-A5APNTGL.js";
132
+ bifrostWallet
133
+ } from "./chunk-W6N74MS3.js";
134
134
  import {
135
135
  bitskiWallet
136
136
  } from "./chunk-P74YPRF6.js";
137
137
  import {
138
- bifrostWallet
139
- } from "./chunk-W6N74MS3.js";
138
+ bloomWallet
139
+ } from "./chunk-S27IADFU.js";
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-3HZRRP4Y.js";
143
- import {
144
- bloomWallet
145
- } from "./chunk-S27IADFU.js";
146
- import "./chunk-23WIEY36.js";
147
143
  import {
148
144
  braveWallet
149
145
  } from "./chunk-PB254NQ4.js";
146
+ import {
147
+ coin98Wallet
148
+ } from "./chunk-DTRYS3MO.js";
149
+ import "./chunk-23WIEY36.js";
150
150
  import "./chunk-WRA2DVJ7.js";
151
151
  export {
152
152
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -45,15 +45,15 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@aws-sdk/client-s3": "^3.600.0",
48
- "@chromatic-com/storybook": "^3.2.2",
48
+ "@chromatic-com/storybook": "^3.2.4",
49
49
  "@meshconnect/node-api": "2.0.14",
50
- "@storybook/addon-essentials": "^8.4.4",
51
- "@storybook/addon-interactions": "^8.4.4",
52
- "@storybook/addon-links": "^8.4.4",
53
- "@storybook/blocks": "^8.4.4",
54
- "@storybook/react": "^8.4.4",
55
- "@storybook/react-vite": "^8.4.4",
56
- "@storybook/test": "^8.4.4",
50
+ "@storybook/addon-essentials": "^8.5.3",
51
+ "@storybook/addon-interactions": "^8.5.3",
52
+ "@storybook/addon-links": "^8.5.3",
53
+ "@storybook/blocks": "^8.5.3",
54
+ "@storybook/react": "^8.5.3",
55
+ "@storybook/react-vite": "^8.5.3",
56
+ "@storybook/test": "^8.5.3",
57
57
  "@testing-library/jest-dom": "^6.2.0",
58
58
  "@testing-library/react": "^16.0.1",
59
59
  "@testing-library/user-event": "^14.5.2",
@@ -67,7 +67,7 @@
67
67
  "jsdom": "^25.0.1",
68
68
  "postcss": "^8.4.32",
69
69
  "react": "^18.3.0",
70
- "storybook": "^8.4.4",
70
+ "storybook": "^8.5.3",
71
71
  "tsx": "^4.19.2",
72
72
  "vitest": "^2.0.5"
73
73
  },
@@ -75,6 +75,7 @@
75
75
  "@datadog/browser-logs": "5.22.0",
76
76
  "@meshconnect/web-link-sdk": "2.1.1",
77
77
  "@moonpay/moonpay-react": "^1.6.1",
78
+ "@number-flow/react": "^0.5.5",
78
79
  "@privy-io/js-sdk-core": "^0.21.0",
79
80
  "@types/uuid": "^9.0.8",
80
81
  "@vanilla-extract/css": "1.15.3",
@@ -83,15 +84,16 @@
83
84
  "@wagmi/core": "^2.13.0",
84
85
  "bech32": "^2.0.0",
85
86
  "clsx": "2.1.1",
87
+ "motion": "^12.0.11",
86
88
  "qrcode": "1.5.3",
87
89
  "react-remove-scroll": "2.5.7",
88
90
  "react-virtuoso": "4.10.1",
89
91
  "ua-parser-js": "^1.0.37",
90
92
  "uuid": "^9.0.1",
93
+ "@funkit/api-base": "1.5.6",
94
+ "@funkit/core": "2.3.7",
91
95
  "@funkit/chains": "0.1.2",
92
- "@funkit/api-base": "1.5.4",
93
- "@funkit/core": "2.3.5",
94
- "@funkit/wagmi-tools": "3.0.27",
96
+ "@funkit/wagmi-tools": "3.0.29",
95
97
  "@funkit/utils": "1.0.6"
96
98
  },
97
99
  "repository": {