Skip to content

Commit ca58336

Browse files
authored
chore: bitcoin snap integration into packages (#27)
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ### Phase C: Integration into `packages/` [migration guide](https://github.com/MetaMask/internal-snaps/blob/ee44ed3f70ad77f59ea6e836114e8db7364c4772/docs/processes/snap-migration-process-guide.md#pr11-phase-c-integration-into-packages) Move files from intermediate folder `merged-packages/` to `packages/`. Fix eslint/ts errors, and suppress the rest. Add a bunch of resolutions to the main package.json to fix SES env issue during bitcoin snap build. Update teams.json, codeowners files. ## References * Related to [WPN-1324](https://consensyssoftware.atlassian.net/browse/WPN-1324) <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
1 parent 4ef0fe8 commit ca58336

143 files changed

Lines changed: 879 additions & 249 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
# That file is used for some automated workflows, and maps controller to owning team(s).
66

77
* @MetaMask/core-platform @MetaMask/networks
8+
9+
packages/bitcoin-wallet-snap @MetaMask/networks

README.md

Lines changed: 1 addition & 0 deletions

eslint-suppressions.json

Lines changed: 136 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,136 @@
1-
{}
1+
{
2+
"packages/bitcoin-wallet-snap/integration-test/client-request.test.ts": {
3+
"@typescript-eslint/no-explicit-any": {
4+
"count": 1
5+
},
6+
"jest/no-disabled-tests": {
7+
"count": 1
8+
},
9+
"no-restricted-syntax": {
10+
"count": 1
11+
}
12+
},
13+
"packages/bitcoin-wallet-snap/integration-test/cron-sync.test.ts": {
14+
"n/no-sync": {
15+
"count": 1
16+
},
17+
"no-restricted-syntax": {
18+
"count": 1
19+
}
20+
},
21+
"packages/bitcoin-wallet-snap/integration-test/keyring-request.test.ts": {
22+
"no-restricted-syntax": {
23+
"count": 1
24+
}
25+
},
26+
"packages/bitcoin-wallet-snap/integration-test/keyring.test.ts": {
27+
"jest/no-disabled-tests": {
28+
"count": 1
29+
},
30+
"no-restricted-syntax": {
31+
"count": 3
32+
}
33+
},
34+
"packages/bitcoin-wallet-snap/scripts/build-preinstalled-snap.js": {
35+
"n/no-sync": {
36+
"count": 2
37+
}
38+
},
39+
"packages/bitcoin-wallet-snap/scripts/populate-en-locale.js": {
40+
"n/no-sync": {
41+
"count": 1
42+
}
43+
},
44+
"packages/bitcoin-wallet-snap/snap.config.ts": {
45+
"import-x/no-nodejs-modules": {
46+
"count": 1
47+
},
48+
"no-restricted-globals": {
49+
"count": 14
50+
}
51+
},
52+
"packages/bitcoin-wallet-snap/src/handlers/KeyringHandler.test.ts": {
53+
"@typescript-eslint/explicit-function-return-type": {
54+
"count": 4
55+
}
56+
},
57+
"packages/bitcoin-wallet-snap/src/handlers/RpcHandler.test.ts": {
58+
"@typescript-eslint/explicit-function-return-type": {
59+
"count": 2
60+
},
61+
"@typescript-eslint/no-explicit-any": {
62+
"count": 12
63+
}
64+
},
65+
"packages/bitcoin-wallet-snap/src/handlers/UserInputHandler.ts": {
66+
"no-restricted-syntax": {
67+
"count": 1
68+
}
69+
},
70+
"packages/bitcoin-wallet-snap/src/handlers/mappings.test.ts": {
71+
"@typescript-eslint/explicit-function-return-type": {
72+
"count": 3
73+
},
74+
"@typescript-eslint/no-explicit-any": {
75+
"count": 17
76+
}
77+
},
78+
"packages/bitcoin-wallet-snap/src/handlers/validation.test.ts": {
79+
"@typescript-eslint/explicit-function-return-type": {
80+
"count": 4
81+
}
82+
},
83+
"packages/bitcoin-wallet-snap/src/infra/SnapClientAdapter.test.ts": {
84+
"@typescript-eslint/explicit-function-return-type": {
85+
"count": 1
86+
}
87+
},
88+
"packages/bitcoin-wallet-snap/src/infra/jsx/components/SendForm.tsx": {
89+
"id-length": {
90+
"count": 1
91+
}
92+
},
93+
"packages/bitcoin-wallet-snap/src/infra/jsx/confirmations/SignMessageConfirmationView.tsx": {
94+
"id-length": {
95+
"count": 1
96+
}
97+
},
98+
"packages/bitcoin-wallet-snap/src/infra/jsx/confirmations/SignPsbtConfirmationView.tsx": {
99+
"id-length": {
100+
"count": 1
101+
}
102+
},
103+
"packages/bitcoin-wallet-snap/src/infra/jsx/send-flow/ReviewTransactionView.tsx": {
104+
"id-length": {
105+
"count": 1
106+
}
107+
},
108+
"packages/bitcoin-wallet-snap/src/infra/jsx/send-flow/SendFormView.tsx": {
109+
"id-length": {
110+
"count": 1
111+
}
112+
},
113+
"packages/bitcoin-wallet-snap/src/infra/jsx/unified-send-flow/UnifiedSendFormView.tsx": {
114+
"id-length": {
115+
"count": 1
116+
}
117+
},
118+
"packages/bitcoin-wallet-snap/src/store/BdkAccountRepository.test.ts": {
119+
"@typescript-eslint/explicit-function-return-type": {
120+
"count": 1
121+
}
122+
},
123+
"packages/bitcoin-wallet-snap/src/store/InMemoryCache.test.ts": {
124+
"@typescript-eslint/no-explicit-any": {
125+
"count": 1
126+
}
127+
},
128+
"packages/bitcoin-wallet-snap/src/use-cases/SendFlowUseCases.test.ts": {
129+
"@typescript-eslint/explicit-function-return-type": {
130+
"count": 1
131+
},
132+
"@typescript-eslint/no-explicit-any": {
133+
"count": 5
134+
}
135+
}
136+
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,16 @@
8383
"simple-git-hooks": "^2.8.0",
8484
"ts-jest": "^29.4.1",
8585
"tsx": "^4.20.5",
86-
"typescript": "~5.7.3",
86+
"typescript": "~5.8.3",
8787
"typescript-eslint": "^8.48.0",
8888
"yargs": "^17.7.2"
8989
},
9090
"resolutions": {
91-
"@metamask/snaps-sdk": "^11.0.0",
91+
"@metamask/snaps-sdk": "11.1.1",
9292
"elliptic@6.5.4": "^6.5.7",
9393
"fast-xml-parser@^4.3.4": "^4.4.1",
94+
"hash-base@npm:^3.0.0": "3.1.0",
95+
"ripemd160@npm:^2.0.1": "2.0.2",
9496
"ws@7.4.6": "^7.5.10"
9597
},
9698
"simple-git-hooks": {
File renamed without changes.

merged-packages/bitcoin-wallet-snap/LICENSE renamed to packages/bitcoin-wallet-snap/LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)