Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Wallet Explorer"; support NEP-6 wallets; support mainnet/testnet transfer/claim #40

Merged
merged 25 commits into from
Jan 8, 2020

Conversation

djnicholson
Copy link
Member

@djnicholson djnicholson commented Dec 23, 2019

This PR adds a "Wallet explorer" to vscode that will display any NEP-6 format wallets found in the active workspace (it also allows you to create a new NEP-6 wallet file and add accounts to it).

The "Transfer" and "Claim" dialog have been updated to allow you to do transfers/claims using discovered NEP-6 wallets (as well as using private keys from neo-express config files). The transfer and claim dialogs can now also be used on mainnet/testnet (not just on neo-express blockchains).

Fixes #34

src/walletExplorer.ts Outdated Show resolved Hide resolved
}
}

export class WalletExplorer implements vscode.TreeDataProvider<WalletTreeItemIdentifier> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure a tree view is the best UI metaphor here, though honestly I can't think of something else. Maybe we should just be adding a "create account" item to teh main file explorer tree view if we detect that a given json file is a NEP-6 wallet + just have a "create wallet file" command w/o an explorer UI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding context menu items to the file explorer I only get the choice of matching based on the filename--I'd have to have the "Create account" option show up for all .json files not just NEP-6 wallets. I think that would be confusing.

I'd like to do something like the "Add configuration..." button you see in the editor whenever you edit a launch.json file. I can't find a way to do it though, I think the floating button in launch.json editors may be a special case built-in to vscode and not an actual extensibility point. The closest I have managed to achieve is using a "Code Lens" to add a "Create account" link to the top of the editor window whenever you edit a NEP-6 wallet.

Copy link
Contributor

@devhawk devhawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my comment in the walletExplorer.ts file, it feels like we don't need an explorer tree view to list all the wallets. But I'm interested in your thoughts on this @djnicholson

@devhawk devhawk assigned djnicholson and unassigned devhawk Jan 6, 2020
djnicholson and others added 3 commits January 6, 2020 17:48
- new wallet files can be created via wallet selection dropdowns
- new accounts can be created by a codelens links
@djnicholson djnicholson assigned devhawk and unassigned djnicholson Jan 6, 2020
@djnicholson
Copy link
Member Author

As per my comment in the walletExplorer.ts file, it feels like we don't need an explorer tree view to list all the wallets. But I'm interested in your thoughts on this @djnicholson

I got rid of the tree view in the latest push. Creating a new wallet file can be done from the wallet dropdowns in the transfer/claim dialogs. Adding an account to a wallet can be done by clicking a CodeLens link whenever you have a NEP-6 file loaded in the editor.

@devhawk
Copy link
Contributor

devhawk commented Jan 8, 2020

Adding an account to a wallet can be done by clicking a CodeLens link whenever you have a NEP-6 file loaded in the editor.

It's a little undiscoverable, but I like this. We probably need a docs pass as part of the next release

@djnicholson
Copy link
Member Author

Adding an account to a wallet can be done by clicking a CodeLens link whenever you have a NEP-6 file loaded in the editor.

It's a little undiscoverable, but I like this. We probably need a docs pass as part of the next release

I'll also find an appropriate vscode forum or Github to ask whether it is possible for me to do something like the "Add configuration" button in the launch.json editor. This approach is probably sufficient in the meantime though.

@devhawk
Copy link
Contributor

devhawk commented Jan 8, 2020

Creating a new wallet file can be done from the wallet dropdowns in the transfer/claim dialogs.

For docs, we should probably suggest using the command palette

{
"command": "neo-visual-devtracker.createWalletFile",
"title": "Create new NEP-6 wallet file",
"category": "Neo Express"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create NEP-6 wallet + account commands shouldn't be in the Neo Express category.

We probably need to review all of the command categories for things that are specific to neo-express vs. things that are not, but I'm fine doing that as a seperate PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#50

Copy link
Contributor

@devhawk devhawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than the categories issue, this looks good to go to me. I'm thinking we should go ahead and merge this and open a new issue to track category review across the entire extension.

@devhawk devhawk assigned djnicholson and unassigned devhawk Jan 8, 2020
@djnicholson
Copy link
Member Author

I'll also find an appropriate vscode forum or Github to ask whether it is possible for me to do something like the "Add configuration" button in the launch.json editor. This approach is probably sufficient in the meantime though.

#49

@djnicholson djnicholson merged commit b6ae915 into master Jan 8, 2020
@djnicholson djnicholson deleted the wallets branch January 8, 2020 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support NEP-6 wallets for claim/transfer/deploy/invoke
2 participants