diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 43ce6eb..6996a04 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,4 +30,4 @@ jobs: if: success() || failure() run: npm run lint - name: Run Typescript Compilation Check - run: npm run types:check + run: npm run types:check -ws diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f11c02..7986f82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Start test containers - run: docker-compose -f "./test/helpers/docker-compose.yaml" up -d + run: docker-compose -f "./dev/docker-compose.yaml" up -d - name: Setup node uses: actions/setup-node@v3 with: @@ -37,14 +37,14 @@ jobs: max_attempts: 15 command: curl --fail -X GET http://localhost:8094/regtest/api/blocks/tip/height - name: Run unit tests - run: npm run test + run: npm run test --ws env: BITCOIN_RPC_USER: alice BITCOIN_RPC_PASSWORD: password BITCOIN_RPC_HOST: localhost:18443 - name: Fetch esplora logs if: always() - run: docker-compose -f "./test/helpers/docker-compose.yaml" logs esplora + run: docker-compose -f "./dev/docker-compose.yaml" logs esplora - name: Stop test containers if: always() - run: docker-compose -f "./test/helpers/docker-compose.yaml" down + run: docker-compose -f './dev/docker-compose.yaml" down diff --git a/test/helpers/docker-compose.yaml b/dev/docker-compose.yaml similarity index 100% rename from test/helpers/docker-compose.yaml rename to dev/docker-compose.yaml diff --git a/test/helpers/nginx.conf.in b/dev/nginx.conf.in similarity index 100% rename from test/helpers/nginx.conf.in rename to dev/nginx.conf.in diff --git a/jest.config.ts b/jest.config.ts index 361fb92..4898baf 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -2,14 +2,10 @@ module.exports = { preset: 'ts-jest', verbose: true, testEnvironment: 'node', - rootDir: '.', - roots: ['/test/'], testRegex: '.*\\.spec\\.ts$', transform: { '^.+\\.(t|j)s$': 'ts-jest', }, - collectCoverageFrom: ['/src/**/*.(t|j)s'], coveragePathIgnorePatterns: ['.*.spec.ts'], coverageDirectory: './coverage', - testTimeout: 30000, }; diff --git a/package-lock.json b/package-lock.json index eeba566..d838aa0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,33 +1,17 @@ { "name": "silent-pay", - "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "silent-pay", - "version": "0.0.0", "license": "MIT", - "dependencies": { - "axios": "^1.6.3", - "bech32": "^2.0.0", - "bip32": "^4.0.0", - "bip38": "^3.1.1", - "bip39": "^3.1.0", - "bitcoinjs-lib": "^6.1.5", - "buffer": "^6.0.3", - "create-hash": "^1.2.0", - "ecpair": "^2.1.0", - "level": "^8.0.0", - "secp256k1": "^5.0.0", - "tiny-secp256k1": "^2.2.3" - }, + "workspaces": [ + "./packages/*" + ], "devDependencies": { - "@types/bip38": "^3.1.2", - "@types/create-hash": "^1.2.3", "@types/jest": "^29.5.3", "@types/node": "^20.5.0", - "@types/secp256k1": "^4.0.3", "@typescript-eslint/eslint-plugin": "^6.3.0", "@typescript-eslint/parser": "^6.3.0", "eslint": "^8.40.0", @@ -39,9 +23,7 @@ "prettier": "^2.7.1", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^5.0.2", - "vite": "^4.4.5", - "vite-plugin-dts": "^3.5.2" + "typescript": "^5.0.2" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -749,358 +731,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1630,84 +1260,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@microsoft/api-extractor": { - "version": "7.36.4", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.36.4.tgz", - "integrity": "sha512-21UECq8C/8CpHT23yiqTBQ10egKUacIpxkPyYR7hdswo/M5yTWdBvbq+77YC9uPKQJOUfOD1FImBQ1DzpsdeQQ==", - "dev": true, - "dependencies": { - "@microsoft/api-extractor-model": "7.27.6", - "@microsoft/tsdoc": "0.14.2", - "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.59.7", - "@rushstack/rig-package": "0.4.1", - "@rushstack/ts-command-line": "4.15.2", - "colors": "~1.2.1", - "lodash": "~4.17.15", - "resolve": "~1.22.1", - "semver": "~7.5.4", - "source-map": "~0.6.1", - "typescript": "~5.0.4" - }, - "bin": { - "api-extractor": "bin/api-extractor" - } - }, - "node_modules/@microsoft/api-extractor-model": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.27.6.tgz", - "integrity": "sha512-eiCnlayyum1f7fS2nA9pfIod5VCNR1G+Tq84V/ijDrKrOFVa598BLw145nCsGDMoFenV6ajNi2PR5WCwpAxW6Q==", - "dev": true, - "dependencies": { - "@microsoft/tsdoc": "0.14.2", - "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.59.7" - } - }, - "node_modules/@microsoft/api-extractor/node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=12.20" - } - }, - "node_modules/@microsoft/tsdoc": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", - "integrity": "sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==", - "dev": true - }, - "node_modules/@microsoft/tsdoc-config": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.16.2.tgz", - "integrity": "sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==", - "dev": true, - "dependencies": { - "@microsoft/tsdoc": "0.14.2", - "ajv": "~6.12.6", - "jju": "~1.4.0", - "resolve": "~1.19.0" - } - }, - "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, - "dependencies": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/@noble/hashes": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", @@ -1754,73 +1306,6 @@ "node": ">= 8" } }, - "node_modules/@rollup/pluginutils": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.3.tgz", - "integrity": "sha512-hfllNN4a80rwNQ9QCxhxuHCGHMAvabXqxNdaChUSSadMre7t4iEUI6fFAhBOn/eIYTgYVhBv7vCLsAJ4u3lf3g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rushstack/node-core-library": { - "version": "3.59.7", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.59.7.tgz", - "integrity": "sha512-ln1Drq0h+Hwa1JVA65x5mlSgUrBa1uHL+V89FqVWQgXd1vVIMhrtqtWGQrhTnFHxru5ppX+FY39VWELF/FjQCw==", - "dev": true, - "dependencies": { - "colors": "~1.2.1", - "fs-extra": "~7.0.1", - "import-lazy": "~4.0.0", - "jju": "~1.4.0", - "resolve": "~1.22.1", - "semver": "~7.5.4", - "z-schema": "~5.0.2" - }, - "peerDependencies": { - "@types/node": "*" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@rushstack/rig-package": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.4.1.tgz", - "integrity": "sha512-AGRwpqlXNSp9LhUSz4HKI9xCluqQDt/obsQFdv/NYIekF3pTTPzc+HbQsIsjVjYnJ3DcmxOREVMhvrMEjpiq6g==", - "dev": true, - "dependencies": { - "resolve": "~1.22.1", - "strip-json-comments": "~3.1.1" - } - }, - "node_modules/@rushstack/ts-command-line": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.15.2.tgz", - "integrity": "sha512-5+C2uoJY8b+odcZD6coEe2XNC4ZjGB4vCMESbqW/8DHRWC/qIHfANdmN9F1wz/lAgxz72i7xRoVtPY2j7e4gpQ==", - "dev": true, - "dependencies": { - "@types/argparse": "1.0.38", - "argparse": "~1.0.9", - "colors": "~1.2.1", - "string-argv": "~0.3.1" - } - }, "node_modules/@scure/base": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.5.tgz", @@ -1829,6 +1314,22 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@silent-pay/core": { + "resolved": "packages/core", + "link": true + }, + "node_modules/@silent-pay/esplora": { + "resolved": "packages/esplora", + "link": true + }, + "node_modules/@silent-pay/level": { + "resolved": "packages/level", + "link": true + }, + "node_modules/@silent-pay/wallet": { + "resolved": "packages/wallet", + "link": true + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1877,12 +1378,6 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, - "node_modules/@types/argparse": { - "version": "1.0.38", - "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", - "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", - "dev": true - }, "node_modules/@types/babel__core": { "version": "7.20.1", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", @@ -1942,12 +1437,6 @@ "@types/node": "*" } }, - "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true - }, "node_modules/@types/graceful-fs": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", @@ -2189,142 +1678,44 @@ }, "node_modules/@typescript-eslint/utils": { "version": "6.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.3.0.tgz", - "integrity": "sha512-hLLg3BZE07XHnpzglNBG8P/IXq/ZVXraEbgY7FM0Cnc1ehM8RMdn9mat3LubJ3KBeYXXPxV1nugWbQPjGeJk6Q==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.3.0", - "@typescript-eslint/types": "6.3.0", - "@typescript-eslint/typescript-estree": "6.3.0", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.3.0.tgz", - "integrity": "sha512-kEhRRj7HnvaSjux1J9+7dBen15CdWmDnwrpyiHsFX6Qx2iW5LOBUgNefOFeh2PjWPlNwN8TOn6+4eBU3J/gupw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.3.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@volar/language-core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.0.tgz", - "integrity": "sha512-ddyWwSYqcbEZNFHm+Z3NZd6M7Ihjcwl/9B5cZd8kECdimVXUFdFi60XHWD27nrWtUQIsUYIG7Ca1WBwV2u2LSQ==", - "dev": true, - "dependencies": { - "@volar/source-map": "1.10.0" - } - }, - "node_modules/@volar/source-map": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.0.tgz", - "integrity": "sha512-/ibWdcOzDGiq/GM1JU2eX8fH1bvAhl66hfe8yEgLEzg9txgr6qb5sQ/DEz5PcDL75tF5H5sCRRwn8Eu8ezi9mw==", - "dev": true, - "dependencies": { - "muggle-string": "^0.3.1" - } - }, - "node_modules/@volar/typescript": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.0.tgz", - "integrity": "sha512-OtqGtFbUKYC0pLNIk3mHQp5xWnvL1CJIUc9VE39VdZ/oqpoBh5jKfb9uJ45Y4/oP/WYTrif/Uxl1k8VTPz66Gg==", - "dev": true, - "dependencies": { - "@volar/language-core": "1.10.0" - } - }, - "node_modules/@vue/compiler-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", - "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.21.3", - "@vue/shared": "3.3.4", - "estree-walker": "^2.0.2", - "source-map-js": "^1.0.2" - } - }, - "node_modules/@vue/compiler-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", - "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", - "dev": true, - "dependencies": { - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4" - } - }, - "node_modules/@vue/language-core": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.8.tgz", - "integrity": "sha512-i4KMTuPazf48yMdYoebTkgSOJdFraE4pQf0B+FTOFkbB+6hAfjrSou/UmYWRsWyZV6r4Rc6DDZdI39CJwL0rWw==", - "dev": true, - "dependencies": { - "@volar/language-core": "~1.10.0", - "@volar/source-map": "~1.10.0", - "@vue/compiler-dom": "^3.3.0", - "@vue/reactivity": "^3.3.0", - "@vue/shared": "^3.3.0", - "minimatch": "^9.0.0", - "muggle-string": "^0.3.1", - "vue-template-compiler": "^2.7.14" - }, - "peerDependencies": { - "typescript": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@vue/reactivity": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", - "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.3.0.tgz", + "integrity": "sha512-hLLg3BZE07XHnpzglNBG8P/IXq/ZVXraEbgY7FM0Cnc1ehM8RMdn9mat3LubJ3KBeYXXPxV1nugWbQPjGeJk6Q==", "dev": true, "dependencies": { - "@vue/shared": "3.3.4" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.3.0", + "@typescript-eslint/types": "6.3.0", + "@typescript-eslint/typescript-estree": "6.3.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/@vue/shared": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", - "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==", - "dev": true - }, - "node_modules/@vue/typescript": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.8.tgz", - "integrity": "sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.3.0.tgz", + "integrity": "sha512-kEhRRj7HnvaSjux1J9+7dBen15CdWmDnwrpyiHsFX6Qx2iW5LOBUgNefOFeh2PjWPlNwN8TOn6+4eBU3J/gupw==", "dev": true, "dependencies": { - "@volar/typescript": "~1.10.0", - "@vue/language-core": "1.8.8" + "@typescript-eslint/types": "6.3.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/abstract-level": { @@ -2709,15 +2100,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -3115,15 +2497,6 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, - "node_modules/colors": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", - "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3135,16 +2508,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "dev": true, - "optional": true, - "engines": { - "node": "^12.20.0 || >=14" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -3189,12 +2552,6 @@ "node": ">= 8" } }, - "node_modules/de-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", - "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", - "dev": true - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -3369,43 +2726,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" - } - }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -3727,12 +3047,6 @@ "node": ">=4.0" } }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -3964,20 +3278,6 @@ "node": ">= 6" } }, - "node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4193,15 +3493,6 @@ "minimalistic-assert": "^1.0.1" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -4295,15 +3586,6 @@ "node": ">=4" } }, - "node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -5092,12 +4374,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jju": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", - "dev": true - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5159,15 +4435,6 @@ "node": ">=6" } }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -5177,12 +4444,6 @@ "node": ">=6" } }, - "node_modules/kolorist": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz", - "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==", - "dev": true - }, "node_modules/level": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/level/-/level-8.0.0.tgz", @@ -5546,24 +4807,6 @@ "node": ">=8" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "dev": true - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "dev": true - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -5850,21 +5093,6 @@ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, - "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/module-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", @@ -5879,30 +5107,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/muggle-string": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.3.1.tgz", - "integrity": "sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/napi-macros": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", @@ -6183,34 +5387,6 @@ "node": ">=8" } }, - "node_modules/postcss": { - "version": "8.4.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", - "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -6474,22 +5650,6 @@ "inherits": "^2.0.1" } }, - "node_modules/rollup": { - "version": "3.28.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.0.tgz", - "integrity": "sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=14.18.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6691,15 +5851,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-support": { "version": "0.5.13", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", @@ -7075,15 +6226,6 @@ "node": ">=14.0.0" } }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/update-browserslist-db": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", @@ -7154,15 +6296,6 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, - "node_modules/validator": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", - "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/varuint-bitcoin": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", @@ -7171,114 +6304,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", - "dev": true, - "dependencies": { - "esbuild": "^0.18.10", - "postcss": "^8.4.27", - "rollup": "^3.27.1" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - }, - "peerDependencies": { - "@types/node": ">= 14", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-plugin-dts": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.5.2.tgz", - "integrity": "sha512-iKc851+jdHEoN1ifbOEsoMs+/Zg26PE1EyO2Jc+4apOWRoaeK2zRJnaStgUuJaVaEcAjTqWzpNgCAMq7iO6DWA==", - "dev": true, - "dependencies": { - "@microsoft/api-extractor": "^7.36.3", - "@rollup/pluginutils": "^5.0.2", - "@vue/language-core": "^1.8.8", - "debug": "^4.3.4", - "kolorist": "^1.8.0", - "vue-tsc": "^1.8.8" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "typescript": "*", - "vite": "*" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - } - }, - "node_modules/vue-template-compiler": { - "version": "2.7.14", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", - "integrity": "sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==", - "dev": true, - "dependencies": { - "de-indent": "^1.0.2", - "he": "^1.2.0" - } - }, - "node_modules/vue-tsc": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.8.tgz", - "integrity": "sha512-bSydNFQsF7AMvwWsRXD7cBIXaNs/KSjvzWLymq/UtKE36697sboX4EccSHFVxvgdBlI1frYPc/VMKJNB7DFeDQ==", - "dev": true, - "dependencies": { - "@vue/language-core": "1.8.8", - "@vue/typescript": "1.8.8", - "semver": "^7.3.8" - }, - "bin": { - "vue-tsc": "bin/vue-tsc.js" - }, - "peerDependencies": { - "typescript": "*" - } - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -7445,24 +6470,50 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/z-schema": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz", - "integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==", - "dev": true, + "packages/core": { + "version": "0.0.0", + "license": "MIT", "dependencies": { - "lodash.get": "^4.4.2", - "lodash.isequal": "^4.5.0", - "validator": "^13.7.0" - }, - "bin": { - "z-schema": "bin/z-schema" + "bech32": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "buffer": "^6.0.3", + "create-hash": "^1.2.0", + "ecpair": "^2.1.0", + "secp256k1": "^5.0.0" }, - "engines": { - "node": ">=8.0.0" + "devDependencies": { + "@types/create-hash": "^1.2.3", + "@types/secp256k1": "^4.0.3" + } + }, + "packages/esplora": { + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "axios": "^1.6.3" + } + }, + "packages/level": { + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "level": "^8.0.0" + } + }, + "packages/wallet": { + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "bip32": "^4.0.0", + "bip38": "^3.1.1", + "bip39": "^3.1.0", + "bitcoinjs-lib": "^6.1.5", + "buffer": "^6.0.3", + "ecpair": "^2.1.0", + "tiny-secp256k1": "^2.2.3" }, - "optionalDependencies": { - "commander": "^9.4.1" + "devDependencies": { + "@types/bip38": "^3.1.2" } } } diff --git a/package.json b/package.json index 0b92f1a..e1d38fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,5 @@ { "name": "silent-pay", - "version": "0.0.0", - "description": "A Silent Payments library", "author": "Anmol Sharma", "license": "MIT", "homepage": "https://github.com/Bitshala-Incubator/silent-pay", @@ -17,48 +15,17 @@ "bitcoin" ], "type": "module", - "main": "./dist/silent-pay.umd.cjs", - "module": "./dist/silent-pay.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/silent-pay.js", - "require": "./dist/silent-pay.umd.cjs" - } - }, - "files": [ - "dist" + "workspaces": [ + "./packages/*" ], "scripts": { - "build": "tsc && vite build", "format": "prettier --ignore-path .gitignore --loglevel=silent --write \"**/*.+(js|ts|json)\" \"!dist/*\"", "format:check": "prettier --check \"**/*.+(js|ts|json)\" \"!dist/*\"", - "lint": "eslint --ext .js,.ts . --ignore-pattern \"dist/*\"", - "test": "jest", - "test:cov": "jest --coverage", - "test:watch": "jest --watchAll", - "types:check": "tsc --noemit" - }, - "dependencies": { - "axios": "^1.6.3", - "bech32": "^2.0.0", - "bip32": "^4.0.0", - "bip38": "^3.1.1", - "bip39": "^3.1.0", - "bitcoinjs-lib": "^6.1.5", - "buffer": "^6.0.3", - "create-hash": "^1.2.0", - "ecpair": "^2.1.0", - "level": "^8.0.0", - "secp256k1": "^5.0.0", - "tiny-secp256k1": "^2.2.3" + "lint": "eslint --ext .js,.ts . --ignore-pattern \"dist/*\"" }, "devDependencies": { - "@types/bip38": "^3.1.2", - "@types/create-hash": "^1.2.3", "@types/jest": "^29.5.3", "@types/node": "^20.5.0", - "@types/secp256k1": "^4.0.3", "@typescript-eslint/eslint-plugin": "^6.3.0", "@typescript-eslint/parser": "^6.3.0", "eslint": "^8.40.0", @@ -70,14 +37,12 @@ "prettier": "^2.7.1", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^5.0.2", - "vite": "^4.4.5", - "vite-plugin-dts": "^3.5.2" + "typescript": "^5.0.2" }, "lint-staged": { "*.ts": [ "bash -c 'npm run lint'", - "bash -c 'npm run types:check'" + "bash -c 'npm run types:check --ws'" ], "*.{ts,yaml,json}": [ "bash -c 'npm run format'" diff --git a/packages/core/jest.config.ts b/packages/core/jest.config.ts new file mode 100644 index 0000000..79ec01f --- /dev/null +++ b/packages/core/jest.config.ts @@ -0,0 +1,6 @@ +module.exports = { + preset: '../../jest.config.ts', + rootDir: '.', + roots: ['/test/'], + collectCoverageFrom: ['/src/**/*.(t|j)s'], +}; diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..8b8d5a0 --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,43 @@ +{ + "name": "@silent-pay/core", + "version": "0.0.0", + "description": "A library for bitcoin silent payments. This package includes all core functions needed to implement silent payments.", + "main": "dist/core/index.js", + "types": "dist/core/index.d.ts", + "files": [ + "dist/core" + ], + "author": "Anmol Sharma", + "license": "MIT", + "homepage": "https://github.com/Bitshala-Incubator/silent-pay", + "scripts": { + "test": "jest", + "test:cov": "jest --coverage", + "build": "tsc -p tsconfig.build.json", + "types:check": "tsc --noemit --p tsconfig.build.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/Bitshala-Incubator/silent-pay.git" + }, + "bugs": { + "url": "https://github.com/Bitshala-Incubator/silent-pay/issues" + }, + "keywords": [ + "silent payments", + "bitcoin" + ], + "type": "module", + "dependencies": { + "bech32": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "buffer": "^6.0.3", + "create-hash": "^1.2.0", + "ecpair": "^2.1.0", + "secp256k1": "^5.0.0" + }, + "devDependencies": { + "@types/create-hash": "^1.2.3", + "@types/secp256k1": "^4.0.3" + } +} diff --git a/src/core/constants.ts b/packages/core/src/constants.ts similarity index 100% rename from src/core/constants.ts rename to packages/core/src/constants.ts diff --git a/src/core/encoding.ts b/packages/core/src/encoding.ts similarity index 100% rename from src/core/encoding.ts rename to packages/core/src/encoding.ts diff --git a/src/core/index.ts b/packages/core/src/index.ts similarity index 100% rename from src/core/index.ts rename to packages/core/src/index.ts diff --git a/src/core/interface.ts b/packages/core/src/interface.ts similarity index 100% rename from src/core/interface.ts rename to packages/core/src/interface.ts diff --git a/src/core/outputs.ts b/packages/core/src/outputs.ts similarity index 100% rename from src/core/outputs.ts rename to packages/core/src/outputs.ts diff --git a/src/core/scanning.ts b/packages/core/src/scanning.ts similarity index 100% rename from src/core/scanning.ts rename to packages/core/src/scanning.ts diff --git a/src/core/transaction.ts b/packages/core/src/transaction.ts similarity index 100% rename from src/core/transaction.ts rename to packages/core/src/transaction.ts diff --git a/src/core/utility.ts b/packages/core/src/utility.ts similarity index 100% rename from src/core/utility.ts rename to packages/core/src/utility.ts diff --git a/test/encoding.spec.ts b/packages/core/test/encoding.spec.ts similarity index 98% rename from test/encoding.spec.ts rename to packages/core/test/encoding.spec.ts index 6e269c4..2b7fb83 100644 --- a/test/encoding.spec.ts +++ b/packages/core/test/encoding.spec.ts @@ -2,7 +2,7 @@ import { createLabeledSilentPaymentAddress, decodeSilentPaymentAddress, encodeSilentPaymentAddress, -} from '../src/core'; +} from '../src'; import { Buffer } from 'buffer'; import { unlabelled, labelled } from './fixtures/encoding'; diff --git a/test/fixtures/encoding.ts b/packages/core/test/fixtures/encoding.ts similarity index 100% rename from test/fixtures/encoding.ts rename to packages/core/test/fixtures/encoding.ts diff --git a/test/fixtures/outputs.ts b/packages/core/test/fixtures/outputs.ts similarity index 100% rename from test/fixtures/outputs.ts rename to packages/core/test/fixtures/outputs.ts diff --git a/test/fixtures/scanning.ts b/packages/core/test/fixtures/scanning.ts similarity index 100% rename from test/fixtures/scanning.ts rename to packages/core/test/fixtures/scanning.ts diff --git a/test/fixtures/transaction.ts b/packages/core/test/fixtures/transaction.ts similarity index 100% rename from test/fixtures/transaction.ts rename to packages/core/test/fixtures/transaction.ts diff --git a/test/fixtures/utility.ts b/packages/core/test/fixtures/utility.ts similarity index 100% rename from test/fixtures/utility.ts rename to packages/core/test/fixtures/utility.ts diff --git a/test/outputs.spec.ts b/packages/core/test/outputs.spec.ts similarity index 90% rename from test/outputs.spec.ts rename to packages/core/test/outputs.spec.ts index 555d9f6..498c7ca 100644 --- a/test/outputs.spec.ts +++ b/packages/core/test/outputs.spec.ts @@ -1,9 +1,4 @@ -import { - createOutputs, - Outpoint, - PrivateKey, - RecipientAddress, -} from '../src/core'; +import { createOutputs, Outpoint, PrivateKey, RecipientAddress } from '../src'; import { testData } from './fixtures/outputs'; describe('Outputs', () => { diff --git a/test/scanning.spec.ts b/packages/core/test/scanning.spec.ts similarity index 95% rename from test/scanning.spec.ts rename to packages/core/test/scanning.spec.ts index 668c873..97576a7 100644 --- a/test/scanning.spec.ts +++ b/packages/core/test/scanning.spec.ts @@ -1,4 +1,4 @@ -import { scanOutputs, LabelMap } from '../src/core'; +import { scanOutputs, LabelMap } from '../src'; import { Buffer } from 'buffer'; import { testData } from './fixtures/scanning'; diff --git a/test/transaction.spec.ts b/packages/core/test/transaction.spec.ts similarity index 97% rename from test/transaction.spec.ts rename to packages/core/test/transaction.spec.ts index 412d2a7..44dc383 100644 --- a/test/transaction.spec.ts +++ b/packages/core/test/transaction.spec.ts @@ -1,4 +1,4 @@ -import { Transaction } from '../src/core'; +import { Transaction } from '../src'; import { validTransactions } from './fixtures/transaction'; describe('Transaction', () => { diff --git a/test/utility.spec.ts b/packages/core/test/utility.spec.ts similarity index 97% rename from test/utility.spec.ts rename to packages/core/test/utility.spec.ts index 59b895f..4014d43 100644 --- a/test/utility.spec.ts +++ b/packages/core/test/utility.spec.ts @@ -3,7 +3,7 @@ import { hashOutpoints, Outpoint, PrivateKey, -} from '../src/core'; +} from '../src'; import { inputPrivateKeys, outpoints } from './fixtures/utility'; describe('Utility', () => { diff --git a/packages/core/tsconfig.build.json b/packages/core/tsconfig.build.json new file mode 100644 index 0000000..cb3c98f --- /dev/null +++ b/packages/core/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/core" + }, + "include": ["src/**/*"], + "exclude": ["**/*spec.ts"] +} diff --git a/packages/esplora/jest.config.ts b/packages/esplora/jest.config.ts new file mode 100644 index 0000000..79ec01f --- /dev/null +++ b/packages/esplora/jest.config.ts @@ -0,0 +1,6 @@ +module.exports = { + preset: '../../jest.config.ts', + rootDir: '.', + roots: ['/test/'], + collectCoverageFrom: ['/src/**/*.(t|j)s'], +}; diff --git a/packages/esplora/package.json b/packages/esplora/package.json new file mode 100644 index 0000000..621b971 --- /dev/null +++ b/packages/esplora/package.json @@ -0,0 +1,34 @@ +{ + "name": "@silent-pay/esplora", + "version": "0.0.0", + "description": "A library for bitcoin silent payments. This package includes a esplora implementation for the wallet's network interface.", + "main": "dist/esplora/index.js", + "types": "dist/esplora/index.d.ts", + "files": [ + "dist/esplora" + ], + "author": "Anmol Sharma", + "license": "MIT", + "homepage": "https://github.com/Bitshala-Incubator/silent-pay", + "scripts": { + "test": "jest", + "test:cov": "jest --coverage", + "build": "tsc -p tsconfig.build.json", + "types:check": "tsc --noemit -p tsconfig.build.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/Bitshala-Incubator/silent-pay.git" + }, + "bugs": { + "url": "https://github.com/Bitshala-Incubator/silent-pay/issues" + }, + "keywords": [ + "silent payments", + "bitcoin" + ], + "type": "module", + "dependencies": { + "axios": "^1.6.3" + } +} diff --git a/src/wallet/network/esplora.ts b/packages/esplora/src/esplora.ts similarity index 97% rename from src/wallet/network/esplora.ts rename to packages/esplora/src/esplora.ts index 9942bdc..28dd0df 100644 --- a/src/wallet/network/esplora.ts +++ b/packages/esplora/src/esplora.ts @@ -1,9 +1,8 @@ -import { NetworkInterface } from './network.interface.ts'; +import { NetworkInterface, Coin } from '@silent-pay/wallet/src'; import { URL } from 'url'; -import axios, { AxiosError, AxiosRequestConfig } from 'axios'; import { Network } from 'bitcoinjs-lib'; +import axios, { AxiosError, AxiosRequestConfig } from 'axios'; import { regtest, testnet, bitcoin } from 'bitcoinjs-lib/src/networks'; -import { Coin } from '../coin.ts'; export type EsploraConfigOptions = { network: 'testnet' | 'main' | 'regtest'; diff --git a/packages/esplora/src/index.ts b/packages/esplora/src/index.ts new file mode 100644 index 0000000..68fb2cd --- /dev/null +++ b/packages/esplora/src/index.ts @@ -0,0 +1 @@ +export * from './esplora.ts'; diff --git a/test/esplora.spec.ts b/packages/esplora/test/esplora.spec.ts similarity index 94% rename from test/esplora.spec.ts rename to packages/esplora/test/esplora.spec.ts index 3a8359e..fc85be7 100644 --- a/test/esplora.spec.ts +++ b/packages/esplora/test/esplora.spec.ts @@ -1,4 +1,4 @@ -import { EsploraClient } from '../src/wallet'; +import { EsploraClient } from '../src'; describe('EsploraClient', () => { let client: EsploraClient; diff --git a/packages/esplora/tsconfig.build.json b/packages/esplora/tsconfig.build.json new file mode 100644 index 0000000..b190900 --- /dev/null +++ b/packages/esplora/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/level" + }, + "include": ["src/**/*"], + "exclude": ["**/*spec.ts"] +} diff --git a/packages/level/jest.config.ts b/packages/level/jest.config.ts new file mode 100644 index 0000000..79ec01f --- /dev/null +++ b/packages/level/jest.config.ts @@ -0,0 +1,6 @@ +module.exports = { + preset: '../../jest.config.ts', + rootDir: '.', + roots: ['/test/'], + collectCoverageFrom: ['/src/**/*.(t|j)s'], +}; diff --git a/packages/level/package.json b/packages/level/package.json new file mode 100644 index 0000000..845932d --- /dev/null +++ b/packages/level/package.json @@ -0,0 +1,34 @@ +{ + "name": "@silent-pay/level", + "version": "0.0.0", + "description": "A library for bitcoin silent payments. This package includes a level db implementation for the wallet's db interface.", + "main": "dist/level/index.js", + "types": "dist/level/index.d.ts", + "files": [ + "dist/level" + ], + "author": "Anmol Sharma", + "license": "MIT", + "homepage": "https://github.com/Bitshala-Incubator/silent-pay", + "scripts": { + "test": "jest", + "test:cov": "jest --coverage", + "build": "tsc -p tsconfig.build.json", + "types:check": "tsc --noemit -p tsconfig.build.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/Bitshala-Incubator/silent-pay.git" + }, + "bugs": { + "url": "https://github.com/Bitshala-Incubator/silent-pay/issues" + }, + "keywords": [ + "silent payments", + "bitcoin" + ], + "type": "module", + "dependencies": { + "level": "^8.0.0" + } +} diff --git a/src/wallet/db/level/db.ts b/packages/level/src/db.ts similarity index 97% rename from src/wallet/db/level/db.ts rename to packages/level/src/db.ts index 01d83fc..1d2f93e 100644 --- a/src/wallet/db/level/db.ts +++ b/packages/level/src/db.ts @@ -1,7 +1,6 @@ import { Level } from 'level'; import { wdb } from './layout.ts'; -import { DbInterface } from '../db.interface.ts'; -import { Coin } from '../../coin.ts'; +import { Coin, DbInterface } from '@silent-pay/wallet/src'; export type LevelDBConfigOptions = { location: string; diff --git a/src/wallet/db/level/index.ts b/packages/level/src/index.ts similarity index 100% rename from src/wallet/db/level/index.ts rename to packages/level/src/index.ts diff --git a/src/wallet/db/level/layout.ts b/packages/level/src/layout.ts similarity index 100% rename from src/wallet/db/level/layout.ts rename to packages/level/src/layout.ts diff --git a/test/wallet-db.spec.ts b/packages/level/test/wallet-db.spec.ts similarity index 96% rename from test/wallet-db.spec.ts rename to packages/level/test/wallet-db.spec.ts index b2b15d2..ef51cfb 100644 --- a/test/wallet-db.spec.ts +++ b/packages/level/test/wallet-db.spec.ts @@ -1,5 +1,5 @@ -import { WalletDB } from '../src/wallet'; import fs from 'fs'; +import { WalletDB } from '../src'; describe('Wallet DB', () => { let walletDB: WalletDB; diff --git a/packages/level/tsconfig.build.json b/packages/level/tsconfig.build.json new file mode 100644 index 0000000..b190900 --- /dev/null +++ b/packages/level/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/level" + }, + "include": ["src/**/*"], + "exclude": ["**/*spec.ts"] +} diff --git a/packages/wallet/jest.config.ts b/packages/wallet/jest.config.ts new file mode 100644 index 0000000..54bdbdd --- /dev/null +++ b/packages/wallet/jest.config.ts @@ -0,0 +1,7 @@ +module.exports = { + preset: '../../jest.config.ts', + rootDir: '.', + roots: ['/test/'], + collectCoverageFrom: ['/src/**/*.(t|j)s'], + testTimeout: 30000, +}; diff --git a/packages/wallet/package.json b/packages/wallet/package.json new file mode 100644 index 0000000..2cd8d88 --- /dev/null +++ b/packages/wallet/package.json @@ -0,0 +1,43 @@ +{ + "name": "@silent-pay/wallet", + "version": "0.0.0", + "description": "A library for bitcoin silent payments. This package includes a wallet for sending, receiving and spending silent payments.", + "main": "dist/wallet/index.js", + "types": "dist/wallet/index.d.ts", + "files": [ + "dist/wallet" + ], + "author": "Anmol Sharma", + "license": "MIT", + "homepage": "https://github.com/Bitshala-Incubator/silent-pay", + "scripts": { + "test": "jest", + "test:cov": "jest --coverage", + "build": "tsc -p tsconfig.build.json", + "types:check": "tsc --noemit -p tsconfig.build.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/Bitshala-Incubator/silent-pay.git" + }, + "bugs": { + "url": "https://github.com/Bitshala-Incubator/silent-pay/issues" + }, + "keywords": [ + "silent payments", + "bitcoin" + ], + "type": "module", + "dependencies": { + "bitcoinjs-lib": "^6.1.5", + "bip32": "^4.0.0", + "bip38": "^3.1.1", + "bip39": "^3.1.0", + "buffer": "^6.0.3", + "ecpair": "^2.1.0", + "tiny-secp256k1": "^2.2.3" + }, + "devDependencies": { + "@types/bip38": "^3.1.2" + } +} diff --git a/src/wallet/coin-selector.ts b/packages/wallet/src/coin-selector.ts similarity index 100% rename from src/wallet/coin-selector.ts rename to packages/wallet/src/coin-selector.ts diff --git a/src/wallet/coin.ts b/packages/wallet/src/coin.ts similarity index 100% rename from src/wallet/coin.ts rename to packages/wallet/src/coin.ts diff --git a/src/wallet/consensus.ts b/packages/wallet/src/consensus.ts similarity index 100% rename from src/wallet/consensus.ts rename to packages/wallet/src/consensus.ts diff --git a/src/wallet/db/db.interface.ts b/packages/wallet/src/db.interface.ts similarity index 96% rename from src/wallet/db/db.interface.ts rename to packages/wallet/src/db.interface.ts index b106dee..5d7c79c 100644 --- a/src/wallet/db/db.interface.ts +++ b/packages/wallet/src/db.interface.ts @@ -1,4 +1,4 @@ -import { Coin } from '../coin.ts'; +import { Coin } from './coin.ts'; export type DbInterface = { open(): Promise; diff --git a/packages/wallet/src/index.ts b/packages/wallet/src/index.ts new file mode 100644 index 0000000..e53d69d --- /dev/null +++ b/packages/wallet/src/index.ts @@ -0,0 +1,5 @@ +export * from './db.interface.ts'; +export * from './network.interface.ts'; +export * from './coin.ts'; +export * from './coin-selector.ts'; +export * from './wallet.ts'; diff --git a/src/wallet/network/network.interface.ts b/packages/wallet/src/network.interface.ts similarity index 91% rename from src/wallet/network/network.interface.ts rename to packages/wallet/src/network.interface.ts index 61278dd..63e7d8f 100644 --- a/src/wallet/network/network.interface.ts +++ b/packages/wallet/src/network.interface.ts @@ -1,5 +1,5 @@ import { Network } from 'bitcoinjs-lib'; -import { Coin } from '../coin.ts'; +import { Coin } from './coin.ts'; export type NetworkInterface = { get network(): Network; diff --git a/src/wallet/wallet.ts b/packages/wallet/src/wallet.ts similarity index 96% rename from src/wallet/wallet.ts rename to packages/wallet/src/wallet.ts index 320f7e4..decd3ba 100644 --- a/src/wallet/wallet.ts +++ b/packages/wallet/src/wallet.ts @@ -1,17 +1,17 @@ -import { DbInterface } from './db'; -import { NetworkInterface } from './network'; import { mnemonicToSeedSync } from 'bip39'; import { initEccLib, payments, Psbt, Transaction } from 'bitcoinjs-lib'; import BIP32Factory, { BIP32Interface } from 'bip32'; import * as ecc from 'tiny-secp256k1'; import { Buffer } from 'buffer'; import { fromOutputScript, toOutputScript } from 'bitcoinjs-lib/src/address'; -import { CoinSelector } from './coin-selector.ts'; -import { Coin } from './coin.ts'; import { ECPairFactory } from 'ecpair'; -import { createOutputs, encodeSilentPaymentAddress } from '../core'; import { toXOnly } from 'bitcoinjs-lib/src/psbt/bip371'; import { encrypt, decrypt } from 'bip38'; +import { + createOutputs, + encodeSilentPaymentAddress, +} from '@silent-pay/core/src'; +import { NetworkInterface, DbInterface, Coin, CoinSelector } from './index.ts'; initEccLib(ecc); const ECPair = ECPairFactory(ecc); @@ -78,9 +78,7 @@ export class Wallet { async setPassword(newPassword: string) { if (!this.masterKey) { - throw new Error( - 'Wallet not initialized. Please call wallet.init()', - ); + throw new Error('Wallet not initialized. Please call src.init()'); } else { const encryptedPrivateKey = encrypt( this.masterKey.privateKey, diff --git a/test/helpers/bitcoin-rpc-client.ts b/packages/wallet/test/helpers/bitcoin-rpc-client.ts similarity index 100% rename from test/helpers/bitcoin-rpc-client.ts rename to packages/wallet/test/helpers/bitcoin-rpc-client.ts diff --git a/test/wallet.spec.ts b/packages/wallet/test/wallet.spec.ts similarity index 97% rename from test/wallet.spec.ts rename to packages/wallet/test/wallet.spec.ts index 90c047e..6e8b0d3 100644 --- a/test/wallet.spec.ts +++ b/packages/wallet/test/wallet.spec.ts @@ -1,6 +1,8 @@ -import { EsploraClient, Wallet, WalletDB } from '../src/wallet'; import * as fs from 'fs'; import { BitcoinRpcClient } from './helpers/bitcoin-rpc-client'; +import { Wallet } from '../src'; +import { WalletDB } from '@silent-pay/level/src'; +import { EsploraClient } from '@silent-pay/esplora/src'; describe('Wallet', () => { let wallet: Wallet; diff --git a/packages/wallet/tsconfig.build.json b/packages/wallet/tsconfig.build.json new file mode 100644 index 0000000..644a615 --- /dev/null +++ b/packages/wallet/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/wallet" + }, + "include": ["src/**/*"], + "exclude": ["**/*spec.ts"] +} diff --git a/src/wallet/db/index.ts b/src/wallet/db/index.ts deleted file mode 100644 index e92aa6d..0000000 --- a/src/wallet/db/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './db.interface.ts'; -export * from './level'; diff --git a/src/wallet/index.ts b/src/wallet/index.ts deleted file mode 100644 index f2b6ceb..0000000 --- a/src/wallet/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './db'; -export * from './network'; -export * from './wallet'; diff --git a/src/wallet/network/index.ts b/src/wallet/network/index.ts deleted file mode 100644 index e8a87fd..0000000 --- a/src/wallet/network/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './esplora.ts'; -export * from './network.interface.ts';