Skip to content

Commit

Permalink
fix(neuron-ui): use the create api for creating wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Aug 19, 2019
1 parent 3d673f8 commit 49edee8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/neuron-ui/src/services/remote/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const updateWallet = controllerMethodWrapper(CONTROLLER_NAME)(
)
export const getCurrentWallet = controllerMethodWrapper(CONTROLLER_NAME)(controller => () => controller.getCurrent())
export const getWalletList = controllerMethodWrapper(CONTROLLER_NAME)(controller => () => controller.getAll())

export const createWallet = controllerMethodWrapper(CONTROLLER_NAME)(
controller => (params: Controller.CreateWalletParams) => controller.create(params)
)
export const importMnemonic = controllerMethodWrapper(CONTROLLER_NAME)(
controller => (params: Controller.ImportMnemonicParams) => controller.importMnemonic(params)
)
Expand Down Expand Up @@ -41,6 +45,7 @@ export const updateAddressDescription = controllerMethodWrapper(CONTROLLER_NAME)
export default {
updateWallet,
getWalletList,
createWallet,
importMnemonic,
importKeystore,
deleteWallet,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AppActions, StateDispatch } from 'states/stateProvider/reducer'
import {
getWalletList,
createWallet,
importMnemonic,
importKeystore,
getCurrentWallet,
Expand Down Expand Up @@ -44,7 +45,7 @@ export const createWalletWithMnemonic = (params: Controller.ImportMnemonicParams
_dispatch: StateDispatch,
history: any
) => {
importMnemonic(params).then(res => {
createWallet(params).then(res => {
if (res.status) {
history.push(Routes.Overview)
} else {
Expand Down
5 changes: 5 additions & 0 deletions packages/neuron-ui/src/types/Controller/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
declare namespace Controller {
interface CreateWalletParams {
name: string
mnemonic: string
password: string
}
interface ImportMnemonicParams {
name: string
mnemonic: string
Expand Down

0 comments on commit 49edee8

Please sign in to comment.