Skip to content

Commit

Permalink
generalize multisig wallet config interface
Browse files Browse the repository at this point in the history
add support for converting from ColdCard Config

caravan interfaces

refactor coldcard config methods to be functional and other fixes:
* updates tests
* updates linter
* fixes some linting errors
  • Loading branch information
bucko13 committed Jan 14, 2021
1 parent 6637a82 commit 96e0363
Show file tree
Hide file tree
Showing 10 changed files with 792 additions and 214 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
Expand Down
224 changes: 224 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/eslint-parser": "^7.12.1",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.7.1",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"eslint": "^6.6.0",
Expand All @@ -34,7 +36,7 @@
"prepublish": "npm run compile",
"pretest": "npm run compile",
"prepare": "npm run compile",
"test": "jest lib",
"test": "jest src",
"docs": "./bin/build-docs.sh",
"lint": "eslint src"
},
Expand All @@ -60,7 +62,8 @@
},
"babel": {
"plugins": [
"transform-inline-environment-variables"
"transform-inline-environment-variables",
"@babel/plugin-proposal-class-properties"
],
"presets": [
[
Expand Down
19 changes: 13 additions & 6 deletions src/coldcard.fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ export const coldcardFixtures = {
name: "Test",
addressType: "P2SH",
network: "testnet",
quorum: {
requiredSigners: 2,
totalSigners: 3,
},
requiredSigners: 2,
startingAddressIndex: 5,
extendedPublicKeys: [
{
Expand Down Expand Up @@ -136,7 +133,6 @@ export const coldcardFixtures = {
Name: OWPyFOA1
Policy: 2 of 3
Format: P2SH
Derivation: m/0/0/0/0
77e80477: tpubDF17mBZYUi35iCPDfFAa3jFd23L5ZF49tpS1AS1cEqNwhNaS8qVVD8ZPj67iKEarhPuMapZHuxr7TBDYA4DLxAoz25FN8ksyakdbc2V4X2Q
Derivation: m/45'/1/0/0
Expand All @@ -152,12 +148,23 @@ Derivation: m/45'/1/0/0
Name: Test
Policy: 2 of 3
Format: P2SH
Derivation: m/0/0/0/0
77e80477: tpubDF17mBZYUi35iCPDfFAa3jFd23L5ZF49tpS1AS1cEqNwhNaS8qVVD8ZPj67iKEarhPuMapZHuxr7TBDYA4DLxAoz25FN8ksyakdbc2V4X2Q
Derivation: m/45'/1/0/0
39b12f98: tpubDEzYMGvKjbsnqEsjPvnG1TAxBGvk3EUJ9tqpTjnv6XEHktLASz8omNFS9VfSgbmpQWZefiRisKKCtERgsjsK39S6ueTHRXd8w5kNw8LzBoF
Derivation: m/45'/1/0/0
77d36d3b: tpubDF4Ar5bxLQV9qbr2bZ7N7TYYWNv28kPEChWwyvrrxTMKJjqsYhce79mUkLNiKpW121TshHwjZhZbHmT66oPbwLqxJzcXLyf32ubCJyr4pRR
`,
coldcardConfigDerivation: `# Coldcard Multisig setup file (exported from unchained-wallets)
# https://github.com/unchained-capital/unchained-wallets
# v${COLDCARD_WALLET_CONFIG_VERSION}
#
Name: OWPyFOA1
Policy: 2 of 3
Format: P2SH
Derivation: m/45'/1/0
77e80477: tpubDF17mBZYUi35iCPDfFAa3jFd23L5ZF49tpS1AS1cEqNwhNaS8qVVD8ZPj67iKEarhPuMapZHuxr7TBDYA4DLxAoz25FN8ksyakdbc2V4X2Q\r
39b12f98: tpubDEzYMGvKjbsnqEsjPvnG1TAxBGvk3EUJ9tqpTjnv6XEHktLASz8omNFS9VfSgbmpQWZefiRisKKCtERgsjsK39S6ueTHRXd8w5kNw8LzBoF\r
77d36d3b: tpubDF4Ar5bxLQV9qbr2bZ7N7TYYWNv28kPEChWwyvrrxTMKJjqsYhce79mUkLNiKpW121TshHwjZhZbHmT66oPbwLqxJzcXLyf32ubCJyr4pRR\r
`,
};
Loading

0 comments on commit 96e0363

Please sign in to comment.