-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Temp/notification integration sdk fixes #10116
Closed
Prithpal-Sooriya
wants to merge
36
commits into
feat/notifications-integration-sdk
from
temp/notification-integration-sdk-fixes
Closed
Changes from 3 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
c299cd2
feat: adding search to the network bottomsheet as part of the network…
EtherWizard33 dfab04b
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat/…
Prithpal-Sooriya 671392a
fix: fix engine configuration and snapshot test
Prithpal-Sooriya f213a60
refactor: fix types, mocks, and tests
Prithpal-Sooriya f39a72e
chore: minor adjustment on toggle
Jonathansoufer a30cb5c
chore: refactor selectors
Jonathansoufer 5c7f6b4
refactor: add types and fix tests
Prithpal-Sooriya 87f944e
refactor: add types and account switch logic
Prithpal-Sooriya 66ce66a
refactor: fix and add util unit tests
Prithpal-Sooriya 2ddf806
chore: Refactor Snaps integration (#10063)
FrederikBolding 4df2a97
chore: update attribution (#10070)
NicolasMassart db54ae8
fix: fix stuck after `nonce too low` error (#10049)
OGPoyraz fb78c8a
fix: Always mark the STX Opt In modal as seen (#10064)
dan437 2310745
fix: Swap with unapproved token (#10088)
tommasini ba67fb7
fix: stx on ramps missing origin (#10099)
infiniteflower 7a453b9
feat: Add team label to pr (#10086)
itsyoboieltr bc2bd59
feat: adjusting the 'add network screen' in network bottom sheet, for…
EtherWizard33 443c2f3
test: add E2E for increase allowance (#9969)
vinistevam 319d84e
feat: support security alerts API (#10000)
matthewwalsh0 f3dfa35
chore: Add Notification devs to codeowners file (#9811)
Jonathansoufer 57cc4d1
feat: add i18n to for the add/edit network ui re-design (#10120)
EtherWizard33 9277594
feat: 7.24.4 (#10094)
github-actions[bot] 6abaa20
feat: add api spec test infrastructure (#9356)
tmashuang 6ac4e06
feat: Add the "is_smart_transaction" prop for the "Swap Started" even…
dan437 7f8d152
fix: create nft auto detection modal and remove nft polling logic (#9…
sahar-fehri 633039f
fix: updated changelog for 7.24.4 (#10122)
sethkfman 18cd1d5
chore: Update create-cherry-pick-pr.sh to auto add label (#10125)
chrisleewilcox 9f901e9
refactor: update bitrise e2e check to not run on forks (#10128)
NicholasEllul a6100d6
test: disable privacy policy toast and whats new modal using fixtures…
cortisiko d11e297
chore: fix the incorrect URL displayed during transaction confirmatio…
omridan159 41bf7bb
feat: enables snaps feature flag on mobile (#10121)
Jonathansoufer 5b324ae
fix: Fix BaseControllerV1 state rehydration (#10133)
Gudahtt e1fa847
feat: Integrate Firebase libraries and initial config to enable Push …
Jonathansoufer f3cf1c3
fix: fix engine configuration and snapshot test
Prithpal-Sooriya 39669f1
refactor: add types and fix tests
Prithpal-Sooriya 81f1897
refactor: add types and account switch logic
Prithpal-Sooriya 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 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 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 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 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 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 |
---|---|---|
|
@@ -1003,6 +1003,34 @@ class Engine { | |
], | ||
}); | ||
|
||
const snapController = new SnapController({ | ||
environmentEndowmentPermissions: Object.values(EndowmentPermissions), | ||
featureFlags: { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
requireAllowlist, | ||
}, | ||
state: initialState.SnapController || undefined, | ||
// TODO: Replace "any" with type | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
messenger: snapControllerMessenger as any, | ||
detectSnapLocation: ( | ||
location: string | URL, | ||
options?: DetectSnapLocationOptions, | ||
) => | ||
detectSnapLocation(location, { | ||
...options, | ||
allowLocal: allowLocalSnaps, | ||
fetch: fetchFunction, | ||
}), | ||
//@ts-expect-error types need to be aligned with snaps-controllers | ||
preinstalledSnaps: PREINSTALLED_SNAPS, | ||
//@ts-expect-error types need to be aligned between new encryptor and snaps-controllers | ||
encryptor, | ||
getMnemonic: getPrimaryKeyringMnemonic.bind(this), | ||
}); | ||
///: END:ONLY_INCLUDE_IF | ||
|
||
const authenticationController = new AuthenticationController.Controller({ | ||
state: initialState.AuthenticationController, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
|
@@ -1056,36 +1084,16 @@ class Engine { | |
allowedEvents: ['KeyringController:stateChange'], | ||
}), | ||
state: initialState.NotificationServicesController, | ||
env: { | ||
isPushIntegrated: false, // temporary until we integrate push notifications | ||
featureAnnouncements: { | ||
platform: 'mobile', | ||
accessToken: 'TODO from env', | ||
spaceId: 'TODO from env', | ||
}, | ||
}, | ||
Comment on lines
+1094
to
+1101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New fields in controller. |
||
}); | ||
|
||
const snapController = new SnapController({ | ||
environmentEndowmentPermissions: Object.values(EndowmentPermissions), | ||
featureFlags: { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
requireAllowlist, | ||
}, | ||
state: initialState.SnapController || undefined, | ||
// TODO: Replace "any" with type | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
messenger: snapControllerMessenger as any, | ||
detectSnapLocation: ( | ||
location: string | URL, | ||
options?: DetectSnapLocationOptions, | ||
) => | ||
detectSnapLocation(location, { | ||
...options, | ||
allowLocal: allowLocalSnaps, | ||
fetch: fetchFunction, | ||
}), | ||
//@ts-expect-error types need to be aligned with snaps-controllers | ||
preinstalledSnaps: PREINSTALLED_SNAPS, | ||
//@ts-expect-error types need to be aligned between new encryptor and snaps-controllers | ||
encryptor, | ||
getMnemonic: getPrimaryKeyringMnemonic.bind(this), | ||
}); | ||
///: END:ONLY_INCLUDE_IF | ||
|
||
this.transactionController = new TransactionController({ | ||
// @ts-expect-error at this point in time the provider will be defined by the `networkController.initializeProvider` | ||
blockTracker: networkController.getProviderAndBlockTracker().blockTracker, | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional - just moved this up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE - we need to discuss how we will ship notifications when snaps are not in main.
We reply on the snap controller (and potentially other snap functionality) to call our pre-installed snap. So we kinda need snaps to be enabled (at least from the background perspective, we can still hide in UI)