Skip to content
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

feat: Migrate eth_accounts and permittedChains to CAIP-25 endowment #27847

Open
wants to merge 255 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
7e61aa7
lint
jiexi Oct 14, 2024
590a206
bring migration
jiexi Oct 14, 2024
b507802
patch json-schema modules
jiexi Oct 14, 2024
bb96bc3
Bring in migration fixes from #27849
jiexi Oct 15, 2024
2bcbf1b
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 15, 2024
d2dd1a3
bring in new preview build
jiexi Oct 15, 2024
1ceeecf
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 15, 2024
859f60b
convert wallet_revokePermissions to ts
jiexi Oct 15, 2024
419572f
convert wallet_getPermissions to ts
jiexi Oct 15, 2024
81027d0
Update LavaMoat policies
metamaskbot Oct 15, 2024
48388a2
convert wallet_requestPermissions to ts
jiexi Oct 15, 2024
c8d1c71
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 15, 2024
3264c17
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 15, 2024
06663e9
yarn dedupe
jiexi Oct 15, 2024
1cbbc28
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 15, 2024
273c523
update ui/components/multichain/pages/permissions-page/permissions-pa…
jiexi Oct 15, 2024
3d83a85
improve errors + caveate mutator logic
adonesky1 Oct 15, 2024
92c2cf3
more error improvements
adonesky1 Oct 15, 2024
d093b0c
bring in new preview build
jiexi Oct 15, 2024
89244c4
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 15, 2024
f766c32
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 15, 2024
150221d
Update LavaMoat policies
metamaskbot Oct 15, 2024
c7d40d3
bring in new preview build
jiexi Oct 15, 2024
a3f5c69
more error improvements
adonesky1 Oct 15, 2024
522aeb7
use controller-utils preview build too
jiexi Oct 15, 2024
ec2d38b
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 15, 2024
0670559
use controller-utils preview build resolution
jiexi Oct 15, 2024
1f24a41
Update LavaMoat policies
metamaskbot Oct 15, 2024
5d1d8c6
Fix specs. Lint
jiexi Oct 15, 2024
1bd35a6
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 15, 2024
c242aa5
lint
jiexi Oct 15, 2024
bc2ef3e
Bring in ethereum-chain-utils.test.js. Whoops lol
jiexi Oct 15, 2024
b7b90b5
Bring in request-accounts.test.js. Whoops lol
jiexi Oct 15, 2024
427ac98
Bring in eth-accounts.test.js
jiexi Oct 15, 2024
6cd118d
add request-accounts.test.ts. convert requestAccounts js to ts
jiexi Oct 15, 2024
6552101
convert eth-accounts to ts
jiexi Oct 15, 2024
21293c3
Make requestPermissions test mock more accurate
jiexi Oct 15, 2024
8c4a4d1
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 15, 2024
669fa71
convert ethereum-chain-utils.test.js to ts
jiexi Oct 16, 2024
dba9ae5
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
c39fc0d
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
bbffb07
fix duplicated imports
jiexi Oct 16, 2024
2b80d23
revert isAccountSyncingEnabled
jiexi Oct 16, 2024
db866f0
DRY requestAccountsPermissionWithId into requestAccountsAndChainPermi…
jiexi Oct 16, 2024
8c8d5ed
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
b40c72e
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
aa5067f
Remove TODO about verifying switchChain permissioning flow
jiexi Oct 16, 2024
902bd5a
Remove selectors intended for multichain API
jiexi Oct 16, 2024
aa36957
lint request-accounts.test.ts
jiexi Oct 16, 2024
4363f12
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
865f09c
fix switch chain permission confirmation
adonesky1 Oct 16, 2024
a2c1c61
update preview builds
adonesky1 Oct 16, 2024
86a6a41
fix yarn.lock
adonesky1 Oct 16, 2024
7c14f68
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
e7a351c
Add revoke permitted-chains e2e test
jiexi Oct 16, 2024
c96672d
Jl/caip25 permission migration/bump permissions controller fix UI spe…
jiexi Oct 16, 2024
c63d8d2
Update LavaMoat policies
metamaskbot Oct 16, 2024
5147e8b
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-revokePe…
jiexi Oct 16, 2024
b768c8c
fix background dapp viewed event
jiexi Oct 16, 2024
8c4faed
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 16, 2024
6828cd2
Update fixture-builder to set correct default scopes
jiexi Oct 16, 2024
d83629b
fix background-api spec
jiexi Oct 16, 2024
46d7c0d
fix ethereum-chain-utils.test.ts
jiexi Oct 16, 2024
8d59135
fix ethereum-chain-utils.test.ts 2
jiexi Oct 16, 2024
a019845
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
08b9f2b
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
1923910
reset lavamoat back to develop
jiexi Oct 17, 2024
8ba031c
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
bf856b8
Update LavaMoat policies
metamaskbot Oct 17, 2024
7212a37
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
fe584ed
fix fixture-builder restrictReturnedAccounts???
jiexi Oct 17, 2024
2497a19
Remove restrictedReturnedAccounts in fixtures. Fix snap-account-signa…
jiexi Oct 17, 2024
3e583a4
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
b780d89
temporarily skip test-snap-revoke-perm.spec.js
jiexi Oct 17, 2024
06e7ef9
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
609d50f
dedupe
adonesky1 Oct 17, 2024
8015644
Update LavaMoat policies
metamaskbot Oct 17, 2024
4ae7377
bring in preview build from new core pr
jiexi Oct 17, 2024
9d3d250
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 17, 2024
16d8be4
lavamoat
jiexi Oct 17, 2024
2735fa5
Update LavaMoat policies
metamaskbot Oct 17, 2024
ac774da
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
91255c4
bring in new preview build for listAccounts() in permission validator
jiexi Oct 17, 2024
7502f0a
Merge remote-tracking branch 'origin' into caip25-permission-migration
adonesky1 Oct 18, 2024
773a744
Update LavaMoat policies
metamaskbot Oct 18, 2024
ea84c0e
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 18, 2024
5262186
fix switch-custom-network test failure
adonesky1 Oct 18, 2024
832e61e
update json-rpc-engine type import
adonesky1 Oct 18, 2024
20ff891
fix other json-rpc-engine imports
adonesky1 Oct 18, 2024
f5df08d
add fixtures to fix test
adonesky1 Oct 18, 2024
e2d8305
fix: add snap dummy descriptions copied from ethereum provider and ge…
shanejonas Oct 18, 2024
af25cf0
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 18, 2024
2d53a55
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 21, 2024
ac192fc
lavamoat
jiexi Oct 21, 2024
47e6494
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 21, 2024
d151b63
Update LavaMoat policies
metamaskbot Oct 21, 2024
599a73d
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 21, 2024
9b023f0
Caip25/fix snaps signature disconnect (#27998)
jiexi Oct 21, 2024
b1156e6
lint
jiexi Oct 21, 2024
879b30e
Fix flask/user-operations.spec.ts
jiexi Oct 21, 2024
25bfb4f
Remove html-report-multichain/
jiexi Oct 21, 2024
4eaad52
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
540b4c5
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
155293d
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
77c7a66
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
ec037c5
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
e10b65f
Jl/caip25 permission migration/metamask controller test (#28012)
jiexi Oct 22, 2024
9d9c3f4
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
7f70c0b
yarn lock
jiexi Oct 22, 2024
a757cbf
bring in new preview build with 100% coverage
jiexi Oct 23, 2024
5dfa1e8
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 23, 2024
a1d4e40
Update LavaMoat policies
metamaskbot Oct 23, 2024
87109ea
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 30, 2024
6b3dda9
Update LavaMoat policies
metamaskbot Oct 30, 2024
7f1ea33
use addPermittedChain instead of grant. delete grantPermittedChain(s)
jiexi Oct 30, 2024
52f5f59
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 30, 2024
e8cb9b3
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
48381e0
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
b7198c1
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
c84d9e6
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
f75a49f
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
993e6fc
CAIP-25 Permission Migration Refactor (#28574)
jiexi Nov 21, 2024
d3ed412
Merge branch 'develop' into caip25-permission-migration
adonesky1 Nov 21, 2024
87ce7e4
use `@metamask/multichain@^1.0.0`!!!
jiexi Nov 21, 2024
6b6c668
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Nov 21, 2024
ce5f57b
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
fcffac4
Update LavaMoat policies
metamaskbot Nov 21, 2024
7435114
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
13d0390
yarn dedupe
jiexi Nov 21, 2024
5a5242b
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
ea8a594
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 22, 2024
5b8a8a2
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 22, 2024
9651ad4
Update LavaMoat policies
metamaskbot Nov 22, 2024
151e381
Merge branch 'develop' into caip25-permission-migration
adonesky1 Nov 25, 2024
618d70d
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 25, 2024
b4346f4
Fix edit accounts and networks modal default rerendering
jiexi Nov 25, 2024
d55c5ea
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 25, 2024
e607539
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
0fead5c
move sessionChanged notif constant to Multichain PR
jiexi Nov 26, 2024
d6a3a40
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
5a770c4
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
bf99973
dispatch addPermittedChain in network-list-menu
jiexi Nov 26, 2024
d96d85d
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
d2fd282
Jl/caip25 permission migration/update mutators (#28709)
jiexi Nov 26, 2024
042b2f5
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
9e156ef
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
6fa667b
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 27, 2024
514ceb5
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 27, 2024
9bddebd
Merge branch 'main' into caip25-permission-migration
jiexi Dec 2, 2024
5e77989
Merge branch 'main' into caip25-permission-migration
jiexi Dec 3, 2024
b08f4e6
revert removeNetwork half fix
jiexi Dec 4, 2024
337a6a0
replace snaps eth_accounts references (#28937)
jiexi Dec 4, 2024
e8c2a1a
Jl/caip25 permission migration/fix locked wallet behavior (#28855)
jiexi Dec 4, 2024
7f529d1
Merge branch 'main' into caip25-permission-migration
jiexi Dec 4, 2024
b26fa78
Merge branch 'main' into caip25-permission-migration
jiexi Dec 5, 2024
7869d3b
yarn dedupe
jiexi Dec 5, 2024
827de7c
Merge branch 'main' into caip25-permission-migration
jiexi Dec 5, 2024
ad34375
Merge branch 'main' into caip25-permission-migration
jiexi Dec 6, 2024
5e67909
Update app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum…
jiexi Dec 6, 2024
1e759cf
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-revokePe…
jiexi Dec 6, 2024
d089099
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-getPermi…
jiexi Dec 6, 2024
7f6c67f
Add '| undefined' to caveat.find() return type coercions
jiexi Dec 6, 2024
5e92074
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 6, 2024
b7205e4
Update app/scripts/lib/rpc-method-middleware/handlers/ethereum-chain-…
jiexi Dec 6, 2024
4b37d18
Update app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum…
jiexi Dec 6, 2024
bc07690
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-requestP…
jiexi Dec 6, 2024
58e100e
address request-accounts.test.ts comments
jiexi Dec 6, 2024
96c5ed4
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 6, 2024
3e34097
fully mock ethereum-chain-utils in add/switchEthreumChain handlers
jiexi Dec 7, 2024
baeeb1e
Copy validateAdd/SwitchEthereumChainParams specs to ethereum-chain-ut…
jiexi Dec 9, 2024
0f08ab4
Lint
jiexi Dec 9, 2024
62e4a35
Merge branch 'main' into caip25-permission-migration
jiexi Dec 9, 2024
f7a09fd
Make wallet_requestPermissions test origin explicit
jiexi Dec 9, 2024
ed503e4
make getBaseRequest take overrides in wallet-requestPermissions.test.ts
jiexi Dec 9, 2024
ac48b67
catch PermissionDoesNotExistError in getCaveat calls
jiexi Dec 9, 2024
fb118fe
update addMoreChains getEthAccounts comment
jiexi Dec 9, 2024
3442d7d
make otherPermission explicit in wallet-revokePermissions.test.ts
jiexi Dec 9, 2024
6903494
Merge branch 'main' into caip25-permission-migration
jiexi Dec 9, 2024
c69eda3
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-requestP…
jiexi Dec 9, 2024
892af78
nest scenario in describe add-ethereum-chain.test.js
jiexi Dec 9, 2024
2ec971d
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 9, 2024
4cb71a0
Merge branch 'main' into caip25-permission-migration
jiexi Dec 9, 2024
200a778
cleanup add-ethereum-chain.test.ts
jiexi Dec 9, 2024
16987cd
add jsdoc to switchChain
jiexi Dec 9, 2024
fca9657
cleanup getAccounts in wallet-getPermissions.test.ts
jiexi Dec 9, 2024
63b99eb
Fix switchChain approvalFlowId type
jiexi Dec 9, 2024
bf33584
fix 'requests a switch chain approval' scenario
jiexi Dec 9, 2024
91df27d
make wallet-getPermissions.test.ts clearer
jiexi Dec 9, 2024
0161067
lint
jiexi Dec 9, 2024
d160ce1
Update LavaMoat policies
metamaskbot Dec 9, 2024
797273c
lint
jiexi Dec 9, 2024
d4c8df2
move requestAccountsAndChainPermissionsWithId logic into separate asy…
jiexi Dec 9, 2024
b532861
remove addMoreChains comment
jiexi Dec 10, 2024
ee043eb
add comment about addAndShowApprovalRequest usage in background-api
jiexi Dec 10, 2024
bccd7d5
Merge branch 'main' into caip25-permission-migration
jiexi Dec 10, 2024
0ffeec2
bump @metamask/multichain to ^1.1.2
jiexi Dec 10, 2024
06c9a70
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
88dd6be
Update app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js
jiexi Dec 11, 2024
8d8036f
remove getRemovedAuthorizations
jiexi Dec 11, 2024
57f3fe9
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
17454e6
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 11, 2024
61e886c
mvoe endowment:caip25 into ExcludedSnapEndowments
jiexi Dec 11, 2024
6817121
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
c9b023b
update getPermissionSpecifications jsdoc
jiexi Dec 11, 2024
a6f424b
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
8a4bd74
Merge branch 'main' into caip25-permission-migration
jiexi Dec 12, 2024
8d276ce
Merge branch 'main' into caip25-permission-migration
jiexi Dec 12, 2024
6477802
refactor: Robustify migration 135 (#29168)
rekmarks Dec 12, 2024
2a755cb
Merge branch 'main' into caip25-permission-migration
jiexi Dec 12, 2024
d7ce25e
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 12, 2024
cd66487
lint
jiexi Dec 12, 2024
7af8dbb
Jl/caip25 permission migration/bind origin to method hooks (#29174)
jiexi Dec 12, 2024
f83d418
Update app/scripts/migrations/135.ts
jiexi Dec 13, 2024
5dad0aa
Merge branch 'main' into caip25-permission-migration
jiexi Dec 13, 2024
e274301
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 13, 2024
a86e802
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
ad3eb1b
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
18af503
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
d000725
feat: Move CAIP-25 permission validation logic into caveat validator …
jiexi Dec 16, 2024
ff3b272
Jl/caip25 permission migration/move request grant hooks into mmc (#29…
jiexi Dec 17, 2024
9dd6ee2
Update app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js
jiexi Dec 17, 2024
40c3e7e
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
a82ae4c
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 17, 2024
9215ba4
move comment block to right before requestEthereumAccountsHandler
jiexi Dec 17, 2024
d28618b
add jsdoc to requestEthereumAccountsHandler
jiexi Dec 17, 2024
a587ed7
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
aec2470
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
cf7c328
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
0c97ce9
fix testDapp.connectAccount usage
jiexi Dec 17, 2024
5d22667
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
f2f0dbd
Merge branch 'main' into caip25-permission-migration
jiexi Dec 18, 2024
60d02c9
Update LavaMoat policies
metamaskbot Dec 18, 2024
2657bfe
fix validateChainId guard
jiexi Dec 18, 2024
88b1bd1
Merge branch 'main' into caip25-permission-migration
jiexi Dec 18, 2024
059ecad
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 18, 2024
cb4126d
Merge branch 'main' into caip25-permission-migration
jiexi Dec 19, 2024
85d0e94
Merge branch 'main' into caip25-permission-migration
jiexi Dec 19, 2024
2c40696
convert getDescriptionNode params to object params
jiexi Dec 19, 2024
10ad69f
Merge branch 'main' into caip25-permission-migration
jiexi Dec 19, 2024
a8f4b55
Update wallet_requestPermissions to handle other permissions again
jiexi Dec 19, 2024
f460b5c
Fix Snaps permission UI
jiexi Dec 19, 2024
8ac50a4
incremental permitted chains view still needed
jiexi Dec 19, 2024
ca74a5d
replace updatedCaveatValue let assignment with const
jiexi Dec 19, 2024
a7ba043
fix wallet_requestPermissions e2e spec
jiexi Dec 20, 2024
8953a07
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
eb08761
remove incremental redirect for permittedChains
jiexi Dec 20, 2024
352f964
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
9657527
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
0ab7368
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
e749a8a
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
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
26 changes: 19 additions & 7 deletions .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1398,17 +1398,29 @@ const state = {
subjects: {
'https://app.uniswap.org': {
permissions: {
eth_accounts: {
invoker: 'https://app.uniswap.org',
parentCapability: 'eth_accounts',
id: 'a7342e4b-beae-4525-a36c-c0635fd03359',
date: 1620710693178,
'endowment:caip25': {
caveats: [
{
type: 'restrictReturnedAccounts',
value: ['0x64a845a5b02460acf8a3d84503b0d68d028b4bb4'],
type: 'authorizedScopes',
value: {
requiredScopes: {},
optionalScopes: {
'eip155:1': {
methods: [],
notifications: [],
accounts: [
'eip155:1:0x64a845a5b02460acf8a3d84503b0d68d028b4bb4',
],
},
},
isMultichainOrigin: false,
},
},
],
invoker: 'https://app.uniswap.org',
id: 'a7342e4b-beae-4525-a36c-c0635fd03359',
date: 1620710693178,
parentCapability: 'endowment:caip25',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/index.js b/lib/index.js
index f5795884311124b221d91f488ed45750eb6e9c80..e030d6f8d8e85e6d1350c565d36ad48bc49af881 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -25,7 +25,7 @@ class Ptr {
});
return `/${tokens.join("/")}`;
}
- eval(instance) {
+ shmeval(instance) {
jiexi marked this conversation as resolved.
Show resolved Hide resolved
for (const token of this.tokens) {
if (instance.hasOwnProperty(token)) {
instance = instance[token];
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/build/resolve-pointer.js b/build/resolve-pointer.js
index d5a8ec7486250cd17572eb0e0449725643fc9842..044e74bb51a46e9bf3547f6d7a84763b93260613 100644
--- a/build/resolve-pointer.js
+++ b/build/resolve-pointer.js
@@ -27,7 +27,7 @@ exports.default = (function (ref, root) {
try {
var withoutHash = ref.replace("#", "");
var pointer = json_pointer_1.default.parse(withoutHash);
- return pointer.eval(root);
+ return pointer.shmeval(root);
jiexi marked this conversation as resolved.
Show resolved Hide resolved
}
catch (e) {
throw new InvalidJsonPointerRefError(ref, e.message);
9 changes: 2 additions & 7 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,13 +637,8 @@ function emitDappViewedMetricEvent(origin) {
return;
}

const permissions = controller.controllerMessenger.call(
'PermissionController:getPermissions',
origin,
);
const numberOfConnectedAccounts =
permissions?.eth_accounts?.caveats[0]?.value.length;
if (!numberOfConnectedAccounts) {
const numberOfConnectedAccounts = controller.getPermittedAccounts(origin);
if (numberOfConnectedAccounts.length === 0) {
return;
}

Expand Down
Loading
Loading