Skip to content

Commit

Permalink
feat: add account name suggestion (#144)
Browse files Browse the repository at this point in the history
* chore: rebuilt snap and site

* feat: added '.idea/' to gitignore

* fix: lint

* fix: lint
  • Loading branch information
k-g-j authored Aug 12, 2024
1 parent 3971582 commit 6cc1857
Show file tree
Hide file tree
Showing 5 changed files with 251 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ node_modules/
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

# IntelliJ
.idea/
2 changes: 1 addition & 1 deletion packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@ethereumjs/tx": "^4.1.2",
"@ethereumjs/util": "^8.0.5",
"@metamask/eth-sig-util": "^7.0.1",
"@metamask/keyring-api": "^1.0.0-rc.1",
"@metamask/keyring-api": "^8.1.0",
"@metamask/snaps-types": "^3.0.0",
"@metamask/utils": "^8.1.0",
"uuid": "^9.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "git+https://github.com/MetaMask/snap-simple-keyring.git"
},
"source": {
"shasum": "kTIqxcFUYPRiaV7etXM0HpD+fSaJw/+ePbFgjXW3Btk=",
"shasum": "96JncouxgpYlO+pStmiLn2BYlVtphJ1zufxMmWswaIU=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
5 changes: 4 additions & 1 deletion packages/snap/src/keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export class SimpleKeyring implements Keyring {
],
type: EthAccountType.Eoa,
};
await this.#emitEvent(KeyringEvent.AccountCreated, { account });
await this.#emitEvent(KeyringEvent.AccountCreated, {
account,
accountNameSuggestion: 'SSK Account',
});
this.#state.wallets[account.id] = { account, privateKey };
await this.#saveState();
return account;
Expand Down
Loading

0 comments on commit 6cc1857

Please sign in to comment.