@funkit/connect 5.5.7 → 5.5.9

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,9 +1,12 @@
1
1
  import React from 'react';
2
+ export declare const USD_AMOUNT_OPTIONS_PCT: number[];
2
3
  interface QuickOptionsProps {
4
+ currency?: string;
5
+ disabled?: boolean;
3
6
  onSelect?: (percentage: number) => void;
7
+ options?: number[];
4
8
  percentMode?: boolean;
5
- disabled?: boolean;
6
- currency?: string;
7
9
  }
8
- export declare const QuickOptions: ({ onSelect, percentMode, disabled, currency, }: QuickOptionsProps) => React.JSX.Element[];
10
+ export declare function useFiatAmountOptions(currency: string): number[];
11
+ export declare const QuickOptions: ({ currency, disabled, onSelect, options, percentMode, }: QuickOptionsProps) => React.JSX.Element[] | undefined;
9
12
  export {};
@@ -1,4 +1,4 @@
1
- import type { PaymentMethod } from '~/domains/paymentMethods';
1
+ import { PaymentMethod } from '~/domains/paymentMethods';
2
2
  import type { AssetHoldingsItem } from '~/utils/assets';
3
3
  import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
4
4
  export interface AmountInputInitOptions {
@@ -16,16 +16,20 @@ export interface AmountInputInitOptions {
16
16
  minUsd?: number;
17
17
  /** Currency code for the currently selected fiat currency. Defaults to USD */
18
18
  fiatCurrency?: string;
19
+ /** Quick options, in fiat (not %) */
20
+ quickOptions?: number[];
19
21
  }
20
22
  export interface AmountInputState {
21
23
  /** Current amount, in target asset */
22
24
  assetAmount: number;
23
- /** Current input value (with leading $ if in USD) */
25
+ /** Current amount, in fiat */
26
+ fiatAmount: number;
27
+ /** Fiat currency */
28
+ fiatCurrency: string;
29
+ /** Current input value (with leading currency symbol if in fiat) */
24
30
  inputValue: string;
25
- /** Whether the input is currently in USD */
26
- isInputInUsd: boolean;
27
- /** Current amount, in USD */
28
- usdAmount: number;
31
+ /** Whether the input is currently in fiat */
32
+ isInputInFiat: boolean;
29
33
  /** Estimated available amount, in USD (defaults to unlimited) */
30
34
  usdAvailableAmount: number | null;
31
35
  /** Maximum amount, in USD (defaults to unlimited) */
@@ -39,24 +43,22 @@ export interface AmountInputDerivedState extends AmountInputState {
39
43
  isValid: boolean;
40
44
  }
41
45
  export type AmountInputAction = {
42
- /** Switches between USD and absolute input mode */
43
- type: 'toggleInputInUsd';
44
- } | {
45
- /** Changes formatting to new currency code */
46
- type: 'changeFiatCurrency';
47
- fiatCurrency: string;
46
+ /** Switches between fiat and crypto input mode */
47
+ type: 'toggleInputInFiat';
48
48
  } | {
49
49
  /** Sets the input value as string */
50
50
  type: 'setInputValue';
51
51
  inputValue: string;
52
52
  unitPrice: number;
53
- fiatCurrency: string;
54
53
  } | {
55
- /** Sets the input value as USD amount */
56
- type: 'setUsdAmount';
54
+ /** Sets the input value as fiat amount */
55
+ type: 'setFiatAmount';
56
+ fiatAmount: number;
57
57
  unitPrice: number;
58
+ } | {
59
+ /** Changes formatting to new currency code */
60
+ type: 'setFiatCurrency';
58
61
  fiatCurrency: string;
59
- usdAmount: number;
60
62
  };
61
63
  export type AmountInputError = {
62
64
  /** Current amount is above available balance */
@@ -77,6 +79,6 @@ export type AmountInputError = {
77
79
  /** Input is empty */
78
80
  type: 'noInput';
79
81
  };
80
- export declare function initializeState({ apiKey, checkoutConfig, maxUsd, minUsd, paymentMethod, sourceHolding, unitPrice, defaultAmount, fiatCurrency, }: AmountInputInitOptions): AmountInputState;
82
+ export declare function initializeState({ apiKey, checkoutConfig, maxUsd, minUsd, paymentMethod, sourceHolding, unitPrice, defaultAmount, fiatCurrency, quickOptions, }: AmountInputInitOptions): AmountInputState;
81
83
  export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
82
84
  export declare function getDerivedState(state: AmountInputState): AmountInputDerivedState;
@@ -2,11 +2,11 @@ import { type AmountInputDerivedState, type AmountInputInitOptions } from './sta
2
2
  import { type InputAmountSuggestion } from './utils';
3
3
  interface UseAmountInputResult extends AmountInputDerivedState {
4
4
  onChange(event: React.ChangeEvent<HTMLInputElement>): void;
5
- toggleInputInUsd: () => void;
6
- setUsdAmount(usdAmount: number): AmountInputDerivedState;
7
5
  placeholder: string;
6
+ setFiatAmount(usdAmount: number): AmountInputDerivedState;
8
7
  /** Possible user action to recover from the current error */
9
8
  suggestion: InputAmountSuggestion | undefined;
9
+ toggleInputInFiat: () => void;
10
10
  }
11
11
  export declare function useAmountInput(options: AmountInputInitOptions): UseAmountInputResult;
12
12
  export {};
@@ -4,6 +4,7 @@ import type { AmountInputError } from './state';
4
4
  export declare const ASSET_DECIMALS = 5;
5
5
  export declare const USD_DECIMALS = 2;
6
6
  export declare const USD_INITIAL_AMOUNT = 100;
7
+ export declare function getDefaultAmountFromQuickOptions(quickOptions: number[] | undefined): number | undefined;
7
8
  export declare function getUsdMaxAmount(maxUsd: number): number | null;
8
9
  export declare function getUsdMinAmount(paymentMethod: PaymentMethod, defaultMin?: number): number;
9
10
  export interface InputAmountSuggestion {
@@ -3,12 +3,10 @@ import type { PaymentMethodCardInfo } from '~/domains/paymentMethods';
3
3
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
4
4
  export type MeldCurrencySelectState = CheckoutModalCommonState & {
5
5
  defaultCurrency: string;
6
- fiatAmount: number;
7
6
  paymentMethodInfo: PaymentMethodCardInfo;
8
7
  };
9
8
  export type MeldCurrencySelectNext = {
10
9
  currency: string;
11
- fiatAmount: number;
12
10
  };
13
11
  export declare const MeldCurrencySelectInfo: ModalStepInfo<FunCheckoutStep.MELD_CURRENCY_SELECT>;
14
12
  export declare function MeldCurrencySelect({ modalState, onNext, }: ModalStepComponentProps<FunCheckoutStep.MELD_CURRENCY_SELECT>): React.JSX.Element;
@@ -295,4 +295,8 @@ export declare const flagConfig: {
295
295
  type: "string";
296
296
  default_value: string;
297
297
  };
298
+ min_token_transfer_value: {
299
+ type: "string";
300
+ default_value: string;
301
+ };
298
302
  };
@@ -3,14 +3,11 @@ import {
3
3
  xdefiWallet
4
4
  } from "./chunk-NO7XMBB5.js";
5
5
  import {
6
- walletConnectWallet
7
- } from "./chunk-NP5QGWNL.js";
6
+ zealWallet
7
+ } from "./chunk-JROWU5BP.js";
8
8
  import {
9
9
  zerionWallet
10
10
  } from "./chunk-ETTNDQQG.js";
11
- import {
12
- subWallet
13
- } from "./chunk-4UM4GTKZ.js";
14
11
  import {
15
12
  tahoWallet
16
13
  } from "./chunk-6P2EMPZI.js";
@@ -18,59 +15,59 @@ import {
18
15
  talismanWallet
19
16
  } from "./chunk-ABFSXBE6.js";
20
17
  import {
21
- tokenaryWallet
22
- } from "./chunk-SLOIIJGP.js";
23
- import {
24
- trustWallet
25
- } from "./chunk-IPOC2VJX.js";
18
+ safeheronWallet
19
+ } from "./chunk-R6RWZRFF.js";
26
20
  import {
27
21
  tokenPocketWallet
28
22
  } from "./chunk-FRGSRLTS.js";
23
+ import {
24
+ trustWallet
25
+ } from "./chunk-IPOC2VJX.js";
29
26
  import {
30
27
  uniswapWallet
31
28
  } from "./chunk-LH7BMNFZ.js";
32
29
  import {
33
- zealWallet
34
- } from "./chunk-JROWU5BP.js";
30
+ walletConnectWallet
31
+ } from "./chunk-NP5QGWNL.js";
35
32
  import {
36
- phantomWallet
37
- } from "./chunk-ZSVTX6EK.js";
33
+ tokenaryWallet
34
+ } from "./chunk-SLOIIJGP.js";
38
35
  import {
39
- ramperWallet
40
- } from "./chunk-PIUNLQJG.js";
36
+ omniWallet
37
+ } from "./chunk-7CUY5G6R.js";
41
38
  import {
42
- roninWallet
43
- } from "./chunk-25VW5TZP.js";
39
+ rabbyWallet
40
+ } from "./chunk-BVX4XGNP.js";
44
41
  import {
45
42
  rainbowWallet
46
43
  } from "./chunk-MOOBCMMB.js";
47
44
  import {
48
- rabbyWallet
49
- } from "./chunk-BVX4XGNP.js";
45
+ roninWallet
46
+ } from "./chunk-25VW5TZP.js";
47
+ import {
48
+ ramperWallet
49
+ } from "./chunk-PIUNLQJG.js";
50
50
  import {
51
51
  safeWallet
52
52
  } from "./chunk-BQQQL6UD.js";
53
- import {
54
- safeheronWallet
55
- } from "./chunk-R6RWZRFF.js";
56
53
  import {
57
54
  safepalWallet
58
55
  } from "./chunk-6LPM6LUQ.js";
59
56
  import {
60
- imTokenWallet
61
- } from "./chunk-COZ7MIQS.js";
57
+ subWallet
58
+ } from "./chunk-4UM4GTKZ.js";
59
+ import {
60
+ ledgerWallet
61
+ } from "./chunk-BRBKM4PW.js";
62
62
  import {
63
63
  mewWallet
64
64
  } from "./chunk-V57WLZEE.js";
65
65
  import {
66
- ledgerWallet
67
- } from "./chunk-BRBKM4PW.js";
66
+ metaMaskWallet
67
+ } from "./chunk-N2NIIUW6.js";
68
68
  import {
69
69
  oktoWallet
70
70
  } from "./chunk-ADIXAKUL.js";
71
- import {
72
- omniWallet
73
- } from "./chunk-7CUY5G6R.js";
74
71
  import {
75
72
  okxWallet
76
73
  } from "./chunk-3U3BMEH5.js";
@@ -80,6 +77,9 @@ import {
80
77
  import {
81
78
  oneKeyWallet
82
79
  } from "./chunk-4AD7VI2P.js";
80
+ import {
81
+ phantomWallet
82
+ } from "./chunk-ZSVTX6EK.js";
83
83
  import {
84
84
  foxWallet
85
85
  } from "./chunk-XYBEMO3C.js";
@@ -95,36 +95,36 @@ import {
95
95
  import {
96
96
  injectedWallet
97
97
  } from "./chunk-VCVVV2K7.js";
98
+ import {
99
+ imTokenWallet
100
+ } from "./chunk-COZ7MIQS.js";
98
101
  import {
99
102
  kresusWallet
100
103
  } from "./chunk-MJXPRJZT.js";
101
- import {
102
- metaMaskWallet
103
- } from "./chunk-N2NIIUW6.js";
104
104
  import {
105
105
  bybitWallet
106
106
  } from "./chunk-W5O4YSZN.js";
107
+ import {
108
+ clvWallet
109
+ } from "./chunk-LEXSM5KI.js";
107
110
  import {
108
111
  coinbaseWallet
109
112
  } from "./chunk-H4IRCEZN.js";
110
113
  import {
111
114
  coin98Wallet
112
115
  } from "./chunk-KFFJPS5R.js";
113
- import {
114
- clvWallet
115
- } from "./chunk-LEXSM5KI.js";
116
116
  import {
117
117
  dawnWallet
118
118
  } from "./chunk-LN7OD5EC.js";
119
119
  import {
120
120
  coreWallet
121
121
  } from "./chunk-JXP2QPW7.js";
122
- import {
123
- desigWallet
124
- } from "./chunk-CTU6JCOK.js";
125
122
  import {
126
123
  enkryptWallet
127
124
  } from "./chunk-SJTXS4ZW.js";
125
+ import {
126
+ desigWallet
127
+ } from "./chunk-CTU6JCOK.js";
128
128
  import {
129
129
  argentWallet
130
130
  } from "./chunk-WSQ2YJO2.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "5.5.7",
3
+ "version": "5.5.9",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -45,16 +45,11 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@aws-sdk/client-cloudfront": "3.645.0",
48
- "@aws-sdk/client-s3": "3.645.0",
49
- "@chromatic-com/storybook": "^3.2.6",
48
+ "@aws-sdk/client-s3": "3.840.0",
49
+ "@chromatic-com/storybook": "^4.0.1",
50
50
  "@meshconnect/node-api": "2.0.14",
51
- "@storybook/addon-essentials": "^8.6.7",
52
- "@storybook/addon-interactions": "^8.6.7",
53
- "@storybook/addon-links": "^8.6.7",
54
- "@storybook/blocks": "^8.6.7",
55
- "@storybook/react": "^8.6.7",
56
- "@storybook/react-vite": "^8.6.7",
57
- "@storybook/test": "^8.6.7",
51
+ "@storybook/addon-links": "^9.0.15",
52
+ "@storybook/react-vite": "^9.0.15",
58
53
  "@testing-library/jest-dom": "^6.2.0",
59
54
  "@testing-library/react": "^16.0.1",
60
55
  "@testing-library/user-event": "^14.5.2",
@@ -68,9 +63,10 @@
68
63
  "jsdom": "^26.1.0",
69
64
  "postcss": "^8.4.33",
70
65
  "react": "^18.3.0",
71
- "storybook": "^8.6.7",
66
+ "storybook": "^9.0.15",
72
67
  "tsx": "^4.19.2",
73
- "vitest": "^3.0.9"
68
+ "vitest": "^3.0.9",
69
+ "@storybook/addon-docs": "^9.0.15"
74
70
  },
75
71
  "dependencies": {
76
72
  "@datadog/browser-logs": "5.22.0",
@@ -92,12 +88,12 @@
92
88
  "ua-parser-js": "^1.0.37",
93
89
  "use-debounce": "^10.0.5",
94
90
  "uuid": "^9.0.1",
95
- "@funkit/api-base": "1.9.3",
96
- "@funkit/core": "2.3.25",
91
+ "@funkit/api-base": "1.9.4",
92
+ "@funkit/utils": "1.1.3",
93
+ "@funkit/wagmi-tools": "3.0.48",
94
+ "@funkit/core": "2.3.26",
97
95
  "@funkit/chains": "0.3.1",
98
- "@funkit/wagmi-tools": "3.0.47",
99
- "@funkit/fun-relay": "0.1.7",
100
- "@funkit/utils": "1.1.2"
96
+ "@funkit/fun-relay": "0.1.7"
101
97
  },
102
98
  "repository": {
103
99
  "type": "git",