AuthenticatedUserStorageService Actions
16 actions registered.
AuthenticatedUserStorageService:clearUserAssets
Package: @metamask/authenticated-user-storage
Wipes the user's custom tokens, restoring a clean slate (empty lists).
Parameters:
| Name | Description |
|---|---|
clientType | Optional client type header. |
Handler signature:
(clientType?: ClientType) => Promise<void>
AuthenticatedUserStorageService:createDelegation
Package: @metamask/authenticated-user-storage
Stores a signed delegation record for the authenticated user.
Parameters:
| Name | Description |
|---|---|
submission | The signed delegation and its metadata. |
clientType | Optional client type header. |
Handler signature:
(submission: DelegationSubmission, clientType?: ClientType) => Promise<void>
AuthenticatedUserStorageService:getAssetsWatchlist
Package: @metamask/authenticated-user-storage
Returns the assets-watchlist for the authenticated user.
Returns: The assets-watchlist blob, or null if none has been set (404).
Handler signature:
() => Promise<AssetsWatchlistBlob | null>
AuthenticatedUserStorageService:getIdentitySharingConsent
Package: @metamask/authenticated-user-storage
Returns the identity-sharing consent for the authenticated user.
Returns: The granted-audience map, or null if none has been set (404).
Handler signature:
() => Promise<IdentitySharingConsent | null>
AuthenticatedUserStorageService:getMarketingConsent
Package: @metamask/authenticated-user-storage
Returns the marketing consent for the authenticated user.
Returns: The marketing consent object, or null if none has been set (404).
Handler signature:
() => Promise<MarketingConsent | null>
AuthenticatedUserStorageService:getNotificationPreferences
Package: @metamask/authenticated-user-storage
Returns the notification preferences for the authenticated user.
Returns: The notification preferences object, or null if none have been set (404).
Handler signature:
() => Promise<NotificationPreferences | null>
AuthenticatedUserStorageService:getUserAssets
Package: @metamask/authenticated-user-storage
Returns the user-assets (custom tokens) blob for the authenticated user.
Returns: The user-assets blob, or null if none has been set (404).
Handler signature:
() => Promise<UserAssetsBlob | null>
AuthenticatedUserStorageService:hideTokens
Package: @metamask/authenticated-user-storage
Hides custom tokens: adds the given identifiers to hiddenAssets
(de-duplicated, order preserved) and removes them from
importedAssets. Creates a fresh blob if none exists yet.
Parameters:
| Name | Description |
|---|---|
ids | The CAIP-19 asset identifiers of the tokens to hide. |
clientType | Optional client type header. |
Returns: The resolved user-assets blob that was persisted.
Handler signature:
(ids: string[], clientType?: ClientType) => Promise<UserAssetsBlob>
AuthenticatedUserStorageService:importTokens
Package: @metamask/authenticated-user-storage
Imports custom tokens: adds the given identifiers to importedAssets
(de-duplicated, order preserved) and removes them from hiddenAssets.
Creates a fresh blob if none exists yet.
Parameters:
| Name | Description |
|---|---|
ids | The CAIP-19 asset identifiers of the tokens to import. |
clientType | Optional client type header. |
Returns: The resolved user-assets blob that was persisted.
Handler signature:
(ids: string[], clientType?: ClientType) => Promise<UserAssetsBlob>
AuthenticatedUserStorageService:listDelegations
Package: @metamask/authenticated-user-storage
Returns all delegation records belonging to the authenticated user.
Returns: An array of delegation records, or an empty array if none exist.
Handler signature:
() => Promise<DelegationResponse[]>
AuthenticatedUserStorageService:putIdentitySharingConsent
Package: @metamask/authenticated-user-storage
Grants or revokes identity-sharing consent for a single audience. Other audiences on the profile are left unchanged.
Parameters:
| Name | Description |
|---|---|
write | The audience and whether it is granted. |
clientType | Optional client type header. |
Handler signature:
(write: IdentitySharingConsentWrite, clientType?: ClientType) => Promise<void>
AuthenticatedUserStorageService:putMarketingConsent
Package: @metamask/authenticated-user-storage
Creates or updates the marketing consent for the authenticated user.
Parameters:
| Name | Description |
|---|---|
consent | The full marketing consent object. |
clientType | Optional client type header. |
Handler signature:
(consent: MarketingConsent, clientType?: ClientType) => Promise<void>
AuthenticatedUserStorageService:putNotificationPreferences
Package: @metamask/authenticated-user-storage
Creates or updates the notification preferences for the authenticated user.
Parameters:
| Name | Description |
|---|---|
prefs | The full notification preferences object. |
clientType | Optional client type header. |
Handler signature:
(prefs: NotificationPreferences, clientType?: ClientType) => Promise<void>
AuthenticatedUserStorageService:revokeDelegation
Package: @metamask/authenticated-user-storage
Revokes (deletes) a delegation record.
Parameters:
| Name | Description |
|---|---|
delegationHash | The unique hash identifying the delegation. |
Handler signature:
(delegationHash: string) => Promise<void>
AuthenticatedUserStorageService:setAssetsWatchlist
Package: @metamask/authenticated-user-storage
Creates or updates the assets-watchlist for the authenticated user.
Parameters:
| Name | Description |
|---|---|
blob | The full assets-watchlist blob. The assets array may contain at most ASSETS_WATCHLIST_MAX_ASSETS CAIP-19 asset identifiers; this is enforced by assertAssetsWatchlistBlobForWrite before the request is sent. |
clientType | Optional client type header. |
Handler signature:
(blob: AssetsWatchlistBlob, clientType?: ClientType) => Promise<void>
AuthenticatedUserStorageService:setUserAssets
Package: @metamask/authenticated-user-storage
Creates or updates the user-assets (custom tokens) blob for the
authenticated user. The blob is normalized (de-duplicated, conflicts
resolved fail-open in favor of importedAssets) before it is sent.
Parameters:
| Name | Description |
|---|---|
blob | The full user-assets blob, with CAIP-19 asset identifiers. |
clientType | Optional client type header. |
Handler signature:
(blob: UserAssetsBlob, clientType?: ClientType) => Promise<void>