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

Add onNameLookup export #1394

Merged
merged 61 commits into from
Sep 12, 2023
Merged

Add onNameLookup export #1394

merged 61 commits into from
Sep 12, 2023

Conversation

hmalik88
Copy link
Contributor

@hmalik88 hmalik88 commented May 9, 2023

Added new endowment: endowment:name-lookup & caveat chainIds. This will allow snaps to return a resolved account/domain based on a CAIP-2 chainId and domain or address passed to it.

Note: There are types used from namespace.ts that now exist in @metamask/utils. I reviewed the PRs that copied over the types. I will replace usage with the types from @metamask/utils in a subsequent PR (there's also one type that exists in namespace.ts that is missing from @metamask/utils, so I will first open a PR for that).

@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04% 🎉

Comparison is base (035ee28) 95.74% compared to head (d7f40aa) 95.79%.

❗ Current head d7f40aa differs from pull request most recent head 5920bd3. Consider uploading reports for the commit 5920bd3 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1394      +/-   ##
==========================================
+ Coverage   95.74%   95.79%   +0.04%     
==========================================
  Files         239      240       +1     
  Lines        5410     5469      +59     
  Branches      837      852      +15     
==========================================
+ Hits         5180     5239      +59     
  Misses        230      230              
Files Changed Coverage Δ
...es/snaps-controllers/src/snaps/endowments/index.ts 100.00% <ø> (ø)
packages/snaps-utils/src/caveats.ts 100.00% <ø> (ø)
packages/snaps-utils/src/manifest/validation.ts 100.00% <ø> (ø)
...ges/snaps-controllers/src/snaps/endowments/enum.ts 100.00% <100.00%> (ø)
...ps-controllers/src/snaps/endowments/name-lookup.ts 100.00% <100.00%> (ø)
...naps-execution-environments/src/common/commands.ts 93.93% <100.00%> (+1.34%) ⬆️
...ps-execution-environments/src/common/validation.ts 100.00% <100.00%> (ø)
packages/snaps-utils/src/handlers.ts 100.00% <100.00%> (ø)
packages/snaps-utils/src/namespace.ts 94.11% <100.00%> (+0.36%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hmalik88
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/multichain-provider": "0.33.0-preview.ba5aea3",
  "@metamask/rpc-methods": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-browserify-plugin": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-cli": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-controllers": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-execution-environments": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-rollup-plugin": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-types": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-ui": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-utils": "0.33.0-preview.ba5aea3",
  "@metamask/snaps-webpack-plugin": "0.33.0-preview.ba5aea3"
}

@hmalik88
Copy link
Contributor Author

hmalik88 commented Jun 9, 2023

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2023

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/create-snap": "0.34.1-flask.1",
  "@metamask/multichain-provider": "0.34.1-preview.01f8ad3",
  "@metamask/rpc-methods": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-browserify-plugin": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-cli": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-controllers": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-execution-environments": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-rollup-plugin": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-types": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-ui": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-utils": "0.34.1-preview.01f8ad3",
  "@metamask/snaps-webpack-plugin": "0.34.1-preview.01f8ad3"
}

@hmalik88 hmalik88 changed the title [DO-NOT-MERGE] [CypherPunk 2023] Added onNameLookup export Add onNameLookup export Jun 14, 2023
@hmalik88 hmalik88 marked this pull request as ready for review June 14, 2023 11:27
@hmalik88 hmalik88 requested a review from a team as a code owner June 14, 2023 11:27
@hmalik88 hmalik88 marked this pull request as draft June 30, 2023 15:39
@hmalik88
Copy link
Contributor Author

hmalik88 commented Sep 9, 2023

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2023

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/create-snap": "0.37.3-preview.889f60cd",
  "@metamask/rpc-methods": "0.38.2-preview.889f60cd",
  "@metamask/snaps-browserify-plugin": "0.37.3-preview.889f60cd",
  "@metamask/snaps-cli": "0.38.3-preview.889f60cd",
  "@metamask/snaps-controllers": "0.38.3-preview.889f60cd",
  "@metamask/snaps-execution-environments": "0.38.3-preview.889f60cd",
  "@metamask/snaps-jest": "0.37.4-preview.889f60cd",
  "@metamask/snaps-rollup-plugin": "0.37.3-preview.889f60cd",
  "@metamask/snaps-simulator": "0.38.0-preview.889f60cd",
  "@metamask/snaps-types": "0.38.2-preview.889f60cd",
  "@metamask/snaps-ui": "0.37.4-preview.889f60cd",
  "@metamask/snaps-utils": "0.38.3-preview.889f60cd",
  "@metamask/snaps-webpack-plugin": "0.37.3-preview.889f60cd",
  "@metamask/bip32-example-snap": "0.37.3-preview.889f60cd",
  "@metamask/bip44-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/browserify-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/browserify-plugin-example-snap": "0.37.3-preview.889f60cd",
  "@metamask/cronjob-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/dialog-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/error-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/ethereum-provider-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/ethers-js-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/get-entropy-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/get-locale-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/json-rpc-example-snap": "0.37.3-preview.889f60cd",
  "@metamask/lifecycle-hooks-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/manage-state-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/network-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/notification-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/rollup-plugin-example-snap": "0.37.3-preview.889f60cd",
  "@metamask/insights-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/wasm-example-snap": "0.37.3-preview.889f60cd",
  "@metamask/webpack-plugin-example-snap": "0.37.3-preview.889f60cd",
  "@metamask/consumer-signer-example-snap": "0.38.1-preview.889f60cd",
  "@metamask/core-signer-example-snap": "0.38.1-preview.889f60cd"
}

Mrtenz
Mrtenz previously requested changes Sep 9, 2023
Copy link
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Just some minor comments.

@hmalik88
Copy link
Contributor Author

hmalik88 commented Sep 9, 2023

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2023

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/create-snap": "0.37.3-preview.3e5015f7",
  "@metamask/rpc-methods": "0.38.2-preview.3e5015f7",
  "@metamask/snaps-browserify-plugin": "0.37.3-preview.3e5015f7",
  "@metamask/snaps-cli": "0.38.3-preview.3e5015f7",
  "@metamask/snaps-controllers": "0.38.3-preview.3e5015f7",
  "@metamask/snaps-execution-environments": "0.38.3-preview.3e5015f7",
  "@metamask/snaps-jest": "0.37.4-preview.3e5015f7",
  "@metamask/snaps-rollup-plugin": "0.37.3-preview.3e5015f7",
  "@metamask/snaps-simulator": "0.38.0-preview.3e5015f7",
  "@metamask/snaps-types": "0.38.2-preview.3e5015f7",
  "@metamask/snaps-ui": "0.37.4-preview.3e5015f7",
  "@metamask/snaps-utils": "0.38.3-preview.3e5015f7",
  "@metamask/snaps-webpack-plugin": "0.37.3-preview.3e5015f7",
  "@metamask/bip32-example-snap": "0.37.3-preview.3e5015f7",
  "@metamask/bip44-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/browserify-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/browserify-plugin-example-snap": "0.37.3-preview.3e5015f7",
  "@metamask/cronjob-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/dialog-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/error-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/ethereum-provider-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/ethers-js-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/get-entropy-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/get-locale-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/json-rpc-example-snap": "0.37.3-preview.3e5015f7",
  "@metamask/lifecycle-hooks-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/manage-state-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/network-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/notification-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/rollup-plugin-example-snap": "0.37.3-preview.3e5015f7",
  "@metamask/insights-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/wasm-example-snap": "0.37.3-preview.3e5015f7",
  "@metamask/webpack-plugin-example-snap": "0.37.3-preview.3e5015f7",
  "@metamask/consumer-signer-example-snap": "0.38.1-preview.3e5015f7",
  "@metamask/core-signer-example-snap": "0.38.1-preview.3e5015f7"
}

Mrtenz
Mrtenz previously approved these changes Sep 12, 2023
@hmalik88 hmalik88 dismissed stale reviews from Mrtenz and FrederikBolding via 5920bd3 September 12, 2023 08:59
@hmalik88 hmalik88 merged commit 92fcf31 into main Sep 12, 2023
129 checks passed
@hmalik88 hmalik88 deleted the hm/cypherpunk-address-resolution branch September 12, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants