MyCrypto/common/features/message/actions.ts

35 lines
939 B
TypeScript

import { ISignedMessage } from 'libs/signing';
import * as types from './types';
export type TSignMessageRequested = typeof signMessageRequested;
export function signMessageRequested(payload: string): types.SignMessageRequestedAction {
return {
type: types.MessageActions.SIGN_REQUESTED,
payload
};
}
export type TSignLocalMessageSucceeded = typeof signLocalMessageSucceeded;
export function signLocalMessageSucceeded(
payload: ISignedMessage
): types.SignLocalMessageSucceededAction {
return {
type: types.MessageActions.SIGN_LOCAL_SUCCEEDED,
payload
};
}
export type TSignMessageFailed = typeof signMessageFailed;
export function signMessageFailed(): types.SignMessageFailedAction {
return {
type: types.MessageActions.SIGN_FAILED
};
}
export type TResetMessage = typeof resetMessage;
export function resetMessage(): types.ResetMessageAction {
return {
type: types.MessageActions.RESET
};
}