-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaning up the cleanup for accounts restructure;
- Loading branch information
Showing
6 changed files
with
37 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
import inquirer from "inquirer"; | ||
import { EntropyAccount } from './main' | ||
import { print } from "src/common/utils" | ||
import * as config from '../config' | ||
|
||
import { | ||
manageAccountsQuestions, | ||
newAccountQuestions, | ||
registerAccount, | ||
selectAccountQuestions | ||
} from "./utils"; | ||
|
||
|
||
export async function entropyAccountCreate (entropy, endpoint) { | ||
const { name, path } = await inquirer.prompt(newAccountQuestions) | ||
|
||
const service = new EntropyAccount(entropy, endpoint) | ||
const account = await service.create({ name, path }) | ||
|
||
print(({ | ||
name: account.name, | ||
address: account.address | ||
})) | ||
} | ||
|
||
export async function entropyAccountCreate (entropy, endpoint) { | ||
const { name, path } = await inquirer.prompt(newAccountQuestions) | ||
|
||
const service = new EntropyAccount(entropy, endpoint) | ||
const account = await service.create({ name, path }) | ||
|
||
print(({ | ||
name: account.name, | ||
address: account.address | ||
})) | ||
import Entropy from "@entropyxyz/sdk"; | ||
import { EntropyConfig } from "src/config/types"; | ||
|
||
export async function entropyManageAccounts (entropy: Entropy, endpoint: string, storedConfig: EntropyConfig) { | ||
const AccountService = new EntropyAccount(entropy, endpoint) | ||
const { interactionChoice } = await inquirer.prompt(manageAccountsQuestions) | ||
switch (interactionChoice) { | ||
case 'create-import': { | ||
let { seed, name, path, importKey } = await inquirer.prompt(newAccountQuestions) | ||
if (importKey && secret.includes('#debug')) { | ||
// isDebugMode = true | ||
seed = secret.split('#debug')[0] | ||
} else { | ||
seed = importKey ? secret : randomAsHex(32) | ||
Check failure on line 25 in src/account/interaction.ts GitHub Actions / Build, test, and lint
|
||
} | ||
|
||
} | ||
case 'list-account': { | ||
|
||
} | ||
case 'select-account': { | ||
|
||
} | ||
case 'exit': { | ||
|
||
} | ||
} | ||
return { accounts: responses.accounts ? responses.accounts : storedConfig.accounts, selectedAccount: responses.selectedAccount || storedConfig.selectedAccount } | ||
Check failure on line 39 in src/account/interaction.ts GitHub Actions / Build, test, and lint
Check failure on line 39 in src/account/interaction.ts GitHub Actions / Build, test, and lint
|
||
} |
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,5 +1,6 @@ | ||
export interface AccountCreateParams { | ||
name: string | ||
seed: string | ||
path?: string | ||
} | ||
|
||
|
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