Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
279 commits
Select commit Hold shift + click to select a range
6b305d1
remove dep
montelaidev Apr 3, 2023
fb6b5ce
remove ethers form accountManagement
montelaidev Apr 3, 2023
51e998c
fix type 2 transactions
montelaidev Apr 3, 2023
17fd682
fix comment
montelaidev Apr 3, 2023
3920b93
remove keys
montelaidev Apr 3, 2023
7f85bca
Merge pull request #3 from MetaMask/feat/remove-account
montelaidev Apr 3, 2023
a33605e
fix chain id
montelaidev Apr 3, 2023
4484f4e
chore: rename methods and remove more logic from UI
danroc Apr 3, 2023
872840b
feat: display account addresses
danroc Apr 3, 2023
6bdfcec
fix nodemon
montelaidev Apr 4, 2023
6f69c43
fix handleApproveRequest
montelaidev Apr 4, 2023
de91192
refactor into keyring class
montelaidev Apr 6, 2023
4bddb9c
chore: start dev of wrapper
danroc May 17, 2023
f1919e9
wip: list accounts
danroc May 17, 2023
de62377
wip: start implementation on snap side
danroc May 17, 2023
a0d5cb3
use latest snap version
montelaidev May 19, 2023
8c90c3c
Update yarn.lock + dedupe ethereumjs packages
FrederikBolding May 19, 2023
52387f4
update code owners
montelaidev May 19, 2023
ea4ad5b
Merge pull request #5 from MetaMask/update-to-0-32-0
montelaidev May 19, 2023
8d7d8ec
fix unused chainOpts
montelai May 23, 2023
99c7eee
Merge branch 'fix-unused-chainOpts' into feat/api-wrapper
montelai May 23, 2023
3b458c1
Add material UI module
gantunesr May 23, 2023
7449332
Update Card component style
gantunesr May 23, 2023
a1ead33
WIP: Update main page
gantunesr May 23, 2023
8d76110
Move styled components to new file
gantunesr May 23, 2023
94843e8
Add react-icons and remove material UI
gantunesr May 24, 2023
39d5b9b
Add AccountList component
gantunesr May 24, 2023
fd2661a
Update Card component
gantunesr May 24, 2023
ab4cb3d
Update title
gantunesr May 24, 2023
df612b7
Add styled components
gantunesr May 24, 2023
3dedc9a
Update home page
gantunesr May 24, 2023
9160ac6
Add AccountList to index
gantunesr May 24, 2023
2dbc9ff
Update name
gantunesr May 24, 2023
324bd5a
chore: use new keyring API
danroc May 24, 2023
8b27ce1
Add dependencies
gantunesr May 25, 2023
615f23a
Add Accordion component
gantunesr May 25, 2023
169aff8
Add Accordion component
gantunesr May 25, 2023
7fb369f
Add more styledComponents
gantunesr May 25, 2023
d940e2d
Update AccountList component
gantunesr May 25, 2023
11783c0
Update index page
gantunesr May 25, 2023
1243a3d
Update snap/src/keyring.ts to feat/api-wrapper
gantunesr May 25, 2023
47a7a05
Revert "Update snap/src/keyring.ts to feat/api-wrapper"
gantunesr May 25, 2023
3262381
Merge feat/api-wrapper
gantunesr May 25, 2023
51af881
Improve descriptions
gantunesr May 25, 2023
937aea1
Update with feedback
gantunesr May 25, 2023
4ea8ad6
Solve rendering issue
gantunesr May 30, 2023
1e66b3d
chore: rename keyring-api package
danroc May 26, 2023
81c7696
chore: rename TODOs
danroc May 26, 2023
17eca73
chore: prettier formatting
danroc May 29, 2023
55c5f04
chore: run `yarn install`
danroc May 29, 2023
8f6c733
disable strict null check
montelaidev Jun 7, 2023
8ca71c9
update methods
montelaidev Jun 7, 2023
731fb17
add utils
montelaidev Jun 7, 2023
e37684a
add jsdoc for stateManagment
montelaidev Jun 7, 2023
feb72e5
update keyring construction
montelaidev Jun 7, 2023
125091b
add save keyringState after account creation
montelaidev Jun 7, 2023
e9c7e92
update getWalletByAddress and throw if none is found
montelaidev Jun 7, 2023
82aab23
update keyringstate keys
montelaidev Jun 7, 2023
480eb8a
add saveSnapKeyringState
montelaidev Jun 7, 2023
d829329
add handle signing
montelaidev Jun 7, 2023
a640598
add cases to request handler
montelaidev Jun 7, 2023
c4d91b2
update switch methods
montelaidev Jun 7, 2023
935ba1a
update to use new KeyringAccount and implement filterSupportedChains
montelaidev Jun 8, 2023
da762cd
add isEVMChain util
montelaidev Jun 8, 2023
ac01fa6
wip: some API changes
danroc Jun 8, 2023
7005266
add examples and implement filter
montelaidev Jun 8, 2023
ad17be8
Merge remote-tracking branch 'origin/feat/api-wrapper' into feat/api-…
montelaidev Jun 9, 2023
29f4d7a
remove duplicate
montelaidev Jun 9, 2023
162d919
update checksum in manifest
montelaidev Jun 9, 2023
bf0af0b
Merge pull request #6 from MetaMask/feat/api-wrapper-signing
montelaidev Jun 9, 2023
37b677a
Merge remote-tracking branch 'origin/main' into feat/api-wrapper
montelai Jun 9, 2023
c0a48fb
update yarn and dep
montelai Jun 9, 2023
9a126ba
rename the keyring class
danroc Jun 13, 2023
2aaee5e
add superstruct and have strictNullChecks
montelaidev Jun 14, 2023
b2970c2
remove unused func
montelaidev Jun 14, 2023
f2917c1
remove ethereumjs dep from site
montelaidev Jun 15, 2023
4374ab9
feat: use dispatcher in the snap
danroc Jun 16, 2023
c64f64e
feat: use dispatcher in the snap
danroc Jun 19, 2023
edf2ca5
fix: fix signing on `keyring2`
danroc Jun 19, 2023
450fe5a
chore: remove old keyring
danroc Jun 19, 2023
0062829
chore: rename `keyring2` to `keyring`
danroc Jun 19, 2023
65bab15
chore: update `chainHandlers` function name (was `buildHandlersChain`)
danroc Jun 19, 2023
928347d
chore: fix linter
danroc Jun 21, 2023
31bb04a
Merge pull request #8 from MetaMask/feat/use-dispatcher
danroc Jun 21, 2023
822d7e4
chore: bump `keyring-api` and remove allowed scripts (#9)
danroc Jun 22, 2023
e46596c
docs: update `README.md` (#11)
danroc Jun 22, 2023
2ee3e53
chore: bump `keyring-api` to `0.1.0` (`site`) (#13)
danroc Jun 22, 2023
eb0e77e
feat(site): add inputs fields (#12)
montelaidev Jun 22, 2023
669d25c
chore(site): remove `updateState` (#15)
montelaidev Jun 22, 2023
fbc6b0d
fix(snap): use new snap controller method name (#14)
danroc Jun 22, 2023
a4fac77
chore(snap): update manifest (#16)
montelaidev Jun 22, 2023
07331e4
chore(deps): bump fast-xml-parser from 4.2.4 to 4.2.5 (#18)
dependabot[bot] Jun 22, 2023
e315e95
chore: prepare for release (#19)
danroc Jun 22, 2023
53eff51
0.1.0 (#20)
github-actions[bot] Jun 22, 2023
706c480
docs: add changelog
danroc Jun 22, 2023
68f5bfe
0.1.0 (#21)
danroc Jun 22, 2023
a042561
feat(snap): enable eth_sign (#22)
montelaidev Jun 23, 2023
59faa59
0.1.0 (#23)
danroc Jun 23, 2023
4ec1794
0.1.0 (#24)
danroc Jun 23, 2023
ac636f2
ci: use action from template to publish dapp to GH Pages (#25)
danroc Jun 23, 2023
15192df
chore: revert versions to `0.0.0` before release (#27)
danroc Jun 23, 2023
90e4872
ci: use workflows from template (#26)
danroc Jun 23, 2023
6d0d8c6
ci: build site instead of docs (#28)
danroc Jun 23, 2023
480871f
ci: define path prefix when building site (#30)
danroc Jun 23, 2023
c76d85e
fix: move client creation into use effect (#29)
montelaidev Jun 23, 2023
c6015dc
fix: revert window check and remove placeholder text (#31)
danroc Jun 23, 2023
59f24f4
ci: set snap origin (#32)
danroc Jun 23, 2023
49b7a64
ci: add missing prefix to package name
danroc Jun 23, 2023
776c69d
fix: hard-code snap origin for now
danroc Jun 23, 2023
27fb9a5
ci: set snap origin in env file (#33)
danroc Jun 23, 2023
0f30110
ci: make `SNAP_ORIGIN` available in the browser
danroc Jun 23, 2023
bdd0592
ci: hard-code snap origin (again)
danroc Jun 23, 2023
115543f
0.1.0 (#34)
github-actions[bot] Jun 23, 2023
5e91352
ci: archive `dist` dirs from all workspaces
danroc Jun 23, 2023
10d28c8
ci: use archived `dist` directories
danroc Jun 23, 2023
fd04094
Revert "0.1.0 (#34)"
danroc Jun 23, 2023
772d379
0.1.0 (#35)
github-actions[bot] Jun 23, 2023
07f0e92
fix(snap): allow `https://metamask.github.io` as origin (#36)
danroc Jun 23, 2023
dce9ca2
docs: update snap's `README.md` (#37)
danroc Jun 23, 2023
14a6cc7
0.1.1 (#38)
github-actions[bot] Jun 23, 2023
95805fa
fix: add ids for e2e (#40)
montelaidev Jun 27, 2023
56e9c10
feat(snap): notify extension on accounts changes (#39)
danroc Jun 27, 2023
85c6a61
chore(deps): update snaps and API dependencies (#41)
danroc Jun 27, 2023
7934398
0.1.2 (#42)
github-actions[bot] Jun 27, 2023
87c5d0a
fix: fix unique name during account creation (#43)
montelaidev Jun 28, 2023
4acefa5
fix: fix address checksum (#44)
danroc Jun 28, 2023
8eaddaf
chore: update snap checksum (#46)
danroc Jun 28, 2023
d3f7f01
0.1.3 (#47)
github-actions[bot] Jun 28, 2023
73f16b7
Bump `@metamask/snaps-cli` to `v0.38.2-flask.1` (#55)
gantunesr Aug 24, 2023
7ae49cc
chore(deps): bump ses from 0.18.4 to 0.18.7 (#51)
dependabot[bot] Aug 25, 2023
596cf3e
fix: `rejectRequest` in site package (#53)
therealharpaljadeja Aug 25, 2023
89a717b
chore(deps): bump word-wrap from 1.2.3 to 1.2.4 (#49)
dependabot[bot] Aug 25, 2023
860d6c6
chore(deps): bump semver from 5.7.1 to 5.7.2 (#48)
dependabot[bot] Aug 25, 2023
476e229
0.1.4 (#57)
github-actions[bot] Aug 25, 2023
14a2401
feat: improve UI/UX (#54)
gantunesr Aug 28, 2023
035fdd2
feat: import account (#58)
gantunesr Aug 29, 2023
88b6460
fix: now you don't have to change your defaultSnapOrigin (#59)
HowardBraham Aug 29, 2023
e76ba4b
feat: support the async approval flow (#50)
owencraston Aug 29, 2023
67fd181
chore(deps): bump @adobe/css-tools from 4.2.0 to 4.3.1 (#60)
dependabot[bot] Aug 30, 2023
83ea3df
0.2.0 (#61)
github-actions[bot] Sep 4, 2023
90a7d18
fix: crypto dependency introduced in metamask-utils 6.2.0 (#62)
montelaidev Sep 6, 2023
2807968
chore: set `.nvmrc` to v18 (#63)
gantunesr Sep 11, 2023
89e2444
feat: migrate to new `keyring-api` version (`0.2.x`) (#64)
danroc Sep 12, 2023
09087a8
ui: remove account name and improve some UI components (#65)
danroc Sep 14, 2023
4eb80c3
ui: align button and request result with action name (#66)
danroc Sep 14, 2023
0451f3c
0.2.1 (#67)
github-actions[bot] Sep 14, 2023
b0deb72
chore: fix typo in changelog (#68)
danroc Sep 14, 2023
76c31b8
build: update main file (`src/index.ts` -> `dist/bundle.js`) (#69)
danroc Sep 14, 2023
2dbeb14
feat: add dapp version to header (#71)
gantunesr Sep 15, 2023
33c388c
feat: the dApp specifies the Snap version to install (#72)
HowardBraham Sep 15, 2023
b7a8fbc
chore: update toggle style (#73)
gantunesr Sep 15, 2023
c4c9ae4
build: update configs from `metamask-module-template` (#75)
danroc Sep 15, 2023
373b482
fix: persist snap state after switching between sync <-> async (#76)
danroc Sep 15, 2023
4f64d52
fix: disable async-sync toggle if snap is not installed (#77)
gantunesr Sep 15, 2023
cca3d5d
0.2.2 (#78)
github-actions[bot] Sep 15, 2023
b43b29f
ci: change wokrflow names `docs` -> `dapp` (#79)
danroc Sep 15, 2023
20d00f2
fix: serve self-hosted fonts (#80)
danroc Sep 18, 2023
1bc740b
feat: enable linters and fix errors (#81)
danroc Sep 19, 2023
81b5a1d
fix: use text fields in account methods inputs (#82)
danroc Sep 19, 2023
12300fa
chore: update Gatsby to version 5 (#83)
danroc Sep 19, 2023
cf70a38
build: update linting targets (#85)
danroc Sep 19, 2023
3729cb8
0.2.3 (#86)
github-actions[bot] Sep 19, 2023
36fe926
fix: check if the snap is installed before trying to get its state (#87)
danroc Sep 19, 2023
df8aed1
chore: remove `console.log` if snap is not installed (#88)
danroc Sep 19, 2023
4ff21c5
ui: fix the private key format in the import account placeholder (#89)
danroc Sep 19, 2023
0f50340
fix: remove private key from options after generating key pair (#90)
gantunesr Sep 20, 2023
af1996d
chore(deps): bump graphql from 16.8.0 to 16.8.1 (#91)
dependabot[bot] Sep 22, 2023
8f07699
fix: add state.installSnap into dep array (#92)
montelaidev Sep 26, 2023
44b43c6
feat: add update button (#93)
montelaidev Sep 27, 2023
612b813
fix: snap and extension are out of sync (#95)
owencraston Oct 4, 2023
33a4bb1
0.2.4 (#96)
github-actions[bot] Oct 4, 2023
e683a07
feat!: use `onKeyringRequest` to handle keyring methods (#97)
danroc Oct 10, 2023
6026800
0.3.0 (#100)
github-actions[bot] Oct 10, 2023
0cc3591
feat: allow Snap to be installed on MetaMask Stable (#101)
danroc Oct 11, 2023
4c585d7
0.3.1 (#102)
github-actions[bot] Oct 11, 2023
c201769
feat: add URL to async approval redirect (#98)
owencraston Oct 11, 2023
2d25028
0.4.0 (#103)
github-actions[bot] Oct 11, 2023
d8887d3
feat: add alert banner for users (#104)
gantunesr Oct 11, 2023
906e9d1
chore: remove localhost (#106)
gantunesr Oct 12, 2023
233f811
1.0.0 (#107)
github-actions[bot] Oct 12, 2023
cbbbf39
fix: remove logs from Snap (#108)
danroc Oct 12, 2023
768210a
1.0.1 (#109)
github-actions[bot] Oct 12, 2023
5bd5240
fix: use the Snap `package.json` for the update check (#112)
montelaidev Oct 12, 2023
3c95081
fix: change `packageInfo` to `snapPackageInfo` (#114)
montelaidev Oct 13, 2023
161469a
feat: add "Update Account" to companion dapp (#118)
danroc Oct 19, 2023
51c4675
fix: sanitize error message when importing invalid private key (#119)
danroc Oct 19, 2023
b85eb3e
feat: add delete button to account (#117)
montelaidev Oct 19, 2023
91b2c22
fix: use `stretch` as default alignment in `AccountRow` (#120)
danroc Oct 19, 2023
5a3bacb
ui: move "Delete" button into account details (#121)
danroc Oct 19, 2023
994929f
ui: move "Delete" button into account details (#122)
danroc Oct 20, 2023
03bd527
ui: add parenthesis around details of the Snap version (#123)
danroc Oct 20, 2023
501a105
build: remove cache before building site (#124)
danroc Oct 20, 2023
d7b2d9a
feat: add logger utility (#116)
danroc Oct 20, 2023
c8f1538
fix: remove `localhost` from `allowedOrigin` (#125)
danroc Oct 20, 2023
75710b0
1.1.0 (#126)
github-actions[bot] Oct 20, 2023
acd2810
e2e: add data-testid="use-sync-flow-toggle" (#130)
HowardBraham Nov 1, 2023
612078a
chore: remove unused `snap_dialog` permission (#127)
danroc Nov 1, 2023
441ea87
fix: update eth-sig-util to fix a regression (#131)
danroc Dec 12, 2023
89180ef
chore(deps): bump browserify-sign from 4.2.1 to 4.2.2 (#128)
dependabot[bot] Dec 12, 2023
444da8a
1.1.1 (#132)
github-actions[bot] Dec 18, 2023
4c8da4c
Enabling MetaMask security code scanner (#137)
metamaskbot Mar 8, 2024
337ee12
chore: hardcode light mode (#138)
gantunesr Mar 15, 2024
0f7e62d
chore(deps): bump follow-redirects from 1.15.2 to 1.15.6 (#139)
dependabot[bot] Mar 18, 2024
febd38b
chore(deps): bump express from 4.18.2 to 4.19.2 (#140)
dependabot[bot] Apr 18, 2024
98d51d9
chore(deps): bump tar from 6.2.0 to 6.2.1 (#141)
dependabot[bot] Apr 22, 2024
1d32e6e
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 (#136)
dependabot[bot] Apr 22, 2024
306f088
chore(deps): bump ip from 2.0.0 to 2.0.1 (#135)
dependabot[bot] Apr 22, 2024
b015783
chore(deps): bump msgpackr from 1.9.9 to 1.10.1 (#133)
dependabot[bot] Apr 22, 2024
3971582
chore(deps): bump ejs from 3.1.9 to 3.1.10 (#142)
dependabot[bot] May 31, 2024
6cc1857
feat: add account name suggestion (#144)
k-g-j Aug 12, 2024
6af8420
1.1.2 (#145)
github-actions[bot] Aug 12, 2024
e0860be
feat: pre installed snap script (#146)
owencraston Sep 3, 2024
35b0dd0
patch: Include yarn build-preinstalled-snap in main build steps (#148)
owencraston Sep 3, 2024
949a184
1.1.3 (#149)
github-actions[bot] Sep 3, 2024
d24be62
fix: moved build-preinstalled-snap.js script inside snap package (#150)
k-g-j Sep 4, 2024
a9fd24b
fix: Allow the metamask.github.io to call the snap (#151)
owencraston Sep 4, 2024
35b10f6
1.1.4 (#152)
github-actions[bot] Sep 4, 2024
68fb7f7
feat: add "metamask.github.io" to `allowedOrigins` in the `endowment:…
k-g-j Sep 6, 2024
42b1258
1.1.5 (#154)
github-actions[bot] Sep 6, 2024
7f5a716
chore: bump keyring-api to ^8.1.3 (#155)
ccharly Sep 26, 2024
891f0e7
chore(deps): bump ws from 7.5.9 to 7.5.10 in the npm_and_yarn group a…
dependabot[bot] Sep 26, 2024
1e57a57
1.1.6 (#156)
github-actions[bot] Sep 26, 2024
e5e8959
chore: add workflow_dispatch to security-code-scanner (#158)
metamaskbot Mar 5, 2025
2fc10e3
chore: bump `crypto-browserify@^3.12.1` + `snaps-*` (#159)
ccharly Mar 6, 2025
3c53e7a
chore: use new CentraNo1 font (#160)
ccharly Apr 2, 2025
ef3b6be
chore: make @metamask/snap-simple-keyring-site publishable (#163)
seaona Sep 24, 2025
0da933b
2.0.0 (#165)
github-actions[bot] Oct 1, 2025
fa59ed9
fix: revert "2.0.0 (#165)" (#167)
seaona Oct 2, 2025
8c7b6b2
fix: include `public` folder in release cache (#166)
seaona Oct 2, 2025
40966a4
2.0.0 (#168)
github-actions[bot] Oct 2, 2025
f65dabc
chore: bump accounts dependencies (#169)
ccharly Nov 28, 2025
95d6206
chore: bump snaps SDK (#171)
shane-t Jan 21, 2026
e7153e5
chore: use new font Geist (#172)
ccharly Mar 6, 2026
32d7c0f
chore: bump deps (#173)
hmalik88 May 2, 2026
1288dc7
2.0.1 (#175)
github-actions[bot] May 4, 2026
947d53f
feat: add missing methods (#176)
hmalik88 May 5, 2026
dc09b4b
2.1.0 (#177)
github-actions[bot] May 6, 2026
2689610
feat: update changelog to prep release (#178)
hmalik88 May 6, 2026
ae8dff7
chore: add comment explaining package versions (#179)
hmalik88 May 6, 2026
6793b2d
2.1.1 (#180)
github-actions[bot] May 6, 2026
a76169d
Add 'packages/snaps/simple-keyring/' from commit '6793b2d4159d20525f2…
ccharly Jun 22, 2026
a05924d
feat(snap-simple-keyring): migrate MetaMask/snap-simple-keyring into …
ccharly Jun 19, 2026
adcf38d
feat(snap-simple-keyring): add build:snaps:deps script and tsconfig p…
ccharly Jun 19, 2026
7050060
fix(snap-simple-keyring): fix site build in monorepo context
ccharly Jun 19, 2026
7fddda0
build: exempt snap packages from yarn constraints
ccharly Jun 22, 2026
a9b2c9c
build: exclude snap packages from root linting
ccharly Jun 22, 2026
5978496
chore: dedupe yarn.lock after snap migration
ccharly Jun 22, 2026
fe0a943
chore(snap-simple-keyring): remove standalone-repo-specific files
ccharly Jun 22, 2026
b8cdd2b
build: reorder workspace patterns for changelog CI compatibility
ccharly Jun 22, 2026
c631ed6
docs: update README with snap-simple-keyring packages
ccharly Jun 22, 2026
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
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Snap packages use older tooling (Prettier v2, different configs).
# Formatting will be aligned in a follow-up.
packages/snaps/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ This repository contains the following packages [^fn1]:
- [`@metamask/keyring-snap-client`](packages/keyring-snap-client)
- [`@metamask/keyring-snap-sdk`](packages/keyring-snap-sdk)
- [`@metamask/keyring-utils`](packages/keyring-utils)
- [`@metamask/snap-simple-keyring-site`](packages/snaps/simple-keyring/packages/site)
- [`@metamask/snap-simple-keyring-snap`](packages/snaps/simple-keyring/packages/snap)

<!-- end package list -->

Expand Down Expand Up @@ -61,6 +63,8 @@ linkStyle default opacity:0.5
keyring_snap_client(["@metamask/keyring-snap-client"]);
keyring_snap_sdk(["@metamask/keyring-snap-sdk"]);
keyring_utils(["@metamask/keyring-utils"]);
snap_simple_keyring_site(["@metamask/snap-simple-keyring-site"]);
snap_simple_keyring_snap(["@metamask/snap-simple-keyring-snap"]);
account_api --> keyring_api;
account_api --> keyring_utils;
keyring_api --> keyring_utils;
Expand Down Expand Up @@ -107,6 +111,10 @@ linkStyle default opacity:0.5
keyring_snap_client --> keyring_utils;
keyring_snap_sdk --> keyring_utils;
keyring_snap_sdk --> keyring_api;
snap_simple_keyring_site --> keyring_api;
snap_simple_keyring_site --> keyring_snap_client;
snap_simple_keyring_snap --> keyring_api;
snap_simple_keyring_snap --> keyring_snap_sdk;
```

<!-- end dependency graph -->
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const config = createConfig([
'**/dist/**',
'**/docs/**',
'**/coverage/**',
// Snap packages use older tooling (ESLint v8, different configs).
// Linting will be aligned in a follow-up.
'packages/snaps/**',
],
},

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
"url": "https://github.com/MetaMask/accounts.git"
},
"workspaces": [
"packages/snaps/*/packages/*",
"packages/snaps/*",
"packages/*"
],
"files": [],
"scripts": {
"build": "ts-bridge --project tsconfig.build.json",
"build:clean": "yarn build --clean",
"build:snaps": "yarn build:snaps:deps && yarn workspaces foreach --all --include '@metamask/snap-simple-keyring' --parallel --verbose run build",
"build:snaps:deps": "yarn workspaces foreach --all --include '@metamask/keyring-utils' --include '@metamask/keyring-api' --include '@metamask/keyring-snap-sdk' --include '@metamask/keyring-snap-client' --topological --verbose run build",
"build:docs": "yarn foreach build:docs",
"build:only-clean": "rimraf -g 'packages/*/dist'",
"build:types": "tsc --build tsconfig.build.json --verbose",
Expand All @@ -24,7 +28,7 @@
"lint:dependencies:fix": "yarn foreach depcheck && yarn dedupe",
"lint:eslint": "yarn build:only-clean && yarn eslint",
"lint:fix": "yarn lint:eslint --fix --prune-suppressions && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix",
"lint:misc": "oxfmt --ignore-path .gitignore",
"lint:misc": "oxfmt --ignore-path .gitignore --ignore-path .prettierignore",
"lint:misc:check": "yarn lint:misc --check",
"lint:readme": "yarn readme:update",
"prepare:preview": "ts-node --project tsconfig.scripts.json scripts/prepare-preview-builds.ts",
Expand Down
3 changes: 3 additions & 0 deletions packages/snaps/simple-keyring/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore-patterns": [".yarn/"]
}
44 changes: 44 additions & 0 deletions packages/snaps/simple-keyring/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
root: true,

extends: ['@metamask/eslint-config'],

overrides: [
{
files: ['*.ts', '*.tsx'],
extends: ['@metamask/eslint-config-typescript'],
rules: {
// This prevents using Node.js and/or browser specific globals. We
// currently use both in our codebase, so this rule is disabled.
'no-restricted-globals': 'off',
'spaced-comment': ['error', 'always', { markers: ['/'] }],
},
},

{
files: ['*.js', '*.jsx', '*.cjs'],
extends: ['@metamask/eslint-config-nodejs'],
},

{
files: ['*.test.ts', '*.test.js'],
extends: [
'@metamask/eslint-config-jest',
'@metamask/eslint-config-nodejs',
],
},
],

rules: {
// This is necessary to run eslint on Windows and not get a thousand CRLF errors
'prettier/prettier': ['error', { endOfLine: 'auto' }],
},

ignorePatterns: [
'!.eslintrc.js',
'!.prettierrc.js',
'dist/',
'docs/',
'.yarn/',
],
};
86 changes: 86 additions & 0 deletions packages/snaps/simple-keyring/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
.DS_Store
dist/
build/
coverage/

# We have to ignore files in the root .gitignore file because it's also used by
# prettier, which doesn't support nested .gitignore files.
/packages/site/.cache/
/packages/site/public/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3 (w/o zero-install)
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# IntelliJ
.idea/
9 changes: 9 additions & 0 deletions packages/snaps/simple-keyring/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// All of these are defaults except singleQuote, but we specify them
// for explicitness
module.exports = {
endOfLine: 'auto',
quoteProps: 'as-needed',
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/esm/cryptoNode.js b/esm/cryptoNode.js
index 4f77e8f46c5e242e1e3cb92712dc65e95a8b8eb0..acd05d884061e18adf27d33ba4a1c55e9cc85e7f 100644
--- a/esm/cryptoNode.js
+++ b/esm/cryptoNode.js
@@ -7,9 +7,19 @@
*/
// @ts-ignore
import * as nc from 'node:crypto';
-export const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc
- ? nc.webcrypto
- : nc && typeof nc === 'object' && 'randomBytes' in nc
+// It seems `webpack` is not able to resolve `nc.webcrypto` at build time. Probably because
+// we use `crypto-browserify` under the hood, and this package does not expose `webcrypto`.
+// While this work when using `require` imports, it seems to fail with ESM exports (at least
+// in this case).
+// export const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc
+// ? nc.webcrypto
+// : nc && typeof nc === 'object' && 'randomBytes' in nc
+// ? nc
+// : undefined;
+
+// We just fallback to the "normal crypto" object to workaround this.
+export const crypto =
+ nc && typeof nc === 'object' && 'randomBytes' in nc
? nc
: undefined;
//# sourceMappingURL=cryptoNode.js.map
Loading
Loading