Skip to content
Merged
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/kyc-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

- Added exported `KYC_STATUSES` and `TERMINAL_SESSION_STATUSES`, so consumers can reuse the KYC status vocabulary and the terminal session-status set (`approved`, `rejected`, `retry`) from the package entry point instead of redefining them locally ([#10771](https://github.com/MetaMask/core/pull/10771))

### Changed

- Bump `@metamask/profile-sync-controller` from `^34.0.2` to `^34.0.3` ([#10761](https://github.com/MetaMask/core/pull/10761))
Expand Down
16 changes: 16 additions & 0 deletions packages/kyc-controller/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,20 @@ describe('@metamask/kyc-controller', () => {
serviceName: 'KycService',
});
});

it('exports the KYC status constants', () => {
expect(packageExports.KYC_STATUSES).toStrictEqual({
approved: 'approved',
rejected: 'rejected',
retry: 'retry',
new: 'new',
pending: 'pending',
});
expect(packageExports.TERMINAL_SESSION_STATUSES).toBeInstanceOf(Set);
expect([...packageExports.TERMINAL_SESSION_STATUSES].sort()).toStrictEqual([
'approved',
'rejected',
'retry',
]);
});
});
1 change: 1 addition & 0 deletions packages/kyc-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export type {
X25519KeyPair,
} from './crypto.js';

export { KYC_STATUSES, TERMINAL_SESSION_STATUSES } from './types.js';
export type {
KycCatalogDocument,
KycConsentDocument,
Expand Down
6 changes: 3 additions & 3 deletions packages/kyc-controller/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export type KycSessionStatus = {
/** UKYC session id. */
id: string;
/**
* The overall status of the session. Terminal values (e.g. `approved`,
* `completed`, `rejected`, `failed`, `blocked`) are finished decisions; any
* other value (e.g. `pending`) means the vendor is still processing.
* The overall status of the session. Values in `TERMINAL_SESSION_STATUSES`
* (`approved`, `rejected`, `retry`) are finished decisions; any other value
* (e.g. `pending`) means the vendor is still processing.
*/
finalStatus: string;
/** Optional human-readable message describing the status. */
Expand Down
Loading