@funkit/connect 6.14.17 → 6.14.19
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 +36 -0
- package/dist/__generated__/default_configs.d.ts +3 -1
- package/dist/components/FunCheckoutHistory/FunCheckoutHistoryDetail.d.ts +2 -1
- package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryDetail.d.ts +19 -2
- package/dist/components/FunCheckoutHistory/FunDirectExecutionStatus.d.ts +23 -3
- package/dist/components/FunSelectBrokerage/FunBrokerageItem.d.ts +2 -1
- package/dist/components/TransactionStatus/TransactionStatus.d.ts +16 -2
- package/dist/consts/bluvo.d.ts +4 -4
- package/dist/domains/fees.d.ts +2 -2
- package/dist/domains/paymentMethods.d.ts +0 -3
- package/dist/domains/quote.d.ts +3 -3
- package/dist/hooks/queries/useRecentDirectExecutions.d.ts +4 -2
- package/dist/hooks/statsig/useDynamicConfig.d.ts +1 -1
- package/dist/hooks/track/CheckoutModalEvent.d.ts +2 -2
- package/dist/hooks/useBluvo.d.ts +4 -1
- package/dist/hooks/useCheckoutDirectExecution.d.ts +3 -4
- package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +3 -2
- package/dist/hooks/useDirectExecutionInfoPolling.d.ts +2 -1
- package/dist/index.css +14 -28
- package/dist/index.js +23319 -23211
- package/dist/modals/CheckoutModal/Brokerage/BrokerageSuccessModal.d.ts +10 -0
- package/dist/modals/CheckoutModal/{MeshVerification.d.ts → Brokerage/BrokerageTwoFA.d.ts} +12 -13
- package/dist/modals/CheckoutModal/{ConnectExchange.d.ts → Brokerage/ConnectExchange.d.ts} +2 -2
- package/dist/modals/CheckoutModal/Brokerage/components/BrokerageSuccess.d.ts +8 -0
- package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +0 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/usePostCheckout.d.ts +0 -1
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -2
- package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +1 -2
- package/dist/modals/CheckoutModal/SelectAsset.d.ts +0 -4
- package/dist/modals/CheckoutModal/stepTransition.d.ts +7 -7
- package/dist/providers/FunkitBrokerageProvider.d.ts +5 -1
- package/dist/providers/FunkitMoonpayProvider.d.ts +0 -5
- package/dist/utils/bluvo.d.ts +29 -3
- package/dist/utils/checkout.d.ts +1 -2
- package/dist/utils/flags/config.d.ts +2 -9
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +76 -76
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +6 -7
- package/dist/components/FunPayments/FunPaymentMoonpayType.css.d.ts +0 -2
- package/dist/components/FunPayments/FunPaymentMoonpayType.d.ts +0 -12
- package/dist/consts/moonpay.d.ts +0 -10
- package/dist/modals/CheckoutModal/MoonpaySetup.d.ts +0 -17
- package/dist/utils/moonpay.d.ts +0 -10
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PaymentMethodBrokerageInfo } from '~/domains/paymentMethods';
|
|
3
|
+
import type { CheckoutModalCommonState, FunCheckoutStep, ModalStepComponentProps, ModalStepInfo } from '../stepTransition';
|
|
4
|
+
export declare const BROKERAGE_SUCCESS_MODAL_CONTENT_ID = "brokerage-success-modal-content";
|
|
5
|
+
export type BrokerageSuccessState = CheckoutModalCommonState & {
|
|
6
|
+
paymentMethodInfo: PaymentMethodBrokerageInfo;
|
|
7
|
+
};
|
|
8
|
+
export declare const DEFAULT_BROKERAGE_SUCCESS_TITLE = "Successful Deposit";
|
|
9
|
+
export declare const BrokerageSuccessInfo: ModalStepInfo<FunCheckoutStep.BROKERAGE_SUCCESS>;
|
|
10
|
+
export declare function BrokerageSuccessModal({ onClose, onAnimationComplete, }: ModalStepComponentProps<FunCheckoutStep.BROKERAGE_SUCCESS>): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
declare enum
|
|
3
|
+
declare enum BrokerageTwoFAType {
|
|
4
4
|
unspecified = "unspecified",
|
|
5
5
|
phone = "phone",
|
|
6
6
|
email = "email",
|
|
@@ -9,7 +9,7 @@ declare enum MeshExecuteTransferMfaType {
|
|
|
9
9
|
tradingPin = "tradingPin",
|
|
10
10
|
mobile = "mobile"
|
|
11
11
|
}
|
|
12
|
-
declare enum
|
|
12
|
+
declare enum BrokerageTwoFAStatus {
|
|
13
13
|
succeeded = "succeeded",
|
|
14
14
|
failed = "failed",
|
|
15
15
|
mfaRequired = "mfaRequired",
|
|
@@ -24,25 +24,24 @@ type MeshExchangeType = {
|
|
|
24
24
|
icon: () => JSX.Element | null;
|
|
25
25
|
name: string;
|
|
26
26
|
};
|
|
27
|
-
import type { PaymentMethodBrokerageInfo } from '
|
|
28
|
-
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '
|
|
29
|
-
export type
|
|
27
|
+
import type { PaymentMethodBrokerageInfo } from '~/domains/paymentMethods';
|
|
28
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
29
|
+
export type BrokerageTwoFAState = CheckoutModalCommonState & {
|
|
30
30
|
paymentMethodInfo: PaymentMethodBrokerageInfo;
|
|
31
|
-
isSendingToQr: boolean;
|
|
32
31
|
};
|
|
33
|
-
export type
|
|
32
|
+
export type BrokerageTwoFANext = {
|
|
34
33
|
depositAddress: Address;
|
|
35
34
|
} | {
|
|
36
35
|
depositAddress: null;
|
|
37
36
|
brokerType: MeshExchangeType;
|
|
38
37
|
};
|
|
39
|
-
export interface
|
|
40
|
-
status:
|
|
41
|
-
mfaType?:
|
|
42
|
-
verificationSteps?:
|
|
38
|
+
export interface BrokerageTwoFAExecuteTransferResponse {
|
|
39
|
+
status: BrokerageTwoFAStatus;
|
|
40
|
+
mfaType?: BrokerageTwoFAType;
|
|
41
|
+
verificationSteps?: BrokerageTwoFAType[];
|
|
43
42
|
errorMessage: string | null;
|
|
44
43
|
executeTransferResult: object | null;
|
|
45
44
|
}
|
|
46
|
-
export declare const
|
|
47
|
-
export declare function
|
|
45
|
+
export declare const BrokerageTwoFAInfo: ModalStepInfo<FunCheckoutStep.BROKERAGE_TWO_FA>;
|
|
46
|
+
export declare function BrokerageTwoFA({ onNext, onBack, setModalState, }: ModalStepComponentProps<FunCheckoutStep.BROKERAGE_TWO_FA>): React.JSX.Element;
|
|
48
47
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type BluvoExchangeType } from '~/consts/bluvo';
|
|
3
|
-
import { type PaymentMethodBrokerageInfo } from '
|
|
4
|
-
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '
|
|
3
|
+
import { type PaymentMethodBrokerageInfo } from '~/domains/paymentMethods';
|
|
4
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
5
5
|
export type ConnectExchangeState = CheckoutModalCommonState & {
|
|
6
6
|
brokerType: BluvoExchangeType;
|
|
7
7
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BrokerageSuccessProps {
|
|
3
|
+
bottomBarId: string;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onNewDeposit: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const BrokerageSuccess: ({ bottomBarId, onClose, onNewDeposit, }: BrokerageSuccessProps) => React.JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -15,7 +15,6 @@ export type ConfirmationStepNext = {
|
|
|
15
15
|
moonpayData?: MoonpayDepositData;
|
|
16
16
|
paymentMethodInfo: PaymentMethodInfo;
|
|
17
17
|
redirectBackToSourceChange?: boolean;
|
|
18
|
-
isSendingToQr: boolean;
|
|
19
18
|
};
|
|
20
19
|
export declare const ConfirmationStepInfo: ModalStepInfo<FunCheckoutStep.CONFIRMATION>;
|
|
21
20
|
export declare const DEFAULT_CONTINUE_TEXT = "Confirm Order";
|
|
@@ -14,7 +14,6 @@ export interface PostCheckoutSuccessData {
|
|
|
14
14
|
depositAddress: Address;
|
|
15
15
|
moonpayData: MoonpayDepositData;
|
|
16
16
|
paymentMethodInfo: PaymentMethodInfo;
|
|
17
|
-
isSendingToQr: boolean;
|
|
18
17
|
}
|
|
19
18
|
interface UsePostCheckoutOptions {
|
|
20
19
|
onSuccess(data: PostCheckoutSuccessData): void;
|
|
@@ -3,7 +3,6 @@ export declare enum FunCheckoutStep {
|
|
|
3
3
|
INPUT_AMOUNT = "input_amount",
|
|
4
4
|
SOURCE_CHANGE = "source_change",
|
|
5
5
|
CONFIRMATION = "confirmation",
|
|
6
|
-
MOONPAY_SETUP = "payment_setup",
|
|
7
6
|
SELECT_ASSET = "select_asset",
|
|
8
7
|
CHECKOUT_COMPLETE = "checkout_complete",
|
|
9
8
|
CHECKOUT_HELP = "checkout_help",
|
|
@@ -20,5 +19,6 @@ export declare enum FunCheckoutStep {
|
|
|
20
19
|
DIRECT_EXECUTION_NOTIF_CENTER = "direct_execution_notif_center",
|
|
21
20
|
SELECT_BROKERAGE = "select_brokerage",
|
|
22
21
|
CONNECT_EXCHANGE = "connect_exchange",
|
|
23
|
-
|
|
22
|
+
BROKERAGE_TWO_FA = "brokerage_two_fa",
|
|
23
|
+
BROKERAGE_SUCCESS = "brokerage_success"
|
|
24
24
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
|
|
2
|
-
import { type PaymentMethodInfo } from '~/domains/paymentMethods';
|
|
3
2
|
import type { AmountInputError } from './state';
|
|
4
3
|
export declare const ASSET_DECIMALS = 5;
|
|
5
4
|
export declare const USD_DECIMALS = 2;
|
|
6
5
|
export declare const USD_INITIAL_AMOUNT = 100;
|
|
7
6
|
export declare function getDefaultAmountFromQuickOptions(quickOptions: number[] | undefined): number | undefined;
|
|
8
7
|
export declare function getUsdMaxAmount(maxUsd: number): number | null;
|
|
9
|
-
export declare function getUsdMinAmount(
|
|
8
|
+
export declare function getUsdMinAmount(minUsd?: number): number;
|
|
10
9
|
export interface InputAmountSuggestion {
|
|
11
10
|
autoConfirm: boolean;
|
|
12
11
|
buttonLabel: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AssetHoldingsItem, BrokerageAssetHoldingsItem } from '~/domains/wallet';
|
|
3
2
|
import type { TransferTokenDefault } from '~/hooks/useTokenChain';
|
|
4
3
|
import { type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
5
4
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
|
|
@@ -12,7 +11,4 @@ export type SelectAssetNext = {
|
|
|
12
11
|
transferToken?: TransferTokenDefault;
|
|
13
12
|
};
|
|
14
13
|
export declare const SelectAssetInfo: ModalStepInfo<FunCheckoutStep.SELECT_ASSET>;
|
|
15
|
-
export declare const isBrokerageAsset: (asset: AssetHoldingsItem) => asset is BrokerageAssetHoldingsItem & {
|
|
16
|
-
usdAmount: number;
|
|
17
|
-
};
|
|
18
14
|
export declare function SelectAsset({ modalState, onNext, onClose, }: ModalStepComponentProps<FunCheckoutStep.SELECT_ASSET>): React.JSX.Element;
|
|
@@ -5,11 +5,13 @@ import { type ErrorScreenState } from '~/modals/CheckoutModal/VirtualFiatAccount
|
|
|
5
5
|
import { type VirtualFiatAccountNext, type VirtualFiatAccountState } from '~/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount';
|
|
6
6
|
import { FunCheckoutStartingStep, type FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
7
7
|
import { type FunkitTextCustomizationsConfig } from '../../providers/FunkitConfigContext';
|
|
8
|
+
import { type BrokerageSuccessState } from './Brokerage/BrokerageSuccessModal';
|
|
9
|
+
import { type BrokerageTwoFANext, type BrokerageTwoFAState } from './Brokerage/BrokerageTwoFA';
|
|
10
|
+
import { type ConnectExchangeNext, type ConnectExchangeState } from './Brokerage/ConnectExchange';
|
|
8
11
|
import { type SelectBrokerageNext, type SelectBrokerageState } from './Brokerage/SelectBrokerage';
|
|
9
12
|
import { type CheckoutCompleteNext, type CheckoutCompleteState } from './CheckoutComplete/CheckoutComplete';
|
|
10
13
|
import { type CheckoutHelpState } from './CheckoutHelp/CheckoutHelp';
|
|
11
14
|
import { type ConfirmationStepNext, type ConfirmationStepState } from './ConfirmationStep/ConfirmationStep';
|
|
12
|
-
import { type ConnectExchangeNext, type ConnectExchangeState } from './ConnectExchange';
|
|
13
15
|
import { type DirectExecutionNotifCenterState } from './DirectExecutionNotifCenter/DirectExecutionNotifCenter';
|
|
14
16
|
import { FunCheckoutStep } from './FunCheckoutStep';
|
|
15
17
|
import { type InputAmountNext, type InputAmountState } from './InputAmount/InputAmount';
|
|
@@ -17,8 +19,6 @@ import { type LoadingAccountNext, type LoadingAccountState } from './LoadingAcco
|
|
|
17
19
|
import { type MeldCurrencySelectNext, type MeldCurrencySelectState } from './MeldCurrencySelect/MeldCurrencySelect';
|
|
18
20
|
import { type MeldQuotesNext, type MeldQuotesState } from './MeldQuotes/MeldQuotes';
|
|
19
21
|
import { type MeldRedirectNext, type MeldRedirectState } from './MeldRedirect/MeldRedirect';
|
|
20
|
-
import { type MeshVerificationNext, type MeshVerificationState } from './MeshVerification';
|
|
21
|
-
import { type MoonpaySetupNext, type MoonpaySetupState } from './MoonpaySetup';
|
|
22
22
|
import { type SelectAssetNext, type SelectAssetState } from './SelectAsset';
|
|
23
23
|
import { type SourceChangeNext, type SourceChangeState } from './SourceChange/SourceChange';
|
|
24
24
|
import { type TransferTokenNext, type TransferTokenState } from './TransferToken/TransferToken';
|
|
@@ -75,7 +75,6 @@ export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
75
75
|
[FunCheckoutStep.CONFIRMATION]: ConfirmationStepState;
|
|
76
76
|
[FunCheckoutStep.INPUT_AMOUNT]: InputAmountState;
|
|
77
77
|
[FunCheckoutStep.LOADING_ACCOUNT]: LoadingAccountState;
|
|
78
|
-
[FunCheckoutStep.MOONPAY_SETUP]: MoonpaySetupState;
|
|
79
78
|
[FunCheckoutStep.SELECT_ASSET]: SelectAssetState;
|
|
80
79
|
[FunCheckoutStep.SOURCE_CHANGE]: SourceChangeState;
|
|
81
80
|
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenState;
|
|
@@ -91,7 +90,8 @@ export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
91
90
|
[FunCheckoutStep.DIRECT_EXECUTION_NOTIF_CENTER]: DirectExecutionNotifCenterState;
|
|
92
91
|
[FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageState;
|
|
93
92
|
[FunCheckoutStep.CONNECT_EXCHANGE]: ConnectExchangeState;
|
|
94
|
-
[FunCheckoutStep.
|
|
93
|
+
[FunCheckoutStep.BROKERAGE_TWO_FA]: BrokerageTwoFAState;
|
|
94
|
+
[FunCheckoutStep.BROKERAGE_SUCCESS]: BrokerageSuccessState;
|
|
95
95
|
}[T] & {
|
|
96
96
|
step: T;
|
|
97
97
|
};
|
|
@@ -102,7 +102,6 @@ export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
102
102
|
[FunCheckoutStep.CONFIRMATION]: ConfirmationStepNext;
|
|
103
103
|
[FunCheckoutStep.INPUT_AMOUNT]: InputAmountNext;
|
|
104
104
|
[FunCheckoutStep.LOADING_ACCOUNT]: LoadingAccountNext;
|
|
105
|
-
[FunCheckoutStep.MOONPAY_SETUP]: MoonpaySetupNext;
|
|
106
105
|
[FunCheckoutStep.SELECT_ASSET]: SelectAssetNext;
|
|
107
106
|
[FunCheckoutStep.SOURCE_CHANGE]: SourceChangeNext;
|
|
108
107
|
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenNext;
|
|
@@ -118,7 +117,8 @@ export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
118
117
|
[FunCheckoutStep.DIRECT_EXECUTION_NOTIF_CENTER]: null;
|
|
119
118
|
[FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageNext;
|
|
120
119
|
[FunCheckoutStep.CONNECT_EXCHANGE]: ConnectExchangeNext;
|
|
121
|
-
[FunCheckoutStep.
|
|
120
|
+
[FunCheckoutStep.BROKERAGE_TWO_FA]: BrokerageTwoFANext;
|
|
121
|
+
[FunCheckoutStep.BROKERAGE_SUCCESS]: null;
|
|
122
122
|
}[S] & {
|
|
123
123
|
/** Whether screen transition should change direction to simulate back transition. Only applies if there is a history entry in the stack*/
|
|
124
124
|
reverseAnimation?: boolean;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { type UseBluvoFlowHook } from '@bluvo/react';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
|
-
import type { BluvoExchangeType } from '~/consts/bluvo';
|
|
3
|
+
import type { BluvoBrokerageMinMax, BluvoExchangeType } from '~/consts/bluvo';
|
|
4
|
+
import type { BrokerageAssetHoldingsItem } from '~/domains/wallet';
|
|
4
5
|
type BluvoLocalStorageData = Partial<Record<BluvoExchangeType, string>>;
|
|
5
6
|
interface FunkitBrokerageContextProps {
|
|
6
7
|
bluvoClient: UseBluvoFlowHook;
|
|
8
|
+
brokerageMinMax: BluvoBrokerageMinMax | null;
|
|
7
9
|
authorizedConnections: BluvoLocalStorageData;
|
|
8
10
|
purgeAuthConnectedExchange: (exchange: BluvoExchangeType) => void;
|
|
9
11
|
isConnected: boolean;
|
|
12
|
+
selectedBrokerageAsset: BrokerageAssetHoldingsItem | null;
|
|
13
|
+
setSelectedBrokerageAsset: (asset: BrokerageAssetHoldingsItem | null) => void;
|
|
10
14
|
}
|
|
11
15
|
export declare const FunkitBrokerageContext: React.Context<FunkitBrokerageContextProps | undefined>;
|
|
12
16
|
export declare const FunkitBrokerageProvider: React.FC<{
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import React, { type ReactNode } from 'react';
|
|
2
|
-
export declare function FunkitMoonpayProvider({ children, debug, }: {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
debug: boolean;
|
|
5
|
-
}): React.JSX.Element;
|
|
6
1
|
export interface UserIpInfoFromMoonpay {
|
|
7
2
|
/** https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 */
|
|
8
3
|
alpha2: 'AU' | 'CA' | 'US' | string;
|
package/dist/utils/bluvo.d.ts
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import type { WalletwithdrawbalancebalanceResponse } from '@bluvo/sdk-ts';
|
|
2
2
|
type WithdrawableBalance = WalletwithdrawbalancebalanceResponse['balances'][number];
|
|
3
|
+
import { type BluvoExecuteWithdrawalResponse, BluvoWithdrawalError } from '@funkit/api-base';
|
|
3
4
|
import type { BluvoExchangeType } from '~/consts/bluvo';
|
|
4
|
-
import type { AssetHoldingsMap, BrokerageAssetHoldingsItem } from '~/domains/wallet';
|
|
5
|
+
import type { AssetHoldingsItem, AssetHoldingsMap, BrokerageAssetHoldingsItem } from '~/domains/wallet';
|
|
6
|
+
export declare const isBrokerageAsset: (asset: AssetHoldingsItem) => asset is BrokerageAssetHoldingsItem & {
|
|
7
|
+
usdAmount: number;
|
|
8
|
+
};
|
|
5
9
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
10
|
+
* Computes the minimum and maximum USD values for a brokerage asset.
|
|
11
|
+
* Combines brokerage exchange limits with QR Code/token transfer limits.
|
|
12
|
+
* @param asset The brokerage asset with min/max amounts
|
|
13
|
+
* @param minTransferLimits Chain-specific minimum transfer limits
|
|
14
|
+
* @returns Object with minUsd and maxUsd values
|
|
8
15
|
*/
|
|
16
|
+
export declare function getBrokerageMinMax(asset: BrokerageAssetHoldingsItem & {
|
|
17
|
+
usdAmount: number;
|
|
18
|
+
}, minTransferLimits: {
|
|
19
|
+
mainnet: number;
|
|
20
|
+
nonMainnet: number;
|
|
21
|
+
}): {
|
|
22
|
+
minUsd: number;
|
|
23
|
+
maxUsd: number;
|
|
24
|
+
};
|
|
9
25
|
/**
|
|
10
26
|
* Transforms Bluvo wallet balances into the AssetHoldingsMap format
|
|
11
27
|
* used by the SelectAsset component.
|
|
@@ -28,4 +44,14 @@ export declare function getBluvoError<OriginalBluvoError extends {
|
|
|
28
44
|
error: string;
|
|
29
45
|
type: string;
|
|
30
46
|
}, ErrorCode extends string = ExtractErrorCode<OriginalBluvoError>>(error: OriginalBluvoError): BluvoError<ErrorCode>;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param response - The response from the Bluvo API
|
|
50
|
+
* @returns The normalized response
|
|
51
|
+
*
|
|
52
|
+
* @throws - {@link BluvoWithdrawalError} if the response is invalid or if the withdrawal fails
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
export declare const normalizeWithdrawalResponse: (response: BluvoExecuteWithdrawalResponse) => unknown;
|
|
56
|
+
export declare const isBluvoWithdrawalError: (error: unknown) => error is BluvoWithdrawalError;
|
|
31
57
|
export {};
|
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { ServerCheckoutConfig } from '~/domains/clientMetadata';
|
|
|
7
7
|
import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
|
|
8
8
|
import { type FunkitCheckoutActionParams, type FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
9
9
|
export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
|
|
10
|
-
export declare const BROKERAGE_TIME_ESTIMATE_MS =
|
|
10
|
+
export declare const BROKERAGE_TIME_ESTIMATE_MS = 0;
|
|
11
11
|
export declare const BANK_TIME_ESTIMATE_MS = 0;
|
|
12
12
|
export declare const DUMMY_TRANSFER_PARAMS: {
|
|
13
13
|
toAddress: "0x000000000000000000000000000000000000dEaD";
|
|
@@ -77,7 +77,6 @@ export type TokenInfo = {
|
|
|
77
77
|
* @returns List of tokenItem objects
|
|
78
78
|
*/
|
|
79
79
|
export declare function decorateTokenList(tokensChainMap: Record<string, Set<string>>, targetChainId: string, apiKey: string): Promise<TokenInfo[]>;
|
|
80
|
-
export declare function formatTokenAmountForMoonpay(amount: number, mpCurrencyCode: string): string;
|
|
81
80
|
export declare function getTimeFromNowSeconds(startTimeMs: number, durationMs: number): number;
|
|
82
81
|
export declare function getCheckoutReceivedAmount({ config, quote, }: {
|
|
83
82
|
config: FunkitCheckoutConfig | ServerCheckoutConfig;
|
|
@@ -71,15 +71,8 @@ export declare const flagConfig: {
|
|
|
71
71
|
}, Override<boolean>, {
|
|
72
72
|
readonly if_any: [{
|
|
73
73
|
readonly key: "userId";
|
|
74
|
-
readonly type: "
|
|
75
|
-
readonly
|
|
76
|
-
}];
|
|
77
|
-
readonly value: true;
|
|
78
|
-
}, {
|
|
79
|
-
readonly if_any: [{
|
|
80
|
-
readonly key: "apiKey";
|
|
81
|
-
readonly type: "isAnyOf";
|
|
82
|
-
readonly values: ["Z9SZaOwpmE40KX61mUKWm5hrpGh7WHVkaTvQJpQk", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN"];
|
|
74
|
+
readonly type: "pctRollout";
|
|
75
|
+
readonly pct: 100;
|
|
83
76
|
}];
|
|
84
77
|
readonly value: true;
|
|
85
78
|
}];
|