///
import * as React from 'react';
import type { CurrencyCode } from '../../utils/currency-helpers';
declare global {
interface Window {
bitcoinAbc: any;
}
}
type ValidCoinTypes = string;
type ButtonStates = 'fresh' | 'pending' | 'complete' | 'expired' | 'install';
type CashtabBaseProps = {
to: string;
stepControlled?: ButtonStates;
currency: CurrencyCode;
price?: number;
coinType: ValidCoinTypes;
tokenId?: string;
amount?: number;
isRepeatable: boolean;
repeatTimeout: number;
watchAddress: boolean;
opReturn?: string[];
showQR: boolean;
successFn?: Function;
failFn?: Function;
};
interface IState {
step: ButtonStates;
errors: string[];
satoshis?: number;
coinSymbol?: string;
coinName?: string;
coinDecimals?: number;
unconfirmedCount?: number;
intervalPrice?: NodeJS.Timeout;
intervalUnconfirmed?: NodeJS.Timeout;
intervalTimer?: NodeJS.Timeout;
}
declare const CashtabBase: (Wrapped: any) => {
new (props: CashtabBaseProps | Readonly): {
state: {
step: ButtonStates;
satoshis: undefined;
coinSymbol: undefined;
coinDecimals: undefined;
coinName: undefined;
unconfirmedCount: undefined;
intervalPrice: undefined;
intervalUnconfirmed: undefined;
intervalTimer: undefined;
errors: never[];
};
addError: (error: string) => void;
startRepeatable: () => void;
paymentSendSuccess: () => void;
getCashTabProviderStatus: () => boolean;
handleClick: () => void;
updateSatoshisFiat: import("lodash").DebouncedFuncLeading<() => Promise>;
setupSatoshisFiat: () => void;
setupWatchAddress: () => Promise;
setupCoinMeta: () => Promise;
confirmCashTabProviderStatus: () => void;
componentDidMount(): Promise;
componentWillUnmount(): void;
componentDidUpdate(prevProps: CashtabBaseProps, prevState: IState): void;
render(): JSX.Element;
context: any;
setState(state: IState | ((prevState: Readonly, props: Readonly) => IState | Pick | null) | Pick | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & Readonly<{
children?: React.ReactNode;
}>;
refs: {
[key: string]: React.ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
};
new (props: CashtabBaseProps, context: any): {
state: {
step: ButtonStates;
satoshis: undefined;
coinSymbol: undefined;
coinDecimals: undefined;
coinName: undefined;
unconfirmedCount: undefined;
intervalPrice: undefined;
intervalUnconfirmed: undefined;
intervalTimer: undefined;
errors: never[];
};
addError: (error: string) => void;
startRepeatable: () => void;
paymentSendSuccess: () => void;
getCashTabProviderStatus: () => boolean;
handleClick: () => void;
updateSatoshisFiat: import("lodash").DebouncedFuncLeading<() => Promise>;
setupSatoshisFiat: () => void;
setupWatchAddress: () => Promise;
setupCoinMeta: () => Promise;
confirmCashTabProviderStatus: () => void;
componentDidMount(): Promise;
componentWillUnmount(): void;
componentDidUpdate(prevProps: CashtabBaseProps, prevState: IState): void;
render(): JSX.Element;
context: any;
setState(state: IState | ((prevState: Readonly, props: Readonly) => IState | Pick | null) | Pick | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & Readonly<{
children?: React.ReactNode;
}>;
refs: {
[key: string]: React.ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
};
defaultProps: {
currency: string;
coinType: string;
isRepeatable: boolean;
watchAddress: boolean;
showQR: boolean;
repeatTimeout: number;
};
contextType?: React.Context | undefined;
};
export type { CashtabBaseProps, ButtonStates, ValidCoinTypes, IState };
export default CashtabBase;