Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
feat: add accountNameSuggestion field to the AccountCreatedEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
danroc committed Apr 16, 2024
1 parent 66ce0f3 commit 94915fc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/internal/events.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { JsonStruct } from '@metamask/utils';
import { literal, object } from 'superstruct';
import { literal, object, string } from 'superstruct';

import { KeyringAccountStruct } from '../api';
import { KeyringEvent } from '../events';
import { exactOptional } from '../superstruct';
import { UuidStruct } from '../utils';

export const AccountCreatedEventStruct = object({
Expand All @@ -12,6 +13,15 @@ export const AccountCreatedEventStruct = object({
* New account object.
*/
account: KeyringAccountStruct,

/**
* Account name suggestion provided to the MetaMask client.
*
* The keyring can suggest a name for the account, but it's up to the
* client to decide whether to use it. The keyring won't be informed if the
* client decides to use a different name.
*/
accountNameSuggestion: exactOptional(string()),
}),
});

Expand Down

0 comments on commit 94915fc

Please sign in to comment.