-
-
Notifications
You must be signed in to change notification settings - Fork 13
feat!: remove KeyringVersion + simplify KeyringRequestWithoutOrigin logic
#423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
780d2bd
feat: add KeyringInternalFeature{,s} support
ccharly e83cacc
chore: remove use of TODO
ccharly f90b123
fix: fix build
ccharly 113fa5b
refactor: simplify + lint
ccharly ca83954
chore: lint
ccharly 4910212
chore: fix changelog
ccharly 63d35c7
refactor: v1 -> legacy
ccharly 4a3c134
fix: rename to legacy
ccharly 7d66140
chore: fix comment
ccharly 2cf5748
chore: lint
ccharly 713d8c3
chore: fix changelog
ccharly 99d78b0
refactor: simplify platform version
ccharly ccef78d
chore: update changelog
ccharly 19d8228
refactor: rename LegacyKeyringRequest to KeyringRequestWithoutOrigin
ccharly 9387e31
chore: update changelog
ccharly 5529979
chore: cosmetic
ccharly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export * from './v1'; | ||
| export * from './keyring-request'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/keyring-internal-api/src/compatibility/keyring-request.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import type { KeyringRequest } from '@metamask/keyring-api'; | ||
| import { | ||
| KeyringRequestStruct, | ||
| KeyringResponseStruct, | ||
| } from '@metamask/keyring-api'; | ||
| import { omit, type Infer } from '@metamask/superstruct'; | ||
|
|
||
| /** | ||
| * Keyring request without `origin` support. | ||
| */ | ||
| export const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [ | ||
| 'origin', | ||
| ]); | ||
|
|
||
| export type KeyringRequestWithoutOrigin = Infer< | ||
| typeof KeyringRequestWithoutOriginStruct | ||
| >; | ||
|
|
||
| /** | ||
| * Response to a call to `submitRequest` (v1). | ||
| */ | ||
| export const KeyringResponseWithoutOriginStruct = KeyringResponseStruct; | ||
|
|
||
| export type KeyringResponseWithoutOrigin = Infer< | ||
| typeof KeyringResponseWithoutOriginStruct | ||
| >; | ||
|
|
||
| export const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct; | ||
|
|
||
| /** | ||
| * Converts a keyring request to a keyring request v1. | ||
| * | ||
| * @param request - A keyring request. | ||
| * @returns A keyring request v1. | ||
| */ | ||
| export function toKeyringRequestWithoutOrigin( | ||
| request: KeyringRequest, | ||
| ): KeyringRequestWithoutOrigin { | ||
| const { origin, ...requestV1 } = request; | ||
|
|
||
| return requestV1; | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| export * from './compatibility'; | ||
| export type * from './eth'; | ||
| export * from './types'; | ||
| export * from './versions'; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import type { SemVerVersion } from '@metamask/utils'; | ||
|
|
||
| /** Introduction of `KeyringRequest.origin`. */ | ||
| export const PLATFORM_VERSION_FOR_KEYRING_REQUEST_WITH_ORIGIN: SemVerVersion = | ||
| '7.0.0' as SemVerVersion; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.