21 lines
713 B
TypeScript
21 lines
713 B
TypeScript
|
import { getChainCode } from './getChainCode';
|
||
|
import { signTransaction } from './signTransaction';
|
||
|
import { signMessage } from './signMessage';
|
||
|
import { displayAddress } from './displayAddress';
|
||
|
import { EnclaveMethods, EnclaveMethodParams, EnclaveMethodResponse } from 'shared/enclave/types';
|
||
|
|
||
|
type EnclaveHandlers = {
|
||
|
[key in EnclaveMethods]: (
|
||
|
params: EnclaveMethodParams
|
||
|
) => EnclaveMethodResponse | Promise<EnclaveMethodResponse>
|
||
|
};
|
||
|
|
||
|
const handlers: EnclaveHandlers = {
|
||
|
[EnclaveMethods.GET_CHAIN_CODE]: getChainCode,
|
||
|
[EnclaveMethods.SIGN_TRANSACTION]: signTransaction,
|
||
|
[EnclaveMethods.SIGN_MESSAGE]: signMessage,
|
||
|
[EnclaveMethods.DISPLAY_ADDRESS]: displayAddress
|
||
|
};
|
||
|
|
||
|
export default handlers;
|