///
import { WithTranslation } from 'react-i18next';
import { SubmittableExtrinsic } from '@polkadot/api/promise/types';
import { Abi } from '@polkadot/api-contract';
import { ActionStatus } from '@polkadot/react-components/Status/types';
import { InputAddressProps } from '@polkadot/react-components/InputAddress/types';
import { IExtrinsic } from '@polkadot/types/types';
import { ApiProps } from '@polkadot/react-api/types';
import { TxState } from '@polkadot/react-hooks/types';
import { Index } from '@polkadot/types/interfaces';
import { ButtonProps, Button$OnClick, Button$Sizes } from './Button/types';
import { TxCallback, TxFailedCallback } from './Status/types';
export interface BareProps {
className?: string;
style?: Record;
}
export interface AppProps {
basePath: string;
className?: string;
onStatusChange: (status: ActionStatus) => void;
}
export declare type I18nProps = BareProps & WithTranslation;
export declare type ButtonRef = React.RefObject>;
export interface FormProps {
onCancel: Button$OnClick;
onSubmit: Button$OnClick;
}
export declare type ConstructTxFn = () => any[];
export declare type TxTrigger = React.ComponentType;
export interface TxTriggerProps {
onOpen: () => void;
}
export interface TxButtonInterface {
component?: {
current?: {
send: () => void;
};
};
}
export interface TxProps {
extrinsic?: IExtrinsic | SubmittableExtrinsic | null;
tx?: string;
params?: any[] | ConstructTxFn;
}
export interface TxButtonProps extends TxProps, ApiProps {
accountId?: string;
accountNonce?: Index;
className?: string;
icon: string;
iconSize?: Button$Sizes;
innerRef: ButtonRef;
isBasic?: boolean;
isDisabled?: boolean;
isNegative?: boolean;
isPrimary?: boolean;
isUnsigned?: boolean;
label: React.ReactNode;
onClick?: () => any;
onFailed?: TxFailedCallback;
onStart?: () => void;
onSuccess?: TxCallback;
onUpdate?: TxCallback;
tooltip?: string;
withSpinner?: boolean;
}
export interface TxButtonNewProps extends TxProps {
accountId?: StringOrNull;
accountNonce?: Index;
className?: string;
icon: string;
iconSize?: Button$Sizes;
isBasic?: boolean;
isDisabled?: boolean;
isNegative?: boolean;
isPrimary?: boolean;
isUnsigned?: boolean;
label: React.ReactNode;
onClick?: () => any;
onFailed?: TxFailedCallback;
onStart?: () => void;
onSuccess?: TxCallback;
onUpdate?: TxCallback;
tooltip?: string;
withSpinner?: boolean;
}
export interface TxModalProps extends I18nProps, TxState {
accountId?: StringOrNull;
header?: React.ReactNode;
isDisabled?: boolean;
isOpen?: boolean;
isUnsigned?: boolean;
children: React.ReactNode;
preContent?: React.ReactNode;
trigger?: TxTrigger;
onSubmit?: () => void;
onOpen?: () => void;
onClose?: () => void;
onSuccess?: () => void;
onFailed?: () => void;
modalProps?: {
[index: string]: any;
};
contentClassName?: string;
inputAddressHelp?: React.ReactNode;
inputAddressExtra?: React.ReactNode;
inputAddressLabel?: React.ReactNode;
inputAddressProps?: Pick;
cancelButtonLabel?: React.ReactNode;
cancelButtonProps?: Pick;
submitButtonIcon?: string;
submitButtonLabel?: React.ReactNode;
submitButtonProps?: Pick;
}
export declare type BitLength = 8 | 16 | 32 | 64 | 128 | 256;
export declare type StringOrNull = string | null;
interface ContractBase {
abi: Abi;
}
export interface Contract extends ContractBase {
address: null;
}
export interface ContractDeployed extends ContractBase {
address: string;
}
export declare type CallContract = ContractDeployed;
export interface NullContract {
abi: null;
address: null;
}
export {};