From 94915fc28675bf653777530b7fbbb1b51d776219 Mon Sep 17 00:00:00 2001 From: Daniel Rocha <68558152+danroc@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:44:45 +0200 Subject: [PATCH] feat: add `accountNameSuggestion` field to the `AccountCreatedEvent` --- src/internal/events.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/internal/events.ts b/src/internal/events.ts index 87fb764f1..e8fb7a8e9 100644 --- a/src/internal/events.ts +++ b/src/internal/events.ts @@ -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({ @@ -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()), }), });