MyCrypto/common/actions/paritySigner/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

41 lines
995 B
TypeScript

import * as types from './actionTypes';
import { TypeKeys } from './constants';
export type TRequestTransactionSignature = typeof requestTransactionSignature;
export function requestTransactionSignature(
from: string,
data: string
): types.RequestTransactionSignatureAction {
return {
type: TypeKeys.PARITY_SIGNER_REQUEST_TX_SIGNATURE,
payload: {
isMessage: false,
from,
data
}
};
}
export type TRequestMessageSignature = typeof requestMessageSignature;
export function requestMessageSignature(
from: string,
data: string
): types.RequestMessageSignatureAction {
return {
type: TypeKeys.PARITY_SIGNER_REQUEST_MSG_SIGNATURE,
payload: {
isMessage: true,
from,
data
}
};
}
export type TFinalizeSignature = typeof finalizeSignature;
export function finalizeSignature(signature: string | null): types.FinalizeSignatureAction {
return {
type: TypeKeys.PARITY_SIGNER_FINALIZE_SIGNATURE,
payload: signature
};
}