@heliofi/withdraw-react 0.0.3 → 0.0.4
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/dist/withdraw-react.es.d.ts +422 -0
- package/package.json +3 -3
- package/dist/apps/withdraw-react/src/api/errors.d.ts +0 -24
- package/dist/apps/withdraw-react/src/balance/useGetBalances.d.ts +0 -10
- package/dist/apps/withdraw-react/src/components/DebugPanel.d.ts +0 -4
- package/dist/apps/withdraw-react/src/components/moonPayCommerceWithdraw.d.ts +0 -3
- package/dist/apps/withdraw-react/src/config/useGetWithdraw.d.ts +0 -10
- package/dist/apps/withdraw-react/src/constants/steps.d.ts +0 -5
- package/dist/apps/withdraw-react/src/crypto-flow/WithdrawCryptoMachineProvider.d.ts +0 -6
- package/dist/apps/withdraw-react/src/crypto-flow/machine.d.ts +0 -107
- package/dist/apps/withdraw-react/src/crypto-flow/types.d.ts +0 -65
- package/dist/apps/withdraw-react/src/crypto-flow/withdrawCryptoSteps.d.ts +0 -2
- package/dist/apps/withdraw-react/src/crypto-form/AmountInput/constants.d.ts +0 -4
- package/dist/apps/withdraw-react/src/crypto-form/AmountInput/index.d.ts +0 -1
- package/dist/apps/withdraw-react/src/crypto-form/CryptoFormDisplay.d.ts +0 -11
- package/dist/apps/withdraw-react/src/crypto-form/CryptoFormScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/crypto-form/CryptoFormStateProvider.d.ts +0 -14
- package/dist/apps/withdraw-react/src/crypto-form/QuoteSummaryCard.d.ts +0 -6
- package/dist/apps/withdraw-react/src/crypto-form/RecipientAddressInput.d.ts +0 -1
- package/dist/apps/withdraw-react/src/crypto-form/constants.d.ts +0 -2
- package/dist/apps/withdraw-react/src/crypto-form/fixtures.d.ts +0 -12
- package/dist/apps/withdraw-react/src/crypto-form/types.d.ts +0 -5
- package/dist/apps/withdraw-react/src/crypto-form/useCryptoForm.d.ts +0 -17
- package/dist/apps/withdraw-react/src/crypto-form/useQuoteManager.d.ts +0 -7
- package/dist/apps/withdraw-react/src/crypto-form/utils/index.d.ts +0 -4
- package/dist/apps/withdraw-react/src/crypto-form/utils/numbers.d.ts +0 -3
- package/dist/apps/withdraw-react/src/flow/CryptoCompletedScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/CryptoErrorScreen.d.ts +0 -6
- package/dist/apps/withdraw-react/src/flow/CryptoLoadErrorScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/CryptoLoadingScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/CryptoSigningScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/CryptoStatusScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/CryptoSubmitErrorScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/CryptoSubmittingScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/RouteSelectionScreen.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/WithdrawFlowContent.d.ts +0 -3
- package/dist/apps/withdraw-react/src/flow/WithdrawFlowContext.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/hooks/useErrorCallback.d.ts +0 -3
- package/dist/apps/withdraw-react/src/flow/hooks/useSigning.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/hooks/useStatusPolling.d.ts +0 -3
- package/dist/apps/withdraw-react/src/flow/hooks/useSubmitting.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/hooks/useSuccessCallback.d.ts +0 -3
- package/dist/apps/withdraw-react/src/flow/never.d.ts +0 -1
- package/dist/apps/withdraw-react/src/flow/types.d.ts +0 -70
- package/dist/apps/withdraw-react/src/flow/utils.d.ts +0 -1
- package/dist/apps/withdraw-react/src/index.d.ts +0 -21
- package/dist/apps/withdraw-react/src/main.d.ts +0 -0
- package/dist/apps/withdraw-react/src/provider/WithdrawProvider/WithdrawProvider.d.ts +0 -5
- package/dist/apps/withdraw-react/src/provider/WithdrawProvider/index.d.ts +0 -2
- package/dist/apps/withdraw-react/src/provider/WithdrawProvider/types.d.ts +0 -14
- package/dist/apps/withdraw-react/src/provider/WithdrawStoreProvider.d.ts +0 -7
- package/dist/apps/withdraw-react/src/quote/usePrepare.d.ts +0 -11
- package/dist/apps/withdraw-react/src/routes/useGetRoutes.d.ts +0 -13
- package/dist/apps/withdraw-react/src/select/WithdrawBlockchainSelect.d.ts +0 -7
- package/dist/apps/withdraw-react/src/select/WithdrawBlockchainSelectStep.d.ts +0 -1
- package/dist/apps/withdraw-react/src/select/WithdrawCurrencySelect.d.ts +0 -7
- package/dist/apps/withdraw-react/src/select/WithdrawCurrencySelectStep.d.ts +0 -1
- package/dist/apps/withdraw-react/src/select/deriveRouteOptions.d.ts +0 -8
- package/dist/apps/withdraw-react/src/setupTests.d.ts +0 -0
- package/dist/apps/withdraw-react/src/status/useGetStatus.d.ts +0 -10
- package/dist/apps/withdraw-react/src/submit/useSubmitWithdraw.d.ts +0 -11
- package/dist/apps/withdraw-react/src/test/fixtures.d.ts +0 -73
- package/dist/apps/withdraw-react/src/test/setupFetchMock.d.ts +0 -57
- package/dist/apps/withdraw-react/src/test/types.d.ts +0 -3
- package/dist/apps/withdraw-react/src/test-utils.d.ts +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AmountInput: () => JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { WithdrawalCustomerSwapRoute } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { CryptoFormActions, CryptoFormState } from './useCryptoForm';
|
|
3
|
-
interface CryptoFormDisplayOwnProps {
|
|
4
|
-
selectedRoute?: WithdrawalCustomerSwapRoute;
|
|
5
|
-
blockchainSelectDisabled: boolean;
|
|
6
|
-
onOpenCurrencySelect: () => void;
|
|
7
|
-
onOpenBlockchainSelect: () => void;
|
|
8
|
-
}
|
|
9
|
-
export type CryptoFormDisplayProps = CryptoFormState & CryptoFormActions & CryptoFormDisplayOwnProps;
|
|
10
|
-
export declare const CryptoFormDisplay: (props: CryptoFormDisplayProps) => JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoFormScreen: () => JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
export interface CryptoFormStateValue {
|
|
3
|
-
amountInput: string;
|
|
4
|
-
minimalUnits: bigint;
|
|
5
|
-
setAmountInput: (amountInput: string) => void;
|
|
6
|
-
destinationAddress: string;
|
|
7
|
-
setDestinationAddress: (address: string) => void;
|
|
8
|
-
availableBalance: bigint | undefined;
|
|
9
|
-
setAmountToBalanceFraction: (percent: number) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const CryptoFormStateProvider: ({ children, }: {
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
}) => JSX.Element;
|
|
14
|
-
export declare const useCryptoFormState: () => CryptoFormStateValue;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RecipientAddressInput: () => JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { QuoteResponse } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { FormFields } from './types';
|
|
3
|
-
export declare const MOCK_QUOTE_SUMMARY: {
|
|
4
|
-
sourceAmount: string;
|
|
5
|
-
sourceToken: string;
|
|
6
|
-
destinationAmount: string;
|
|
7
|
-
destinationToken: string;
|
|
8
|
-
destinationAmountMin: string;
|
|
9
|
-
expiresAt: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const MOCK_QUOTE_RESPONSE: QuoteResponse;
|
|
12
|
-
export declare const DEFAULT_FORM_FIELDS: FormFields;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { QuoteResponse } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { FormFields } from './types';
|
|
3
|
-
export interface CryptoFormState {
|
|
4
|
-
loadingQuote: boolean;
|
|
5
|
-
hasQuote: boolean;
|
|
6
|
-
quoteError: {
|
|
7
|
-
code: string;
|
|
8
|
-
message: string;
|
|
9
|
-
} | undefined;
|
|
10
|
-
quote: QuoteResponse | undefined;
|
|
11
|
-
confirmDisabled: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface CryptoFormActions {
|
|
14
|
-
handleConfirm: () => void;
|
|
15
|
-
}
|
|
16
|
-
export type UseCryptoWithdrawFormResult = CryptoFormState & CryptoFormActions;
|
|
17
|
-
export declare const useCryptoWithdrawForm: (fields: FormFields) => UseCryptoWithdrawFormResult;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { FormFields } from './types';
|
|
2
|
-
export declare const useQuoteManager: (fields: FormFields) => {
|
|
3
|
-
loadingQuote: boolean;
|
|
4
|
-
hasQuote: boolean;
|
|
5
|
-
quoteError: import("../flow/types").WithdrawError | undefined;
|
|
6
|
-
quote: import("@heliofi/withdraw-core").QuoteResponse | undefined;
|
|
7
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const decimalStringToBigInt: (value: string, decimals: number) => bigint;
|
|
2
|
-
export declare const bigIntToDecimalString: (value: bigint, decimals: number) => string;
|
|
3
|
-
export declare const balanceFractionToDecimalString: (balance: bigint, percent: number, decimals: number) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoCompletedScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoLoadErrorScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoLoadingScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoSigningScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoStatusScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoSubmitErrorScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CryptoSubmittingScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RouteSelectionScreen: () => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useWithdrawContext as useWithdrawFlowContext } from '../provider/WithdrawProvider';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useSigning: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useSubmitting: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const never: (_value: never) => never;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { WithdrawalConfig } from '@heliofi/withdraw-core';
|
|
2
|
-
export declare enum WithdrawFlowType {
|
|
3
|
-
CRYPTO = "crypto",
|
|
4
|
-
CARD_BANK = "card_bank"
|
|
5
|
-
}
|
|
6
|
-
export declare enum WithdrawStepId {
|
|
7
|
-
ROUTE_SELECT = "route_select",
|
|
8
|
-
CRYPTO_LOADING = "crypto_loading",
|
|
9
|
-
CRYPTO_LOAD_ERROR = "crypto_load_error",
|
|
10
|
-
CRYPTO_FORM = "crypto_form",
|
|
11
|
-
CRYPTO_CURRENCY_SELECT = "crypto_currency_select",
|
|
12
|
-
CRYPTO_BLOCKCHAIN_SELECT = "crypto_blockchain_select",
|
|
13
|
-
CRYPTO_SIGNING = "crypto_signing",
|
|
14
|
-
CRYPTO_SIGN_ERROR = "crypto_sign_error",
|
|
15
|
-
CRYPTO_SUBMITTING = "crypto_submitting",
|
|
16
|
-
CRYPTO_SUBMIT_ERROR = "crypto_submit_error",
|
|
17
|
-
CRYPTO_STATUS = "crypto_status",
|
|
18
|
-
CRYPTO_COMPLETED = "crypto_completed",
|
|
19
|
-
CRYPTO_FAILED = "crypto_failed",
|
|
20
|
-
CARD_BANK_COMING_SOON = "card_bank_coming_soon"
|
|
21
|
-
}
|
|
22
|
-
export interface SigningPayload {
|
|
23
|
-
kind: 'transaction' | 'typed_data';
|
|
24
|
-
data: unknown;
|
|
25
|
-
}
|
|
26
|
-
export type BlockchainEngineType = 'EVM' | 'SOL' | 'BTC' | 'TRON';
|
|
27
|
-
export interface WithdrawResult {
|
|
28
|
-
withdrawalDetailId: string;
|
|
29
|
-
status: string;
|
|
30
|
-
}
|
|
31
|
-
export declare enum WithdrawErrorCode {
|
|
32
|
-
LOAD_FAILED = "LOAD_FAILED",
|
|
33
|
-
MISSING_ID = "MISSING_ID",
|
|
34
|
-
QUOTE_FAILED = "QUOTE_FAILED",
|
|
35
|
-
SIGN_FAILED = "SIGN_FAILED",
|
|
36
|
-
SUBMIT_FAILED = "SUBMIT_FAILED",
|
|
37
|
-
STATUS_FAILED = "STATUS_FAILED"
|
|
38
|
-
}
|
|
39
|
-
export interface WithdrawError {
|
|
40
|
-
code: WithdrawErrorCode;
|
|
41
|
-
message: string;
|
|
42
|
-
}
|
|
43
|
-
export interface WithdrawFlowContextValue {
|
|
44
|
-
withdrawalConfigId: string | undefined;
|
|
45
|
-
withdrawalConfig: WithdrawalConfig | undefined;
|
|
46
|
-
withdrawalConfigLoading: boolean;
|
|
47
|
-
withdrawalConfigError: boolean;
|
|
48
|
-
sourceWalletAddress: string | undefined;
|
|
49
|
-
handleSign: (signingPayload: SigningPayload) => Promise<string>;
|
|
50
|
-
onSuccess?: (result: WithdrawResult) => void;
|
|
51
|
-
onError?: (error: WithdrawError) => void;
|
|
52
|
-
connectedWalletAddress?: string;
|
|
53
|
-
connectedWalletEngineType?: BlockchainEngineType;
|
|
54
|
-
activeFlow: WithdrawFlowType | null;
|
|
55
|
-
setActiveFlow: (flow: WithdrawFlowType | null) => void;
|
|
56
|
-
currentStep: WithdrawStepId;
|
|
57
|
-
setCurrentStep: (step: WithdrawStepId) => void;
|
|
58
|
-
}
|
|
59
|
-
export interface MoonPayCommerceWithdrawProps {
|
|
60
|
-
withdrawalConfigId: string;
|
|
61
|
-
publicApiKey: string;
|
|
62
|
-
handleSign: (signingPayload: SigningPayload) => Promise<string>;
|
|
63
|
-
sourceWalletAddress: string;
|
|
64
|
-
onSuccess?: (result: WithdrawResult) => void;
|
|
65
|
-
onError?: (error: WithdrawError) => void;
|
|
66
|
-
connectedWalletAddress?: string;
|
|
67
|
-
connectedWalletEngineType?: BlockchainEngineType;
|
|
68
|
-
baseUrl?: string;
|
|
69
|
-
debug?: boolean;
|
|
70
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getLoadErrorMessage: (withdrawalConfigError: boolean, routesIsError: boolean, routesErrorReason: string | undefined) => string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export { useGetBalances } from './balance/useGetBalances';
|
|
2
|
-
export type { MoonPayCommerceWithdrawProps } from './components/moonPayCommerceWithdraw';
|
|
3
|
-
export { MoonPayCommerceWithdraw } from './components/moonPayCommerceWithdraw';
|
|
4
|
-
export { useGetWithdraw } from './config/useGetWithdraw';
|
|
5
|
-
export { FormInputState, withdrawCryptoEvents, WithdrawCryptoState, } from './crypto-flow/machine';
|
|
6
|
-
export type { WithdrawCryptoContext, WithdrawCryptoEvent, } from './crypto-flow/types';
|
|
7
|
-
export { useWithdrawCryptoMachine, WithdrawCryptoMachineProvider, } from './crypto-flow/WithdrawCryptoMachineProvider';
|
|
8
|
-
export type { BlockchainEngineType, SigningPayload, WithdrawError, WithdrawFlowContextValue, WithdrawResult, } from './flow/types';
|
|
9
|
-
export { WithdrawFlowType, WithdrawStepId } from './flow/types';
|
|
10
|
-
export { useWithdrawFlowContext } from './flow/WithdrawFlowContext';
|
|
11
|
-
export type { WithdrawProviderProps } from './provider/WithdrawProvider';
|
|
12
|
-
export { WithdrawProvider } from './provider/WithdrawProvider';
|
|
13
|
-
export { useWithdrawContext } from './provider/WithdrawProvider';
|
|
14
|
-
export type { WithdrawStoreProviderProps } from './provider/WithdrawStoreProvider';
|
|
15
|
-
export { WithdrawStoreProvider } from './provider/WithdrawStoreProvider';
|
|
16
|
-
export { usePrepare } from './quote/usePrepare';
|
|
17
|
-
export { useGetRoutes } from './routes/useGetRoutes';
|
|
18
|
-
export { useGetStatus } from './status/useGetStatus';
|
|
19
|
-
export { useSubmitWithdraw } from './submit/useSubmitWithdraw';
|
|
20
|
-
export type { ApiClientConfig, BalanceResponse, PolymarketWalletPreparedTransaction, PreparedTransaction, PrepareWithdrawalParams, QuoteResponse, QuoteSummary, RawPreparedTransaction, RoutesResponse, StatusResponse, SubmitResponse, SubmitWithdrawalParams, UserOpPreparedTransaction, WithdrawalConfig, WithdrawalJwtPayload, } from '@heliofi/withdraw-core';
|
|
21
|
-
export { SignedTransactionKind, TERMINAL_STATES, WithdrawalApiError, WithdrawalErrorCode, WithdrawalState, } from '@heliofi/withdraw-core';
|
|
File without changes
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { WithdrawProviderProps } from './types';
|
|
2
|
-
import { type WithdrawFlowContextValue } from '../../flow/types';
|
|
3
|
-
export declare const useWithdrawContext: () => WithdrawFlowContextValue;
|
|
4
|
-
export declare const WithdrawProviderInternal: ({ withdrawalConfigId, sourceWalletAddress, handleSign, onSuccess, onError, connectedWalletAddress, connectedWalletEngineType, children, }: Omit<WithdrawProviderProps, 'publicApiKey' | 'baseUrl'>) => JSX.Element;
|
|
5
|
-
export declare const WithdrawProvider: ({ publicApiKey, baseUrl, ...rest }: WithdrawProviderProps) => JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { BlockchainEngineType, SigningPayload, WithdrawError, WithdrawResult } from '../../flow/types';
|
|
3
|
-
export interface WithdrawProviderProps {
|
|
4
|
-
publicApiKey: string;
|
|
5
|
-
baseUrl?: string;
|
|
6
|
-
withdrawalConfigId?: string;
|
|
7
|
-
sourceWalletAddress?: string;
|
|
8
|
-
handleSign: (signingPayload: SigningPayload) => Promise<string>;
|
|
9
|
-
onSuccess?: (result: WithdrawResult) => void;
|
|
10
|
-
onError?: (error: WithdrawError) => void;
|
|
11
|
-
connectedWalletAddress?: string;
|
|
12
|
-
connectedWalletEngineType?: BlockchainEngineType;
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { WithdrawalSDK } from '@heliofi/withdraw-core';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
3
|
-
export interface WithdrawStoreProviderProps {
|
|
4
|
-
sdk: WithdrawalSDK;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const WithdrawStoreProvider: ({ sdk, children, }: WithdrawStoreProviderProps) => JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { PrepareWithdrawalParams, QuoteResponse } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { WithdrawQueryError } from '../api/errors';
|
|
3
|
-
interface UsePrepareResult {
|
|
4
|
-
trigger: (params: PrepareWithdrawalParams) => Promise<QuoteResponse>;
|
|
5
|
-
data: QuoteResponse | undefined;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
isError: boolean;
|
|
8
|
-
error: WithdrawQueryError | undefined;
|
|
9
|
-
}
|
|
10
|
-
export declare const usePrepare: () => UsePrepareResult;
|
|
11
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { RoutesResponse, WithdrawalCustomerSwapRoute } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { WithdrawQueryError } from '../api/errors';
|
|
3
|
-
interface UseGetRoutesResult {
|
|
4
|
-
data: RoutesResponse | undefined;
|
|
5
|
-
availableRoutes: WithdrawalCustomerSwapRoute[];
|
|
6
|
-
routesById: Record<string, WithdrawalCustomerSwapRoute>;
|
|
7
|
-
isLoading: boolean;
|
|
8
|
-
isError: boolean;
|
|
9
|
-
isSuccess: boolean;
|
|
10
|
-
error: WithdrawQueryError | undefined;
|
|
11
|
-
}
|
|
12
|
-
export declare const useGetRoutes: () => UseGetRoutesResult;
|
|
13
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type OptionListItem } from '../../../../packages/solis-ui/index.ts';
|
|
2
|
-
export interface WithdrawBlockchainSelectProps {
|
|
3
|
-
options: OptionListItem<string>[];
|
|
4
|
-
selectedBlockchainName?: string;
|
|
5
|
-
onSelect: (blockchainName: string) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const WithdrawBlockchainSelect: ({ options, selectedBlockchainName, onSelect, }: WithdrawBlockchainSelectProps) => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const WithdrawBlockchainSelectStep: () => JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type OptionListItem } from '../../../../packages/solis-ui/index.ts';
|
|
2
|
-
export interface WithdrawCurrencySelectProps {
|
|
3
|
-
options: OptionListItem<string>[];
|
|
4
|
-
selectedCurrencySymbol?: string;
|
|
5
|
-
onSelect: (currencySymbol: string) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const WithdrawCurrencySelect: ({ options, selectedCurrencySymbol, onSelect, }: WithdrawCurrencySelectProps) => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const WithdrawCurrencySelectStep: () => JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { WithdrawalCustomerSwapRoute } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { OptionListItem } from '../../../../packages/solis-ui/index.ts';
|
|
3
|
-
export declare const getCurrencyOptions: (routes: WithdrawalCustomerSwapRoute[]) => OptionListItem<string>[];
|
|
4
|
-
export declare const getBlockchainOptionsForCurrency: (routes: WithdrawalCustomerSwapRoute[], currencySymbol: string | undefined) => OptionListItem<string>[];
|
|
5
|
-
export declare const getSelectedCurrencySymbol: (routesById: Record<string, WithdrawalCustomerSwapRoute>, toCurrencyId: string | undefined) => string | undefined;
|
|
6
|
-
export declare const getSelectedBlockchainName: (routesById: Record<string, WithdrawalCustomerSwapRoute>, toCurrencyId: string | undefined) => string | undefined;
|
|
7
|
-
export declare const getFirstRouteIdForCurrency: (routes: WithdrawalCustomerSwapRoute[], currencySymbol: string) => string | undefined;
|
|
8
|
-
export declare const getRouteIdForCurrencyBlockchain: (routes: WithdrawalCustomerSwapRoute[], currencySymbol: string | undefined, blockchainName: string) => string | undefined;
|
|
File without changes
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StatusResponse } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { WithdrawQueryError } from '../api/errors';
|
|
3
|
-
interface UseGetStatusResult {
|
|
4
|
-
data: StatusResponse | undefined;
|
|
5
|
-
isLoading: boolean;
|
|
6
|
-
isError: boolean;
|
|
7
|
-
error: WithdrawQueryError | undefined;
|
|
8
|
-
}
|
|
9
|
-
export declare const useGetStatus: (withdrawalDetailId: string | undefined) => UseGetStatusResult;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SubmitResponse, SubmitWithdrawalParams } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { WithdrawQueryError } from '../api/errors';
|
|
3
|
-
interface UseSubmitWithdrawResult {
|
|
4
|
-
trigger: (params: SubmitWithdrawalParams) => Promise<SubmitResponse>;
|
|
5
|
-
data: SubmitResponse | undefined;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
isError: boolean;
|
|
8
|
-
error: WithdrawQueryError | undefined;
|
|
9
|
-
}
|
|
10
|
-
export declare const useSubmitWithdraw: () => UseSubmitWithdrawResult;
|
|
11
|
-
export {};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { QuoteResponse, QuoteSummary } from '@heliofi/withdraw-core';
|
|
2
|
-
import type { BalanceResponse, WalletCurrencyBalanceFixture } from './types';
|
|
3
|
-
export declare const BASE_URL = "https://api.hel.io/v1";
|
|
4
|
-
export declare const TEST_CONFIG_ID = "test-config-123";
|
|
5
|
-
export declare const TEST_DETAIL_ID = "test-detail-456";
|
|
6
|
-
export declare const TEST_SOURCE_WALLET = "0xSourceWallet";
|
|
7
|
-
export declare const URLS: {
|
|
8
|
-
readonly config: "https://api.hel.io/v1/withdrawal-configs/test-config-123/public";
|
|
9
|
-
readonly routes: "https://api.hel.io/v1/withdraw/test-config-123/routes";
|
|
10
|
-
readonly balance: "https://api.hel.io/v1/withdraw/test-config-123/balances?walletAddress=0xSourceWallet";
|
|
11
|
-
readonly prepare: "https://api.hel.io/v1/withdraw/test-config-123/prepare";
|
|
12
|
-
readonly submit: "https://api.hel.io/v1/withdraw/test-detail-456/submit";
|
|
13
|
-
readonly status: "https://api.hel.io/v1/withdraw-details/test-detail-456";
|
|
14
|
-
};
|
|
15
|
-
export declare const mockFromCurrency: {
|
|
16
|
-
id: string;
|
|
17
|
-
symbol: string;
|
|
18
|
-
name: string;
|
|
19
|
-
mintAddress: string;
|
|
20
|
-
decimals: number;
|
|
21
|
-
blockchain: {
|
|
22
|
-
id: string;
|
|
23
|
-
symbol: string;
|
|
24
|
-
displayName: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare const mockConfig: (overrides?: Record<string, unknown>) => {
|
|
28
|
-
id: string;
|
|
29
|
-
name: string;
|
|
30
|
-
kind: string;
|
|
31
|
-
disabled: boolean;
|
|
32
|
-
fromCurrencies: {
|
|
33
|
-
blockchain: {
|
|
34
|
-
id: string;
|
|
35
|
-
symbol: string;
|
|
36
|
-
displayName: string;
|
|
37
|
-
};
|
|
38
|
-
id: string;
|
|
39
|
-
symbol: string;
|
|
40
|
-
name: string;
|
|
41
|
-
mintAddress: string;
|
|
42
|
-
decimals: number;
|
|
43
|
-
}[];
|
|
44
|
-
};
|
|
45
|
-
export declare const mockRoutes: (overrides?: Record<string, unknown>) => {
|
|
46
|
-
routes: {
|
|
47
|
-
available: boolean;
|
|
48
|
-
toCurrency: {
|
|
49
|
-
id: string;
|
|
50
|
-
symbol: string;
|
|
51
|
-
blockchain: {
|
|
52
|
-
displayName: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
}[];
|
|
56
|
-
};
|
|
57
|
-
export declare const mockWalletCurrencyBalance: (override?: Partial<WalletCurrencyBalanceFixture>) => WalletCurrencyBalanceFixture;
|
|
58
|
-
export declare const mockBalance: (overrides?: Partial<WalletCurrencyBalanceFixture>) => BalanceResponse;
|
|
59
|
-
export declare const mockQuoteSummary: (overrides?: Partial<QuoteSummary>) => QuoteSummary;
|
|
60
|
-
export declare const mockQuote: (overrides?: Partial<QuoteResponse>) => QuoteResponse;
|
|
61
|
-
export declare const mockSubmit: (overrides?: Record<string, unknown>) => {
|
|
62
|
-
withdrawId: string;
|
|
63
|
-
txHash: string;
|
|
64
|
-
state: string;
|
|
65
|
-
broadcastAck: string;
|
|
66
|
-
};
|
|
67
|
-
export declare const mockStatus: (overrides?: Record<string, unknown>) => {
|
|
68
|
-
withdrawalDetailId: string;
|
|
69
|
-
state: string;
|
|
70
|
-
txHash: string;
|
|
71
|
-
broadcastAck: string;
|
|
72
|
-
errorReason: null;
|
|
73
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { WalletCurrencyBalanceFixture } from './types';
|
|
2
|
-
interface RouterOverrides {
|
|
3
|
-
config?: Record<string, unknown>;
|
|
4
|
-
routes?: Record<string, unknown>;
|
|
5
|
-
balance?: Partial<WalletCurrencyBalanceFixture>;
|
|
6
|
-
quote?: Record<string, unknown>;
|
|
7
|
-
submit?: Record<string, unknown>;
|
|
8
|
-
status?: Record<string, unknown>;
|
|
9
|
-
}
|
|
10
|
-
export declare const setupFetchMock: (overrides?: RouterOverrides) => {
|
|
11
|
-
config: {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
kind: string;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
fromCurrencies: {
|
|
17
|
-
blockchain: {
|
|
18
|
-
id: string;
|
|
19
|
-
symbol: string;
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
22
|
-
id: string;
|
|
23
|
-
symbol: string;
|
|
24
|
-
name: string;
|
|
25
|
-
mintAddress: string;
|
|
26
|
-
decimals: number;
|
|
27
|
-
}[];
|
|
28
|
-
};
|
|
29
|
-
routes: {
|
|
30
|
-
routes: {
|
|
31
|
-
available: boolean;
|
|
32
|
-
toCurrency: {
|
|
33
|
-
id: string;
|
|
34
|
-
symbol: string;
|
|
35
|
-
blockchain: {
|
|
36
|
-
displayName: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
}[];
|
|
40
|
-
};
|
|
41
|
-
balance: import("@heliofi/withdraw-core").BalanceResponse;
|
|
42
|
-
quote: import("@heliofi/withdraw-core").QuoteResponse;
|
|
43
|
-
submit: {
|
|
44
|
-
withdrawId: string;
|
|
45
|
-
txHash: string;
|
|
46
|
-
state: string;
|
|
47
|
-
broadcastAck: string;
|
|
48
|
-
};
|
|
49
|
-
status: {
|
|
50
|
-
withdrawalDetailId: string;
|
|
51
|
-
state: string;
|
|
52
|
-
txHash: string;
|
|
53
|
-
broadcastAck: string;
|
|
54
|
-
errorReason: null;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type RenderHookOptions } from '@testing-library/react';
|
|
2
|
-
import { type WithdrawProviderProps } from './provider/WithdrawProvider';
|
|
3
|
-
export declare const assertCurrencyAmountToHaveValue: (symbol: string, expectedValue: string) => void;
|
|
4
|
-
export declare const baseWithdrawProviderProps: Omit<WithdrawProviderProps, 'children'>;
|
|
5
|
-
export declare const renderWithdrawHookWithProvider: <TResult>(hook: () => TResult, overrides?: Partial<Omit<WithdrawProviderProps, 'children'>>, renderHookOptions?: Omit<RenderHookOptions<unknown>, 'wrapper'>) => import("@testing-library/react").RenderHookResult<TResult, unknown>;
|