@funkit/connect 7.1.1 → 8.1.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.
- package/CHANGELOG.md +53 -0
- package/dist/__generated__/default_configs.d.ts +14 -0
- package/dist/components/CheckoutTopAnnouncementBanner/CheckoutTopAnnouncementBanner.d.ts +2 -0
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +5 -0
- package/dist/consts/assets.d.ts +1 -3
- package/dist/consts/customers.d.ts +0 -1
- package/dist/domains/relay.d.ts +0 -1
- package/dist/hooks/track/useTrack.d.ts +1 -0
- package/dist/hooks/useAllowedAssets.d.ts +3 -1
- package/dist/hooks/usePaymentSources.d.ts +2 -5
- package/dist/hooks/useTokenTransfer.d.ts +1 -1
- package/dist/index.js +1121 -1182
- package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +1 -0
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/state.d.ts +3 -1
- package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -1
- package/dist/utils/customer.d.ts +0 -6
- package/dist/utils/flags/config.d.ts +40 -8
- package/dist/utils/transfer.d.ts +2 -2
- package/dist/wallets/walletConnectors/index.js +21 -21
- package/package.json +6 -6
- package/dist/modals/CheckoutModal/ConfirmationStep/KatanaBridgeAlert.d.ts +0 -2
|
@@ -15,5 +15,5 @@ interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep
|
|
|
15
15
|
defaultFiatCurrency?: string;
|
|
16
16
|
textCustomizations: FunkitTextCustomizationsConfig['confirmationScreen'];
|
|
17
17
|
}
|
|
18
|
-
export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, onClose, sourceHolding, unitPrice, currencyExchangeRates, defaultFiatCurrency, textCustomizations, }: InputAmountLoadedProps): React.JSX.Element;
|
|
18
|
+
export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, onClose, setModalState, sourceHolding, unitPrice, currencyExchangeRates, defaultFiatCurrency, textCustomizations, }: InputAmountLoadedProps): React.JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -24,6 +24,8 @@ export interface AmountInputInitOptions {
|
|
|
24
24
|
/** Whether meld is enabled */
|
|
25
25
|
meldEnabled: boolean;
|
|
26
26
|
apiKey: string;
|
|
27
|
+
/** Default value for isInputInFiat (preserved from modal state when navigating back) */
|
|
28
|
+
defaultIsInputInFiat?: boolean;
|
|
27
29
|
}
|
|
28
30
|
export interface AmountInputState {
|
|
29
31
|
/** Current amount, in target asset. Undefined if input is empty */
|
|
@@ -106,6 +108,6 @@ export type AmountInputError = {
|
|
|
106
108
|
* Return half the balance and round up to nearest 10, 100, 1000 etc
|
|
107
109
|
*/
|
|
108
110
|
export declare function calcInitialFiatAmount(balance: number): number;
|
|
109
|
-
export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, }: AmountInputInitOptions): AmountInputState;
|
|
111
|
+
export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, defaultIsInputInFiat, }: AmountInputInitOptions): AmountInputState;
|
|
110
112
|
export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
|
|
111
113
|
export declare function getDerivedState(state: AmountInputState, targetAssetTicker: string): AmountInputDerivedState;
|
|
@@ -41,7 +41,9 @@ export interface CheckoutModalCommonState {
|
|
|
41
41
|
export interface ModalStepComponentProps<S extends FunCheckoutStep = FunCheckoutStep> {
|
|
42
42
|
modalState: CheckoutModalState<S>;
|
|
43
43
|
onBack(): void;
|
|
44
|
-
onClose(
|
|
44
|
+
onClose(options?: {
|
|
45
|
+
isNewDeposit?: boolean;
|
|
46
|
+
}): void;
|
|
45
47
|
onAnimationComplete(callback: () => void): void;
|
|
46
48
|
onNext(payload: NextPayload<S>): void;
|
|
47
49
|
setModalState(state: SetStateAction<CheckoutModalState<S>>): void;
|
package/dist/utils/customer.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { Address } from 'viem';
|
|
2
|
-
import type { ServerCheckoutConfig } from '../domains/clientMetadata';
|
|
3
|
-
import type { FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
4
|
-
export declare function isKatanaEarnFlow({ apiKey, checkoutConfig, }: {
|
|
5
|
-
apiKey: string;
|
|
6
|
-
checkoutConfig: FunkitCheckoutConfig | ServerCheckoutConfig | undefined;
|
|
7
|
-
}): boolean;
|
|
8
2
|
export type LighterSubAccount = {
|
|
9
3
|
code: number;
|
|
10
4
|
account_type: number;
|
|
@@ -7,7 +7,7 @@ export declare const flagConfig: {
|
|
|
7
7
|
readonly if_any: [{
|
|
8
8
|
readonly key: "apiKey";
|
|
9
9
|
readonly type: "isAnyOf";
|
|
10
|
-
readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "
|
|
10
|
+
readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG"];
|
|
11
11
|
}];
|
|
12
12
|
readonly value: "";
|
|
13
13
|
}];
|
|
@@ -23,7 +23,7 @@ export declare const flagConfig: {
|
|
|
23
23
|
readonly if_any: [{
|
|
24
24
|
readonly key: "apiKey";
|
|
25
25
|
readonly type: "isAnyOf";
|
|
26
|
-
readonly values: ["
|
|
26
|
+
readonly values: ["2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc"];
|
|
27
27
|
}];
|
|
28
28
|
readonly value: true;
|
|
29
29
|
}];
|
|
@@ -35,7 +35,7 @@ export declare const flagConfig: {
|
|
|
35
35
|
readonly if_any: [{
|
|
36
36
|
readonly key: "apiKey";
|
|
37
37
|
readonly type: "isAnyOf";
|
|
38
|
-
readonly values: ["di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe"];
|
|
38
|
+
readonly values: ["di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG"];
|
|
39
39
|
}];
|
|
40
40
|
readonly value: true;
|
|
41
41
|
}, Override<boolean>];
|
|
@@ -47,7 +47,7 @@ export declare const flagConfig: {
|
|
|
47
47
|
readonly if_any: [{
|
|
48
48
|
readonly key: "apiKey";
|
|
49
49
|
readonly type: "isAnyOf";
|
|
50
|
-
readonly values: ["di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe"];
|
|
50
|
+
readonly values: ["di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG"];
|
|
51
51
|
}];
|
|
52
52
|
readonly value: true;
|
|
53
53
|
}, Override<boolean>];
|
|
@@ -56,17 +56,42 @@ export declare const flagConfig: {
|
|
|
56
56
|
readonly type: "string";
|
|
57
57
|
readonly default_value: string;
|
|
58
58
|
readonly overrides: [{
|
|
59
|
+
readonly if_all: [{
|
|
60
|
+
readonly key: "apiKey";
|
|
61
|
+
readonly type: "isAnyOf";
|
|
62
|
+
readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6"];
|
|
63
|
+
}, {
|
|
64
|
+
readonly key: "userId";
|
|
65
|
+
readonly type: "isAnyOf";
|
|
66
|
+
readonly values: string[];
|
|
67
|
+
}];
|
|
59
68
|
readonly if_any: [{
|
|
69
|
+
readonly key: "userId";
|
|
70
|
+
readonly type: "isAnyOf";
|
|
71
|
+
readonly values: string[];
|
|
72
|
+
}];
|
|
73
|
+
readonly value: string;
|
|
74
|
+
}, {
|
|
75
|
+
readonly if_all: [{
|
|
60
76
|
readonly key: "apiKey";
|
|
61
77
|
readonly type: "isAnyOf";
|
|
62
|
-
readonly values: ["
|
|
78
|
+
readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6"];
|
|
79
|
+
}, {
|
|
80
|
+
readonly key: "userId";
|
|
81
|
+
readonly type: "pctRollout";
|
|
82
|
+
readonly pct: 5;
|
|
83
|
+
}];
|
|
84
|
+
readonly if_any: [{
|
|
85
|
+
readonly key: "userId";
|
|
86
|
+
readonly type: "pctRollout";
|
|
87
|
+
readonly pct: 5;
|
|
63
88
|
}];
|
|
64
89
|
readonly value: string;
|
|
65
90
|
}, {
|
|
66
91
|
readonly if_any: [{
|
|
67
92
|
readonly key: "apiKey";
|
|
68
93
|
readonly type: "isAnyOf";
|
|
69
|
-
readonly values: ["
|
|
94
|
+
readonly values: ["M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um"];
|
|
70
95
|
}];
|
|
71
96
|
readonly value: string;
|
|
72
97
|
}, {
|
|
@@ -87,7 +112,7 @@ export declare const flagConfig: {
|
|
|
87
112
|
readonly if_any: [{
|
|
88
113
|
readonly key: "apiKey";
|
|
89
114
|
readonly type: "isAnyOf";
|
|
90
|
-
readonly values: ["
|
|
115
|
+
readonly values: ["clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6"];
|
|
91
116
|
}];
|
|
92
117
|
readonly value: string;
|
|
93
118
|
}];
|
|
@@ -194,6 +219,13 @@ export declare const flagConfig: {
|
|
|
194
219
|
readonly values: string[];
|
|
195
220
|
}];
|
|
196
221
|
readonly value: true;
|
|
222
|
+
}, {
|
|
223
|
+
readonly if_any: [{
|
|
224
|
+
readonly key: "apiKey";
|
|
225
|
+
readonly type: "isAnyOf";
|
|
226
|
+
readonly values: ["di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG"];
|
|
227
|
+
}];
|
|
228
|
+
readonly value: true;
|
|
197
229
|
}, Override<boolean>, {
|
|
198
230
|
readonly if_any: [{
|
|
199
231
|
readonly key: "apiKey";
|
|
@@ -210,7 +242,7 @@ export declare const flagConfig: {
|
|
|
210
242
|
readonly if_any: [{
|
|
211
243
|
readonly key: "apiKey";
|
|
212
244
|
readonly type: "isAnyOf";
|
|
213
|
-
readonly values: ["di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe"];
|
|
245
|
+
readonly values: ["di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG"];
|
|
214
246
|
}];
|
|
215
247
|
readonly value: true;
|
|
216
248
|
}, Override<boolean>, {
|
package/dist/utils/transfer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { FunAddress } from '@funkit/api-base';
|
|
2
|
-
export type TransferTokenQrCodeType = 'ethereum' | 'solana' | 'bitcoin';
|
|
2
|
+
export type TransferTokenQrCodeType = 'ethereum' | 'solana' | 'bitcoin' | 'tron';
|
|
3
3
|
interface TransferTokenQrCodeUriParams {
|
|
4
4
|
depositAddress: FunAddress;
|
|
5
5
|
type: TransferTokenQrCodeType;
|
|
6
6
|
}
|
|
7
|
-
export type QRCodeUri = `ethereum:${FunAddress}` | `solana:${FunAddress}` | `bitcoin:${FunAddress}
|
|
7
|
+
export type QRCodeUri = `ethereum:${FunAddress}` | `solana:${FunAddress}` | `bitcoin:${FunAddress}` | FunAddress;
|
|
8
8
|
export declare const getTransferTokenQrCodeUri: (props: TransferTokenQrCodeUriParams) => QRCodeUri;
|
|
9
9
|
export {};
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
zerionWallet
|
|
7
7
|
} from "./chunk-CZYUE3AR.js";
|
|
8
|
-
import {
|
|
9
|
-
tahoWallet
|
|
10
|
-
} from "./chunk-TNZJRXUQ.js";
|
|
11
8
|
import {
|
|
12
9
|
talismanWallet
|
|
13
10
|
} from "./chunk-JTLLKY2O.js";
|
|
11
|
+
import {
|
|
12
|
+
subWallet
|
|
13
|
+
} from "./chunk-2E4PDCEJ.js";
|
|
14
14
|
import {
|
|
15
15
|
tokenPocketWallet
|
|
16
16
|
} from "./chunk-47QF6EET.js";
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
xdefiWallet
|
|
31
31
|
} from "./chunk-TMFH6GXS.js";
|
|
32
32
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
33
|
+
phantomWallet
|
|
34
|
+
} from "./chunk-3IYE623P.js";
|
|
35
35
|
import {
|
|
36
36
|
rainbowWallet
|
|
37
37
|
} from "./chunk-77UTBHGP.js";
|
|
@@ -51,8 +51,8 @@ import {
|
|
|
51
51
|
safepalWallet
|
|
52
52
|
} from "./chunk-W7Y6I22Y.js";
|
|
53
53
|
import {
|
|
54
|
-
|
|
55
|
-
} from "./chunk-
|
|
54
|
+
tahoWallet
|
|
55
|
+
} from "./chunk-TNZJRXUQ.js";
|
|
56
56
|
import {
|
|
57
57
|
metaMaskWallet
|
|
58
58
|
} from "./chunk-RA7MCWF4.js";
|
|
@@ -75,8 +75,8 @@ import {
|
|
|
75
75
|
oneKeyWallet
|
|
76
76
|
} from "./chunk-35Q4HKAM.js";
|
|
77
77
|
import {
|
|
78
|
-
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
rabbyWallet
|
|
79
|
+
} from "./chunk-LW6S43RE.js";
|
|
80
80
|
import {
|
|
81
81
|
foxWallet
|
|
82
82
|
} from "./chunk-YLJDPTYF.js";
|
|
@@ -92,24 +92,24 @@ import {
|
|
|
92
92
|
import {
|
|
93
93
|
imTokenWallet
|
|
94
94
|
} from "./chunk-COZ7MIQS.js";
|
|
95
|
-
import {
|
|
96
|
-
injectedWallet
|
|
97
|
-
} from "./chunk-MQSCN4BO.js";
|
|
98
95
|
import {
|
|
99
96
|
kresusWallet
|
|
100
97
|
} from "./chunk-MJXPRJZT.js";
|
|
98
|
+
import {
|
|
99
|
+
injectedWallet
|
|
100
|
+
} from "./chunk-MQSCN4BO.js";
|
|
101
101
|
import {
|
|
102
102
|
ledgerWallet
|
|
103
103
|
} from "./chunk-BRBKM4PW.js";
|
|
104
104
|
import {
|
|
105
|
-
|
|
106
|
-
} from "./chunk-
|
|
107
|
-
import {
|
|
108
|
-
clvWallet
|
|
109
|
-
} from "./chunk-HPHADOYD.js";
|
|
105
|
+
bloomWallet
|
|
106
|
+
} from "./chunk-S27IADFU.js";
|
|
110
107
|
import {
|
|
111
108
|
coin98Wallet
|
|
112
109
|
} from "./chunk-RLRQYUYC.js";
|
|
110
|
+
import {
|
|
111
|
+
clvWallet
|
|
112
|
+
} from "./chunk-HPHADOYD.js";
|
|
113
113
|
import {
|
|
114
114
|
coinbaseWallet
|
|
115
115
|
} from "./chunk-H4IRCEZN.js";
|
|
@@ -140,13 +140,13 @@ import {
|
|
|
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-4ZXII3UA.js";
|
|
146
|
+
import {
|
|
147
|
+
bybitWallet
|
|
148
|
+
} from "./chunk-5EAOMOTO.js";
|
|
149
|
+
import "./chunk-23WIEY36.js";
|
|
150
150
|
import "./chunk-ARYAYQ7Z.js";
|
|
151
151
|
export {
|
|
152
152
|
argentWallet,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"postcss-prefix-selector": "^1.16.0",
|
|
72
72
|
"process": "^0.11.10",
|
|
73
73
|
"react": "^18.3.0",
|
|
74
|
-
"storybook": "^9.1.
|
|
74
|
+
"storybook": "^9.1.17",
|
|
75
75
|
"stream-browserify": "^3.0.0",
|
|
76
76
|
"tsx": "^4.19.2",
|
|
77
77
|
"tsc-alias": "1.8.16",
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
"ua-parser-js": "^1.0.37",
|
|
103
103
|
"use-debounce": "^10.0.5",
|
|
104
104
|
"uuid": "^9.0.1",
|
|
105
|
-
"@funkit/api-base": "1.
|
|
106
|
-
"@funkit/chains": "
|
|
107
|
-
"@funkit/fun-relay": "2.2.
|
|
108
|
-
"@funkit/utils": "1.1.
|
|
105
|
+
"@funkit/api-base": "2.1.0",
|
|
106
|
+
"@funkit/chains": "1.1.0",
|
|
107
|
+
"@funkit/fun-relay": "2.2.2",
|
|
108
|
+
"@funkit/utils": "1.1.23"
|
|
109
109
|
},
|
|
110
110
|
"repository": {
|
|
111
111
|
"type": "git",
|