2018-04-27 20:49:17 +00:00
|
|
|
import getChainCode from './getChainCode';
|
2018-04-27 17:46:51 +00:00
|
|
|
import signTransaction from './signTransaction';
|
2018-05-04 04:26:25 +00:00
|
|
|
import signMessage from './signMessage';
|
2018-05-04 04:40:32 +00:00
|
|
|
import displayAddress from './displayAddress';
|
2018-04-29 20:04:34 +00:00
|
|
|
import { EnclaveMethods, EnclaveMethodParams, EnclaveMethodResponse } from 'shared/enclave/types';
|
2018-04-27 17:46:51 +00:00
|
|
|
|
2018-04-27 20:49:17 +00:00
|
|
|
const handlers: {
|
2018-04-29 20:04:34 +00:00
|
|
|
[key in EnclaveMethods]: (
|
|
|
|
params: EnclaveMethodParams
|
|
|
|
) => EnclaveMethodResponse | Promise<EnclaveMethodResponse>
|
2018-04-27 20:49:17 +00:00
|
|
|
} = {
|
2018-04-29 20:04:34 +00:00
|
|
|
[EnclaveMethods.GET_CHAIN_CODE]: getChainCode,
|
2018-05-04 04:26:25 +00:00
|
|
|
[EnclaveMethods.SIGN_TRANSACTION]: signTransaction,
|
2018-05-04 04:40:32 +00:00
|
|
|
[EnclaveMethods.SIGN_MESSAGE]: signMessage,
|
|
|
|
[EnclaveMethods.DISPLAY_ADDRESS]: displayAddress
|
2018-04-27 17:46:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default handlers;
|