-
Notifications
You must be signed in to change notification settings - Fork 316
feat: mf-6735 integrate privy wallet support #12281
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
10 commits
Select commit
Hold shift + click to select a range
96ab7a5
feat(wallet): mf-6735 add privy wallet option and update wallet start…
swkatmask eae4a2f
feat(privy-wallet): mf-6735 integrate privy wallet with firefly auth …
swkatmask cc961a0
feat: mf-6735 integrate privy wallet support and x account login
swkatmask 7513245
feat(privy): mf-6735 integrate privy auth, providers and chain configs
swkatmask c52fd87
feat(shared): mf-6735 add privy setup provider to UI roots
swkatmask 6069054
fixup! feat(shared): mf-6735 add privy setup provider to UI roots
swkatmask 7206982
fix: follow up reviews
swkatmask 9f925f6
fix: revert to jsxCompose
swkatmask 2431603
fix: follow up reviews
swkatmask 5dcb390
fix: linter
swkatmask 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,3 +104,4 @@ | |
|
|
||
| ; FIREFLY_X_CLIENT_ID= | ||
| ; FIREFLY_X_CLIENT_SECRET= | ||
| ; PRIVY_APP_ID= | ||
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 |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ approvedList.set('string-width-cjs', 'npm:string-width@^4.2.0') | |
| approvedList.set('strip-ansi-cjs', 'npm:strip-ansi@^6.0.1') | ||
| approvedList.set('wrap-ansi-cjs', ['npm:wrap-ansi@^6.0.1', 'npm:wrap-ansi@^7.0.0']) | ||
|
|
||
| approvedList.set('cbw-sdk', ['npm:@coinbase/[email protected]']) | ||
| /** | ||
| * @param {string} parentPackage The current resolving parentPackage | ||
| * @param {string} dependedPackage The package it depends on | ||
|
|
||
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,34 @@ | ||
| import { PersistentStorages } from '@masknet/shared-base' | ||
|
|
||
| export async function loginFireflyViaTwitter() { | ||
| const data = await browser.storage.local.get('firefly_x_oauth') | ||
| if (!data?.firefly_x_oauth) throw new Error('X OAuth token not found') | ||
| const oauth: Record<string, string> = data.firefly_x_oauth | ||
|
|
||
| const res = await fetch('https://firefly.social/api/twitter/auth', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'X-Access-Token': oauth.oauth_token, | ||
| 'X-Access-Token-Secret': oauth.oauth_token_secret, | ||
| 'X-Client-Id': oauth.oauth_token.split('-')[0], | ||
| 'X-Consumer-Key': process.env.FIREFLY_X_CLIENT_ID, | ||
| 'X-Consumer-Secret': '[HIDE_FROM_CLIENT]', | ||
swkatmask marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }) | ||
| const json = await res.json() | ||
| if (!json.success) throw new Error(json.message) | ||
|
|
||
| const res2 = await fetch('https://api.firefly.land/v3/auth/exchange/twitter', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| }, | ||
| body: JSON.stringify({ | ||
| data: json.data, | ||
| }), | ||
| }) | ||
| const json2 = await res2.json() | ||
| await browser.storage.local.set({ firefly_account: json2.data }) | ||
| await PersistentStorages.Settings.storage.firefly_account.setValue(json2.data) | ||
| return json2.data | ||
| } | ||
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
8 changes: 4 additions & 4 deletions
8
packages/mask/content-script/components/InjectedComponents/PageInspector.tsx
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
8 changes: 4 additions & 4 deletions
8
packages/mask/content-script/site-adaptors/instagram.com/injection/NFT/ProfileNFTAvatar.tsx
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
18 changes: 9 additions & 9 deletions
18
packages/mask/content-script/utils/shadow-root/ContentScriptGlobalProvider.tsx
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
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.