import { EnclaveMethods, EnclaveMethodParams, GetChainCodeParams, GetChainCodeResponse, SignTransactionParams, SignTransactionResponse, SignMessageParams, SignMessageResponse, DisplayAddressParams, DisplayAddressResponse } from 'shared/enclave/types'; import { makeRequest } from './requests'; function makeMethod(method: EnclaveMethods) { return (params: ParamsType) => makeRequest(method, params); } export class EnclaveAPIClass { public getChainCode = makeMethod( EnclaveMethods.GET_CHAIN_CODE ); public signTransaction = makeMethod( EnclaveMethods.SIGN_TRANSACTION ); public signMessage = makeMethod( EnclaveMethods.SIGN_MESSAGE ); public displayAddress = makeMethod( EnclaveMethods.DISPLAY_ADDRESS ); } export default new EnclaveAPIClass(); export * from 'shared/enclave/types';