types.ts
1 export interface ParitySignerState { 2 requested?: QrSignatureState | null; 3 } 4 5 interface QrSignatureState { 6 isMessage: boolean; 7 from: string; 8 data: string; 9 } 10 11 export enum ParitySignerActions { 12 REQUEST_TX_SIGNATURE = 'PARITY_SIGNER_REQUEST_TX_SIGNATURE', 13 REQUEST_MSG_SIGNATURE = 'PARITY_SIGNER_REQUEST_MSG_SIGNATURE', 14 FINALIZE_SIGNATURE = 'PARITY_SIGNER_FINALIZE_SIGNATURE' 15 } 16 17 export interface RequestTransactionSignatureAction { 18 type: ParitySignerActions.REQUEST_TX_SIGNATURE; 19 payload: { 20 isMessage: false; 21 data: string; 22 from: string; 23 }; 24 } 25 26 export interface RequestMessageSignatureAction { 27 type: ParitySignerActions.REQUEST_MSG_SIGNATURE; 28 payload: { 29 isMessage: true; 30 data: string; 31 from: string; 32 }; 33 } 34 35 export interface FinalizeSignatureAction { 36 type: ParitySignerActions.FINALIZE_SIGNATURE; 37 payload: string | null; 38 } 39 40 export type ParitySignerAction = 41 | RequestTransactionSignatureAction 42 | RequestMessageSignatureAction 43 | FinalizeSignatureAction;