MyCrypto/common/actions/message/actionCreators.ts
Maciej Hirsz cf59688896 Enable Parity Signer Message Signing (#1663)
* Enable Parity Signer to sign messages

* Verify that message signature is correct

* Type systems are awesome :)
2018-04-25 19:36:29 -05:00

29 lines
829 B
TypeScript

import * as interfaces from './actionTypes';
import { TypeKeys } from './constants';
import { ISignedMessage } from 'libs/signing';
export type TSignMessageRequested = typeof signMessageRequested;
export function signMessageRequested(payload: string): interfaces.SignMessageRequestedAction {
return {
type: TypeKeys.SIGN_MESSAGE_REQUESTED,
payload
};
}
export type TSignLocalMessageSucceeded = typeof signLocalMessageSucceeded;
export function signLocalMessageSucceeded(
payload: ISignedMessage
): interfaces.SignLocalMessageSucceededAction {
return {
type: TypeKeys.SIGN_LOCAL_MESSAGE_SUCCEEDED,
payload
};
}
export type TSignMessageFailed = typeof signMessageFailed;
export function signMessageFailed(): interfaces.SignMessageFailedAction {
return {
type: TypeKeys.SIGN_MESSAGE_FAILED
};
}