@funkit/connect 5.5.14 → 5.5.15

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.
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
- import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
3
2
  import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
4
3
  interface CheckoutPrimaryInfoProps {
5
4
  showTokenAmount?: boolean;
6
5
  config: FunkitCheckoutConfig;
7
- quote: FunkitCheckoutQuoteResult | null;
6
+ usdAmount?: number;
8
7
  isLoading?: boolean;
9
8
  }
10
- export declare function CheckoutPrimaryInfo({ showTokenAmount, quote, config, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
9
+ export declare function CheckoutPrimaryInfo({ showTokenAmount, usdAmount, config, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
11
10
  export {};
@@ -6,17 +6,17 @@ type WithNewUser<T> = T & {
6
6
  newUser?: boolean;
7
7
  };
8
8
  export type LoadingAccountNext = WithNewUser<{
9
- usablePaymentMethod: PaymentMethod.ACCOUNT_BALANCE;
9
+ chosenPaymentMethod: PaymentMethod.ACCOUNT_BALANCE;
10
10
  paymentMethodInfo: PaymentMethodAccountInfo;
11
11
  } | {
12
- usablePaymentMethod: PaymentMethod.BROKERAGE;
12
+ chosenPaymentMethod: PaymentMethod.BROKERAGE;
13
13
  paymentMethodInfo: PaymentMethodBrokerageInfo;
14
14
  } | {
15
- usablePaymentMethod: PaymentMethod.VIRTUAL_BANK;
15
+ chosenPaymentMethod: PaymentMethod.VIRTUAL_BANK;
16
16
  paymentMethodInfo: PaymentMethodVirtualBankInfo;
17
17
  } | {
18
18
  /** Can be set to null to skip auto payment method selection */
19
- usablePaymentMethod: null | PaymentMethod.TOKEN_TRANSFER;
19
+ chosenPaymentMethod: null | PaymentMethod.TOKEN_TRANSFER;
20
20
  paymentMethodInfo?: ConnectablePaymentMethodInfo;
21
21
  }>;
22
22
  export declare const LoadingAccountInfo: ModalStepInfo<FunCheckoutStep.LOADING_ACCOUNT>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
3
+ interface DefiPurchaseSectionProps {
4
+ config: FunkitCheckoutConfig;
5
+ }
6
+ export declare const DefiPurchaseSection: ({ config }: DefiPurchaseSectionProps) => React.JSX.Element;
7
+ export {};
@@ -28,6 +28,8 @@ export interface CheckoutModalCommonState {
28
28
  isSoftHidden: boolean;
29
29
  /** Whether checkout should not be allowed to continue due to security reasons*/
30
30
  isBlocked?: boolean;
31
+ /** Whether checkout is started in a defi mode which has various flow implications (most importantly targetAssetAmount must be set and is not editable throughout the checkout)*/
32
+ isDefiMode: boolean;
31
33
  targetChainId: string;
32
34
  }
33
35
  export interface ModalStepComponentProps<S extends FunCheckoutStep = FunCheckoutStep> {
@@ -65,6 +67,7 @@ export declare enum FunCheckoutStep {
65
67
  interface ModalStepInput<S extends FunCheckoutStep> {
66
68
  state: CheckoutModalState<S>;
67
69
  apiKey: string;
70
+ isDefiMode?: boolean;
68
71
  }
69
72
  export type ModalStepInfo<S extends FunCheckoutStep> = {
70
73
  Component: ComponentType<ModalStepComponentProps<S>>;
@@ -75,7 +78,7 @@ export type ModalStepInfo<S extends FunCheckoutStep> = {
75
78
  onNext(state: CheckoutModalState<S>, payload: NextPayload<S>): CheckoutModalState;
76
79
  showFullHeight?: boolean;
77
80
  /** Defaults to checkoutItem.initSettings.config.modalTitle (returning undefined uses default) */
78
- title?(textCustomizations: FunkitTextCustomizationsConfig): string | undefined;
81
+ title?(textCustomizations: FunkitTextCustomizationsConfig, isDefiMode: boolean): string | undefined;
79
82
  /** If title is not defined in config nor with the title() function, this is used instead. Defaults to 'Checkout' */
80
83
  fallbackTitle?: string;
81
84
  };
@@ -39,6 +39,8 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
39
39
  checkoutItemAmount?: number;
40
40
  /** amount of source token. it is not baseUnit **/
41
41
  withdrawalSourceTokenBalance?: () => number;
42
+ /** Whether checkout should be started in Defi mode, which has various flow implications (most importantly targetAssetAmount must be set and is not editable throughout the checkout) */
43
+ isDefiMode?: boolean;
42
44
  /** *****************************
43
45
  * Miscellaneous configurations *
44
46
  ********************************/
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-ICCAQZHZ.js";
4
+ } from "../chunk-DMCSGHKQ.js";
5
5
  import "../chunk-R2UFCJL7.js";
6
6
  export {
7
7
  darkTheme
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-RN4I4Y57.js";
4
+ } from "../chunk-UQVBCTN3.js";
5
5
  import "../chunk-R2UFCJL7.js";
6
6
  export {
7
7
  lightTheme
@@ -1,6 +1,5 @@
1
1
  import type { FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
2
2
  export type { AssetHoldingsItem, AssetHoldingsMap, KnownAssetHoldingsItem, } from '~/domains/wallet';
3
- export declare const ASSETS_LOW_VALUE_THRESHOLD = 0.1;
4
3
  export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number | string, decimals: number) => number;
5
4
  /**
6
5
  *
@@ -1,12 +1,9 @@
1
1
  export declare const MINIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 35;
2
2
  export declare const MAXIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 10000;
3
3
  export declare const generateMoonpayCurrencyCode: (tokenSymbol: string, chainId: string) => string;
4
- export declare function checkAmountForMoonpay(amountUsd: number): {
4
+ export declare function checkAmountForMoonpay(amountUsd: number, isDefiMode?: boolean): {
5
5
  readonly isInvalid: true;
6
- readonly message: "$35 minimum required for the selected payment method.";
7
- } | {
8
- readonly isInvalid: true;
9
- readonly message: "$10000 maximum exceeded for the selected payment method.";
6
+ readonly message: string;
10
7
  } | {
11
8
  readonly isInvalid: false;
12
9
  readonly message?: undefined;
@@ -9,53 +9,53 @@ import {
9
9
  zerionWallet
10
10
  } from "./chunk-AXWP3GD4.js";
11
11
  import {
12
- tahoWallet
13
- } from "./chunk-6P2EMPZI.js";
14
- import {
15
- safepalWallet
16
- } from "./chunk-MSFKSQBY.js";
12
+ subWallet
13
+ } from "./chunk-AD2KIJB6.js";
17
14
  import {
18
15
  talismanWallet
19
16
  } from "./chunk-ABFSXBE6.js";
17
+ import {
18
+ tahoWallet
19
+ } from "./chunk-6P2EMPZI.js";
20
20
  import {
21
21
  tokenaryWallet
22
22
  } from "./chunk-SLOIIJGP.js";
23
23
  import {
24
24
  tokenPocketWallet
25
25
  } from "./chunk-IDKVN5CF.js";
26
+ import {
27
+ trustWallet
28
+ } from "./chunk-ISIBREBO.js";
26
29
  import {
27
30
  uniswapWallet
28
31
  } from "./chunk-LH7BMNFZ.js";
29
32
  import {
30
33
  walletConnectWallet
31
34
  } from "./chunk-NP5QGWNL.js";
32
- import {
33
- trustWallet
34
- } from "./chunk-ISIBREBO.js";
35
35
  import {
36
36
  phantomWallet
37
37
  } from "./chunk-ZSVTX6EK.js";
38
38
  import {
39
- oneKeyWallet
40
- } from "./chunk-4AD7VI2P.js";
39
+ rabbyWallet
40
+ } from "./chunk-BVX4XGNP.js";
41
41
  import {
42
42
  rainbowWallet
43
43
  } from "./chunk-2UCNRD7H.js";
44
44
  import {
45
45
  ramperWallet
46
46
  } from "./chunk-PIUNLQJG.js";
47
- import {
48
- safeWallet
49
- } from "./chunk-BQQQL6UD.js";
50
47
  import {
51
48
  roninWallet
52
49
  } from "./chunk-63YLN6R5.js";
50
+ import {
51
+ safeWallet
52
+ } from "./chunk-BQQQL6UD.js";
53
53
  import {
54
54
  safeheronWallet
55
55
  } from "./chunk-R6RWZRFF.js";
56
56
  import {
57
- subWallet
58
- } from "./chunk-AD2KIJB6.js";
57
+ safepalWallet
58
+ } from "./chunk-MSFKSQBY.js";
59
59
  import {
60
60
  metaMaskWallet
61
61
  } from "./chunk-G73C6P5P.js";
@@ -78,8 +78,8 @@ import {
78
78
  oneInchWallet
79
79
  } from "./chunk-OESTDX6I.js";
80
80
  import {
81
- rabbyWallet
82
- } from "./chunk-BVX4XGNP.js";
81
+ oneKeyWallet
82
+ } from "./chunk-4AD7VI2P.js";
83
83
  import {
84
84
  foxWallet
85
85
  } from "./chunk-LMZMXEXL.js";
@@ -101,15 +101,15 @@ import {
101
101
  import {
102
102
  kresusWallet
103
103
  } from "./chunk-MJXPRJZT.js";
104
+ import {
105
+ clvWallet
106
+ } from "./chunk-KR6JBW5E.js";
104
107
  import {
105
108
  bybitWallet
106
109
  } from "./chunk-6ONTSPEY.js";
107
110
  import {
108
111
  coin98Wallet
109
112
  } from "./chunk-DTRYS3MO.js";
110
- import {
111
- clvWallet
112
- } from "./chunk-KR6JBW5E.js";
113
113
  import {
114
114
  coinbaseWallet
115
115
  } from "./chunk-H4IRCEZN.js";
@@ -129,14 +129,14 @@ import {
129
129
  argentWallet
130
130
  } from "./chunk-WSQ2YJO2.js";
131
131
  import {
132
- bitgetWallet
133
- } from "./chunk-A5APNTGL.js";
132
+ bitskiWallet
133
+ } from "./chunk-P74YPRF6.js";
134
134
  import {
135
135
  bifrostWallet
136
136
  } from "./chunk-W6N74MS3.js";
137
137
  import {
138
- bitskiWallet
139
- } from "./chunk-P74YPRF6.js";
138
+ bitgetWallet
139
+ } from "./chunk-A5APNTGL.js";
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-3HZRRP4Y.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "5.5.14",
3
+ "version": "5.5.15",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -88,12 +88,12 @@
88
88
  "ua-parser-js": "^1.0.37",
89
89
  "use-debounce": "^10.0.5",
90
90
  "uuid": "^9.0.1",
91
- "@funkit/api-base": "1.9.6",
92
- "@funkit/core": "2.3.28",
91
+ "@funkit/api-base": "1.9.7",
93
92
  "@funkit/chains": "0.3.3",
93
+ "@funkit/core": "2.3.29",
94
94
  "@funkit/fun-relay": "0.1.9",
95
- "@funkit/utils": "1.1.5",
96
- "@funkit/wagmi-tools": "3.0.50"
95
+ "@funkit/wagmi-tools": "3.0.51",
96
+ "@funkit/utils": "1.1.5"
97
97
  },
98
98
  "repository": {
99
99
  "type": "git",
@@ -81,8 +81,8 @@ var darkTheme = ({
81
81
  buttonTextTertiary: "#FFF",
82
82
  buttonTextDisabledTertiary: "rgba(255, 255, 255, 0.65)",
83
83
  buttonBackground: "#FFF",
84
- buttonBackgroundPressed: "#FFF",
85
84
  buttonBackgroundHover: "#f2f2f2",
85
+ buttonBackgroundPressed: "#FFF",
86
86
  buttonBackgroundDisabled: "rgba(255, 255, 255, 0.65)",
87
87
  buttonTextSecondaryDisabled: "rgba(255, 255, 255, 0.65)",
88
88
  buttonTextSecondary: "#FFFFFF",
@@ -81,8 +81,8 @@ var lightTheme = ({
81
81
  buttonTextTertiary: "#000",
82
82
  buttonTextDisabledTertiary: "rgba(0, 0, 0, 0.5)",
83
83
  buttonBackground: "#000",
84
- buttonBackgroundPressed: "#000",
85
84
  buttonBackgroundHover: "#333333",
85
+ buttonBackgroundPressed: "#000",
86
86
  buttonBackgroundDisabled: "rgba(0, 0, 0, 0.5)",
87
87
  buttonTextSecondaryDisabled: "rgba(0, 0, 0, 0.5)",
88
88
  buttonTextSecondary: "#000000",