Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/delegation-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Export `DelegationControllerGetStateAction` type ([#8205](https://github.com/MetaMask/core/pull/8205))

## [2.0.2]

### Changed
Expand Down
2 changes: 2 additions & 0 deletions packages/delegation-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/delegation-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/delegation-controller",
"generate-method-action-types": "tsx ../../scripts/generate-method-action-types.ts",
"since-latest-release": "../../scripts/since-latest-release.sh",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
Expand All @@ -60,6 +61,7 @@
"deepmerge": "^4.2.2",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"tsx": "^4.20.5",
"typedoc": "^0.25.13",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* This file is auto generated by `scripts/generate-method-action-types.ts`.
* Do not edit manually.
*/

import type { DelegationController } from './DelegationController';

/**
* Signs a delegation.
*
* @param params - The parameters for signing the delegation.
* @param params.delegation - The delegation to sign.
* @param params.chainId - The chainId of the chain to sign the delegation for.
* @returns The signature of the delegation.
*/
export type DelegationControllerSignDelegationAction = {
type: `DelegationController:signDelegation`;
handler: DelegationController['signDelegation'];
};

/**
* Stores a delegation in storage.
*
* @param params - The parameters for storing the delegation.
* @param params.entry - The delegation entry to store.
*/
export type DelegationControllerStoreAction = {
type: `DelegationController:store`;
handler: DelegationController['store'];
};

/**
* Lists delegation entries.
*
* @param filter - The filter to use to list the delegation entries.
* @returns A list of delegation entries that match the filter.
*/
export type DelegationControllerListAction = {
type: `DelegationController:list`;
handler: DelegationController['list'];
};

/**
* Retrieves the delegation entry for a given delegation hash.
*
* @param hash - The hash of the delegation to retrieve.
* @returns The delegation entry, or null if not found.
*/
export type DelegationControllerRetrieveAction = {
type: `DelegationController:retrieve`;
handler: DelegationController['retrieve'];
};

/**
* Retrieves a delegation chain from a delegation hash.
*
* @param hash - The hash of the delegation to retrieve.
* @returns The delegation chain, or null if not found.
*/
export type DelegationControllerChainAction = {
type: `DelegationController:chain`;
handler: DelegationController['chain'];
};

/**
* Deletes a delegation entrie from storage, along with any other entries
* that are redelegated from it.
*
* @param hash - The hash of the delegation to delete.
* @returns The number of entries deleted.
*/
export type DelegationControllerDeleteAction = {
type: `DelegationController:delete`;
handler: DelegationController['delete'];
};

/**
* Union of all DelegationController action types.
*/
export type DelegationControllerMethodActions =
| DelegationControllerSignDelegationAction
| DelegationControllerStoreAction
| DelegationControllerListAction
| DelegationControllerRetrieveAction
| DelegationControllerChainAction
| DelegationControllerDeleteAction;
Loading
Loading