@funkit/connect 7.1.0-next.5 → 7.1.0-next.8
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 +38 -0
- package/dist/__generated__/default_configs.d.ts +68 -2
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +7 -6
- package/dist/domains/asset.d.ts +0 -4
- package/dist/domains/quote.d.ts +1 -1
- package/dist/hooks/useIsBlacklistedWithdrawalAddress.d.ts +4 -0
- package/dist/{modals/CheckoutModal → hooks}/useWalletAssetHoldings.d.ts +1 -1
- package/dist/index.js +1472 -1234
- package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +0 -7
- package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +4 -2
- package/dist/modals/CheckoutModal/ConfirmationStep/usePostCheckout.d.ts +0 -6
- package/dist/modals/CheckoutModal/{useSourceAssetConfirm.d.ts → ConfirmationStep/useSourceAssetConfirm.d.ts} +0 -2
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/state.d.ts +2 -1
- package/dist/modals/CheckoutModal/stepTransition.d.ts +1 -0
- package/dist/providers/FunkitQuoteContext.d.ts +1 -2
- package/dist/wallets/walletConnectors/index.js +12 -12
- package/package.json +5 -5
- package/dist/modals/CheckoutModal/useNewCheckoutQuote.d.ts +0 -7
|
@@ -2,20 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import { type PaymentMethodInfo } from '~/domains/paymentMethods';
|
|
4
4
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
5
|
-
interface MoonpayDepositData {
|
|
6
|
-
depositToken: string;
|
|
7
|
-
depositTokenAmount: number;
|
|
8
|
-
depositTokenChainId: string;
|
|
9
|
-
}
|
|
10
5
|
export type ConfirmationStepState = CheckoutModalCommonState & {
|
|
11
6
|
paymentMethodInfo: PaymentMethodInfo;
|
|
12
7
|
};
|
|
13
8
|
export type ConfirmationStepNext = {
|
|
14
9
|
depositAddress: Address;
|
|
15
|
-
moonpayData?: MoonpayDepositData;
|
|
16
10
|
paymentMethodInfo: PaymentMethodInfo;
|
|
17
11
|
redirectBackToSourceChange?: boolean;
|
|
18
12
|
};
|
|
19
13
|
export declare const ConfirmationStepInfo: ModalStepInfo<FunCheckoutStep.CONFIRMATION>;
|
|
20
14
|
export declare function ConfirmationStep({ modalState, onNext, setModalState, }: ModalStepComponentProps<FunCheckoutStep.CONFIRMATION>): React.JSX.Element;
|
|
21
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
+
import { type Config } from 'wagmi';
|
|
3
4
|
import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
|
|
4
5
|
export interface CheckoutConfirmationError extends ErrorNotification {
|
|
5
6
|
durationMs?: number;
|
|
@@ -11,7 +12,8 @@ export declare enum ConfirmationErrorCode {
|
|
|
11
12
|
RISK_ERROR = "RISK_ERROR",
|
|
12
13
|
SIGNATURE_DENIED = "SIGNATURE_DENIED",
|
|
13
14
|
SWITCH_CHAIN_ERROR = "SWITCH_CHAIN_ERROR",
|
|
14
|
-
WALLET_CLIENT_UNDEFINED = "WALLET_CLIENT_UNDEFINED"
|
|
15
|
+
WALLET_CLIENT_UNDEFINED = "WALLET_CLIENT_UNDEFINED",
|
|
16
|
+
INSUFFICIENT_GAS = "INSUFFICIENT_GAS"
|
|
15
17
|
}
|
|
16
18
|
interface UseCheckoutConfirmationOptions {
|
|
17
19
|
onError(error: CheckoutConfirmationError): void;
|
|
@@ -23,6 +25,6 @@ interface UseCheckoutConfirmationResult {
|
|
|
23
25
|
handleCheckoutConfirmation(): Promise<void>;
|
|
24
26
|
isConfirming: boolean;
|
|
25
27
|
}
|
|
26
|
-
export declare function toCheckoutConfirmationError(t: TFunction, error: unknown): CheckoutConfirmationError
|
|
28
|
+
export declare function toCheckoutConfirmationError(t: TFunction, error: unknown, wagmiConfig: Config): Promise<CheckoutConfirmationError>;
|
|
27
29
|
export declare function useCheckoutConfirmation({ onError, onSuccess, }: UseCheckoutConfirmationOptions): UseCheckoutConfirmationResult;
|
|
28
30
|
export {};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import type { Address } from 'viem';
|
|
2
2
|
import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
|
|
3
3
|
import { type PaymentMethodInfo } from '~/domains/paymentMethods';
|
|
4
|
-
export interface MoonpayDepositData {
|
|
5
|
-
depositToken: string;
|
|
6
|
-
depositTokenAmount: number;
|
|
7
|
-
depositTokenChainId: string;
|
|
8
|
-
}
|
|
9
4
|
export interface PostCheckoutError extends ErrorNotification {
|
|
10
5
|
disableContinue: boolean;
|
|
11
6
|
durationMs?: number;
|
|
12
7
|
}
|
|
13
8
|
export interface PostCheckoutSuccessData {
|
|
14
9
|
depositAddress: Address;
|
|
15
|
-
moonpayData: MoonpayDepositData;
|
|
16
10
|
paymentMethodInfo: PaymentMethodInfo;
|
|
17
11
|
}
|
|
18
12
|
interface UsePostCheckoutOptions {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
|
|
2
2
|
import { type CheckoutQuoteResult } from '~/providers/FunkitQuoteContext';
|
|
3
|
-
import { type PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
4
3
|
export interface SourceAssetConfirmed {
|
|
5
4
|
isQuoteSuccess: boolean;
|
|
6
5
|
maxTargetAssetAmount: number | undefined;
|
|
7
6
|
}
|
|
8
|
-
export declare function preparePaymentMethodInfo(selectedPaymentMethodInfo: PaymentMethodInfo | null): PaymentMethodInfo;
|
|
9
7
|
/**
|
|
10
8
|
*
|
|
11
9
|
* Note: this hook is EXTREMELY confusing in what is doing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExchangeRates } from '@funkit/api-base';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type
|
|
3
|
+
import { type FunkitTextCustomizationsConfig } from '~/providers/FunkitConfigContext';
|
|
4
4
|
import type { AssetHoldingsItem } from '~/utils/assets';
|
|
5
5
|
import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
|
|
6
6
|
import { FunCheckoutStep, type ModalStepComponentProps } from '../stepTransition';
|
|
@@ -23,6 +23,7 @@ export interface AmountInputInitOptions {
|
|
|
23
23
|
fiatCurrencyExchangeRate: number | undefined;
|
|
24
24
|
/** Whether meld is enabled */
|
|
25
25
|
meldEnabled: boolean;
|
|
26
|
+
apiKey: string;
|
|
26
27
|
}
|
|
27
28
|
export interface AmountInputState {
|
|
28
29
|
/** Current amount, in target asset. Undefined if input is empty */
|
|
@@ -105,6 +106,6 @@ export type AmountInputError = {
|
|
|
105
106
|
* Return half the balance and round up to nearest 10, 100, 1000 etc
|
|
106
107
|
*/
|
|
107
108
|
export declare function calcInitialFiatAmount(balance: number): number;
|
|
108
|
-
export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, }: AmountInputInitOptions): AmountInputState;
|
|
109
|
+
export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, apiKey, }: AmountInputInitOptions): AmountInputState;
|
|
109
110
|
export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
|
|
110
111
|
export declare function getDerivedState(state: AmountInputState, targetAssetTicker: string): AmountInputDerivedState;
|
|
@@ -95,6 +95,7 @@ export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
95
95
|
[FunCheckoutStep.BROKERAGE_SUCCESS]: BrokerageSuccessState;
|
|
96
96
|
}[T] & {
|
|
97
97
|
step: T;
|
|
98
|
+
previousStep?: FunCheckoutStep | null;
|
|
98
99
|
};
|
|
99
100
|
}[S];
|
|
100
101
|
export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { type Dispatch, type ReactNode } from 'react';
|
|
2
|
-
import { type PaymentMethodInfo } from '../domains/paymentMethods';
|
|
3
2
|
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
4
3
|
import { type FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
|
|
5
4
|
export type CheckoutQuoteError = {
|
|
@@ -37,7 +36,7 @@ interface CheckoutQuoteState {
|
|
|
37
36
|
}
|
|
38
37
|
interface FunkitQuoteContextInterface extends CheckoutQuoteState {
|
|
39
38
|
clearCheckoutQuoteMessages: () => void;
|
|
40
|
-
getCheckoutQuote: (
|
|
39
|
+
getCheckoutQuote: (disableInformationStreaming?: boolean) => Promise<GetCheckoutQuoteResponse>;
|
|
41
40
|
setCheckoutQuote: Dispatch<React.SetStateAction<FunkitCheckoutQuoteResult | null>>;
|
|
42
41
|
setQuoteProgress: (state: Omit<CheckoutQuoteState, 'latestQuote'>) => void;
|
|
43
42
|
}
|
|
@@ -23,24 +23,24 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
uniswapWallet
|
|
25
25
|
} from "./chunk-LH7BMNFZ.js";
|
|
26
|
-
import {
|
|
27
|
-
xdefiWallet
|
|
28
|
-
} from "./chunk-BOU4WKRZ.js";
|
|
29
26
|
import {
|
|
30
27
|
walletConnectWallet
|
|
31
28
|
} from "./chunk-NP5QGWNL.js";
|
|
29
|
+
import {
|
|
30
|
+
xdefiWallet
|
|
31
|
+
} from "./chunk-BOU4WKRZ.js";
|
|
32
32
|
import {
|
|
33
33
|
rabbyWallet
|
|
34
34
|
} from "./chunk-BBOM42DL.js";
|
|
35
35
|
import {
|
|
36
36
|
rainbowWallet
|
|
37
37
|
} from "./chunk-2KUBG3S6.js";
|
|
38
|
-
import {
|
|
39
|
-
ramperWallet
|
|
40
|
-
} from "./chunk-BYXPFMI7.js";
|
|
41
38
|
import {
|
|
42
39
|
roninWallet
|
|
43
40
|
} from "./chunk-NWIQNBJU.js";
|
|
41
|
+
import {
|
|
42
|
+
ramperWallet
|
|
43
|
+
} from "./chunk-BYXPFMI7.js";
|
|
44
44
|
import {
|
|
45
45
|
safeWallet
|
|
46
46
|
} from "./chunk-BQQQL6UD.js";
|
|
@@ -125,18 +125,15 @@ import {
|
|
|
125
125
|
import {
|
|
126
126
|
enkryptWallet
|
|
127
127
|
} from "./chunk-OLOIXTYS.js";
|
|
128
|
-
import {
|
|
129
|
-
argentWallet
|
|
130
|
-
} from "./chunk-WSQ2YJO2.js";
|
|
131
128
|
import {
|
|
132
129
|
bifrostWallet
|
|
133
130
|
} from "./chunk-A5N6B5UW.js";
|
|
131
|
+
import {
|
|
132
|
+
argentWallet
|
|
133
|
+
} from "./chunk-WSQ2YJO2.js";
|
|
134
134
|
import {
|
|
135
135
|
bitgetWallet
|
|
136
136
|
} from "./chunk-TDAVGY5F.js";
|
|
137
|
-
import {
|
|
138
|
-
bitskiWallet
|
|
139
|
-
} from "./chunk-HS3C7OQV.js";
|
|
140
137
|
import {
|
|
141
138
|
bitverseWallet
|
|
142
139
|
} from "./chunk-3HZRRP4Y.js";
|
|
@@ -144,6 +141,9 @@ import {
|
|
|
144
141
|
bloomWallet
|
|
145
142
|
} from "./chunk-S27IADFU.js";
|
|
146
143
|
import "./chunk-23WIEY36.js";
|
|
144
|
+
import {
|
|
145
|
+
bitskiWallet
|
|
146
|
+
} from "./chunk-HS3C7OQV.js";
|
|
147
147
|
import {
|
|
148
148
|
braveWallet
|
|
149
149
|
} from "./chunk-BPZ2XJO2.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "7.1.0-next.
|
|
3
|
+
"version": "7.1.0-next.8",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"ua-parser-js": "^1.0.37",
|
|
101
101
|
"use-debounce": "^10.0.5",
|
|
102
102
|
"uuid": "^9.0.1",
|
|
103
|
-
"@funkit/api-base": "1.12.22-next.
|
|
104
|
-
"@funkit/chains": "0.5.2-next.
|
|
105
|
-
"@funkit/
|
|
106
|
-
"@funkit/
|
|
103
|
+
"@funkit/api-base": "1.12.22-next.2",
|
|
104
|
+
"@funkit/chains": "0.5.2-next.1",
|
|
105
|
+
"@funkit/fun-relay": "2.2.0-next.3",
|
|
106
|
+
"@funkit/utils": "1.1.22-next.1"
|
|
107
107
|
},
|
|
108
108
|
"repository": {
|
|
109
109
|
"type": "git",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type DeepPartial } from '@funkit/utils';
|
|
2
|
-
import { type FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
|
|
3
|
-
export declare function useNewCheckoutQuote(): (overridingCheckoutItem?: DeepPartial<FunkitActiveCheckoutItem>) => Promise<{
|
|
4
|
-
baseQuote: import("@funkit/utils").CheckoutQuoteResponse;
|
|
5
|
-
checkedAssetAmount: import("~/domains/quote").CheckedAssetAmount;
|
|
6
|
-
finalEstimation: import("~/domains/quote").FunkitCheckoutQuoteResult;
|
|
7
|
-
}>;
|