-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Expose a flat API controller from neuron wallet to UI layer
Neuron UI should require this api controller only.
- Loading branch information
Showing
11 changed files
with
222 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
import { controllerMethodWrapper } from './controllerMethodWrapper' | ||
import { apiMethodWrapper } from './apiMethodWrapper' | ||
|
||
const CONTROLLER_NAME = 'api' | ||
export const getNeuronWalletState = controllerMethodWrapper(CONTROLLER_NAME)(controller => () => | ||
controller.loadInitData() | ||
) | ||
export const getNeuronWalletState = apiMethodWrapper()(controller => () => controller.loadInitData()) | ||
|
||
export const handleViewError = controllerMethodWrapper(CONTROLLER_NAME)(controller => (errorMessage: string) => | ||
export const handleViewError = apiMethodWrapper()(controller => (errorMessage: string) => | ||
controller.handleViewError(errorMessage) | ||
) | ||
export const contextMenu = controllerMethodWrapper(CONTROLLER_NAME)( | ||
controller => (params: { type: string; id: string }) => controller.contextMenu(params) | ||
) | ||
|
||
export const showTransactionDetails = controllerMethodWrapper(CONTROLLER_NAME)(controller => (hash: string) => | ||
controller.showTransactionDetails(hash) | ||
export const contextMenu = apiMethodWrapper()(controller => (params: { type: string; id: string }) => | ||
controller.contextMenu(params) | ||
) | ||
|
||
export default { | ||
getNeuronWalletState, | ||
handleViewError, | ||
contextMenu, | ||
showTransactionDetails, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import { controllerMethodWrapper } from './controllerMethodWrapper' | ||
import { apiMethodWrapper } from './apiMethodWrapper' | ||
|
||
const CONTROLLER_NAME = 'skip-data-and-type' | ||
|
||
export const setSkipDataAndType = controllerMethodWrapper(CONTROLLER_NAME)( | ||
(controller: any) => (params: Controller.SetSkipAndTypeParam) => { | ||
return controller.update(params) | ||
} | ||
) | ||
export const setSkipDataAndType = apiMethodWrapper()((api: any) => (params: Controller.SetSkipAndTypeParam) => { | ||
return api.updateSkipDataAndType(params) | ||
}) | ||
|
||
export default { setSkipDataAndType } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.