@funkit/connect 5.5.6 → 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;
@@ -275,7 +275,11 @@ export declare const flagConfig: {
275
275
  values: string[];
276
276
  pct?: undefined;
277
277
  })[];
278
- if_any: never[];
278
+ if_any: {
279
+ key: "userId";
280
+ type: "pctRollout";
281
+ pct: number;
282
+ }[];
279
283
  value: true;
280
284
  } | {
281
285
  if_any: {
@@ -291,4 +295,8 @@ export declare const flagConfig: {
291
295
  type: "string";
292
296
  default_value: string;
293
297
  };
298
+ min_token_transfer_value: {
299
+ type: "string";
300
+ default_value: string;
301
+ };
294
302
  };
@@ -1,70 +1,70 @@
1
1
  "use client";
2
2
  import {
3
- walletConnectWallet
4
- } from "./chunk-NP5QGWNL.js";
3
+ xdefiWallet
4
+ } from "./chunk-NO7XMBB5.js";
5
5
  import {
6
6
  zealWallet
7
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";
17
14
  import {
18
15
  talismanWallet
19
16
  } from "./chunk-ABFSXBE6.js";
17
+ import {
18
+ safeheronWallet
19
+ } from "./chunk-R6RWZRFF.js";
20
20
  import {
21
21
  tokenPocketWallet
22
22
  } from "./chunk-FRGSRLTS.js";
23
23
  import {
24
24
  trustWallet
25
25
  } from "./chunk-IPOC2VJX.js";
26
- import {
27
- tokenaryWallet
28
- } from "./chunk-SLOIIJGP.js";
29
26
  import {
30
27
  uniswapWallet
31
28
  } from "./chunk-LH7BMNFZ.js";
32
29
  import {
33
- xdefiWallet
34
- } from "./chunk-NO7XMBB5.js";
30
+ walletConnectWallet
31
+ } from "./chunk-NP5QGWNL.js";
35
32
  import {
36
- rabbyWallet
37
- } from "./chunk-BVX4XGNP.js";
33
+ tokenaryWallet
34
+ } from "./chunk-SLOIIJGP.js";
38
35
  import {
39
- oneInchWallet
40
- } from "./chunk-OESTDX6I.js";
36
+ omniWallet
37
+ } from "./chunk-7CUY5G6R.js";
41
38
  import {
42
- ramperWallet
43
- } from "./chunk-PIUNLQJG.js";
39
+ rabbyWallet
40
+ } from "./chunk-BVX4XGNP.js";
44
41
  import {
45
42
  rainbowWallet
46
43
  } from "./chunk-MOOBCMMB.js";
47
- import {
48
- safeWallet
49
- } from "./chunk-BQQQL6UD.js";
50
44
  import {
51
45
  roninWallet
52
46
  } from "./chunk-25VW5TZP.js";
53
47
  import {
54
- safeheronWallet
55
- } from "./chunk-R6RWZRFF.js";
48
+ ramperWallet
49
+ } from "./chunk-PIUNLQJG.js";
50
+ import {
51
+ safeWallet
52
+ } from "./chunk-BQQQL6UD.js";
56
53
  import {
57
54
  safepalWallet
58
55
  } from "./chunk-6LPM6LUQ.js";
56
+ import {
57
+ subWallet
58
+ } from "./chunk-4UM4GTKZ.js";
59
59
  import {
60
60
  ledgerWallet
61
61
  } from "./chunk-BRBKM4PW.js";
62
- import {
63
- metaMaskWallet
64
- } from "./chunk-N2NIIUW6.js";
65
62
  import {
66
63
  mewWallet
67
64
  } from "./chunk-V57WLZEE.js";
65
+ import {
66
+ metaMaskWallet
67
+ } from "./chunk-N2NIIUW6.js";
68
68
  import {
69
69
  oktoWallet
70
70
  } from "./chunk-ADIXAKUL.js";
@@ -72,8 +72,8 @@ import {
72
72
  okxWallet
73
73
  } from "./chunk-3U3BMEH5.js";
74
74
  import {
75
- omniWallet
76
- } from "./chunk-7CUY5G6R.js";
75
+ oneInchWallet
76
+ } from "./chunk-OESTDX6I.js";
77
77
  import {
78
78
  oneKeyWallet
79
79
  } from "./chunk-4AD7VI2P.js";
@@ -92,61 +92,61 @@ import {
92
92
  import {
93
93
  gateWallet
94
94
  } from "./chunk-3NC26XLM.js";
95
- import {
96
- imTokenWallet
97
- } from "./chunk-COZ7MIQS.js";
98
95
  import {
99
96
  injectedWallet
100
97
  } from "./chunk-VCVVV2K7.js";
98
+ import {
99
+ imTokenWallet
100
+ } from "./chunk-COZ7MIQS.js";
101
101
  import {
102
102
  kresusWallet
103
103
  } from "./chunk-MJXPRJZT.js";
104
+ import {
105
+ bybitWallet
106
+ } from "./chunk-W5O4YSZN.js";
104
107
  import {
105
108
  clvWallet
106
109
  } from "./chunk-LEXSM5KI.js";
107
110
  import {
108
- braveWallet
109
- } from "./chunk-PB254NQ4.js";
111
+ coinbaseWallet
112
+ } from "./chunk-H4IRCEZN.js";
110
113
  import {
111
114
  coin98Wallet
112
115
  } from "./chunk-KFFJPS5R.js";
113
116
  import {
114
- coinbaseWallet
115
- } from "./chunk-H4IRCEZN.js";
117
+ dawnWallet
118
+ } from "./chunk-LN7OD5EC.js";
116
119
  import {
117
120
  coreWallet
118
121
  } from "./chunk-JXP2QPW7.js";
119
122
  import {
120
- dawnWallet
121
- } from "./chunk-LN7OD5EC.js";
123
+ enkryptWallet
124
+ } from "./chunk-SJTXS4ZW.js";
122
125
  import {
123
126
  desigWallet
124
127
  } from "./chunk-CTU6JCOK.js";
125
128
  import {
126
- enkryptWallet
127
- } from "./chunk-SJTXS4ZW.js";
128
- import {
129
- bitgetWallet
130
- } from "./chunk-7GSNBOD3.js";
129
+ argentWallet
130
+ } from "./chunk-WSQ2YJO2.js";
131
131
  import {
132
132
  bifrostWallet
133
133
  } from "./chunk-545L7Y4M.js";
134
- import {
135
- argentWallet
136
- } from "./chunk-WSQ2YJO2.js";
137
134
  import {
138
135
  bitskiWallet
139
136
  } from "./chunk-P74YPRF6.js";
137
+ import {
138
+ bitgetWallet
139
+ } from "./chunk-7GSNBOD3.js";
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-3HZRRP4Y.js";
143
+ import {
144
+ braveWallet
145
+ } from "./chunk-PB254NQ4.js";
146
+ import "./chunk-WRA2DVJ7.js";
143
147
  import {
144
148
  bloomWallet
145
149
  } from "./chunk-S27IADFU.js";
146
- import {
147
- bybitWallet
148
- } from "./chunk-W5O4YSZN.js";
149
- import "./chunk-WRA2DVJ7.js";
150
150
  import "./chunk-23WIEY36.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.5.6",
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.2",
96
- "@funkit/core": "2.3.24",
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/fun-relay": "0.1.7",
99
- "@funkit/utils": "1.1.2",
100
- "@funkit/wagmi-tools": "3.0.46"
96
+ "@funkit/fun-relay": "0.1.7"
101
97
  },
102
98
  "repository": {
103
99
  "type": "git",