UNPKG

@gear-js/react-hooks

Version:
22 lines (21 loc) 850 B
import { GasLimit, ProgramMetadata } from '@gear-js/api'; import { AnyJson, IKeyringPair } from '@polkadot/types/types'; import { HexString } from '@polkadot/util/types'; type UseSendMessageOptions = { disableAlerts?: boolean; disableCheckBalance?: boolean; pair?: IKeyringPair; }; type SendMessageOptions = { payload: AnyJson; gasLimit: GasLimit; value?: string | number; keepAlive?: boolean; voucherId?: HexString; onSuccess?: (messageId: HexString) => void; onInBlock?: (messageId: HexString) => void; onError?: () => void; }; declare function useSendMessage(destination: HexString, metadata: ProgramMetadata | undefined, { disableAlerts, pair }?: UseSendMessageOptions): (args: SendMessageOptions) => Promise<void>; export { useSendMessage }; export type { SendMessageOptions, UseSendMessageOptions };