diff --git a/imports.js b/imports.js index 0ae52e6..2dbf5db 100644 --- a/imports.js +++ b/imports.js @@ -1,30 +1,39 @@ // @ts-nocheck +import './secp.js'; + +import './node_modules/@dashincubator/base58check/base58check.js'; +import './node_modules/@dashincubator/ripemd160/ripemd160.js'; import './node_modules/dashkeys/dashkeys.js'; import './node_modules/dashhd/dashhd.js'; +import './node_modules/dashtx/dashtx.js'; import './node_modules/dashphrase/dashphrase.js'; import './node_modules/dashsight/dashsight.js'; import './node_modules/dashsight/dashsocket.js'; +import './node_modules/crowdnode/dashcore-lit.js'; import './node_modules/crowdnode/dashapi.js'; import './node_modules/crowdnode/crowdnode.js'; -import './node_modules/@dashincubator/secp256k1/secp256k1.js'; -import './node_modules/@dashincubator/base58check/base58check.js'; -import './node_modules/crypticstorage/crypticstorage.js' +import './node_modules/crypticstorage/cryptic.js'; +import './node_modules/crypticstorage/storage.js'; // import './node_modules/qrcode-svg/dist/qrcode.min.js'; -import * as DashKeysTypes from './node_modules/dashkeys/dashkeys.js'; +import * as DashTxTypes from './node_modules/dashtx/dashtx.js'; import * as DashHDTypes from './node_modules/dashhd/dashhd.js'; +import * as DashKeysTypes from './node_modules/dashkeys/dashkeys.js'; import * as DashPhraseTypes from './node_modules/dashphrase/dashphrase.js'; import * as DashSightTypes from './node_modules/dashsight/dashsight.js'; import * as DashSocketTypes from './node_modules/dashsight/dashsocket.js'; +import * as DashCoreTypes from './node_modules/crowdnode/dashcore-lit.js'; import * as DashApiTypes from './node_modules/crowdnode/dashapi.js'; import * as CrowdNodeTypes from './node_modules/crowdnode/crowdnode.js'; -import * as Secp256k1Types from './node_modules/@dashincubator/secp256k1/secp256k1.js' -import * as Base58CheckTypes from './node_modules/@dashincubator/base58check/base58check.js' import * as RIPEMD160Types from './node_modules/@dashincubator/ripemd160/ripemd160.js' -import * as CrypticStorageTypes from './node_modules/crypticstorage/crypticstorage.js' +import * as Base58CheckTypes from './node_modules/@dashincubator/base58check/base58check.js' +import * as CrypticTypes from '../node_modules/crypticstorage/cryptic.js'; +import * as CrypticStorageTypes from '../node_modules/crypticstorage/storage.js'; // import * as QRCodeTypes from './node_modules/qrcode-svg/dist/qrcode.min.js' +/** @type {DashTxTypes} */ +export let DashTx = window?.DashTx || globalThis?.DashTx; /** @type {DashKeysTypes} */ export let DashKeys = window?.DashKeys || globalThis?.DashKeys /** @type {DashHDTypes} */ @@ -35,32 +44,41 @@ export let DashPhrase = window?.DashPhrase || globalThis?.DashPhrase export let DashSight = window?.DashSight || globalThis?.DashSight /** @type {DashSocketTypes} */ export let DashSocket = window?.DashSocket || globalThis?.DashSocket +/** @type {DashCoreTypes} */ +export let DashCore = window?.DashCore || globalThis?.DashCore /** @type {DashApiTypes} */ export let DashApi = window?.DashApi || globalThis?.DashApi /** @type {CrowdNodeTypes} */ export let CrowdNode = window?.CrowdNode || globalThis?.CrowdNode -/** @type {Secp256k1Types} */ -export let Secp256k1 = window?.nobleSecp256k1 || globalThis?.nobleSecp256k1 /** @type {Base58CheckTypes} */ export let Base58Check = window?.Base58Check || globalThis?.Base58Check /** @type {RIPEMD160Types} */ export let RIPEMD160 = window?.RIPEMD160 || globalThis?.RIPEMD160 +/** @type {CrypticTypes} */ +export let Cryptic = + window?.Cryptic || globalThis?.Cryptic; /** @type {CrypticStorageTypes} */ -export let CrypticStorage = window?.CrypticStorage || globalThis?.CrypticStorage; +export let CrypticStorage = + window?.CrypticStorage || globalThis?.CrypticStorage; // /** @type {QRCodeTypes} */ // export let QRCode = QRCodeTypes || window?.QRCode || globalThis?.QRCode +export let Secp256k1 = window?.nobleSecp256k1 || globalThis?.nobleSecp256k1 || window?.Secp256k1 || globalThis?.Secp256k1 + export default { + DashTx, DashHd, DashPhrase, DashKeys, DashSight, DashSocket, + DashCore, DashApi, CrowdNode, Secp256k1, Base58Check, RIPEMD160, + Cryptic, CrypticStorage, // QRCode, } diff --git a/index.html b/index.html index 0b636b8..7dbf556 100644 --- a/index.html +++ b/index.html @@ -295,18 +295,25 @@
Checkout the - + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2f67173..7896ae9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,45 +9,26 @@ "version": "0.0.6", "license": "MIT", "dependencies": { - "@dashevo/dashcore-lib": "^0.19.44", - "@dashincubator/base58check": "^1.3.2", + "@dashincubator/base58check": "^1.4.1", "@dashincubator/ripemd160": "^3.0.0", - "@dashincubator/secp256k1": "^1.7.1-5", - "crowdnode": "^1.8.0", - "crypticstorage": "dashhive/CrypticStorage", - "dashhd": "3.0.5", - "dashkeys": "1.0.0", - "dashphrase": "1.3.9", - "dashsight": "^1.4.0-2", + "@noble/secp256k1": "^1.7.1", + "crowdnode": "dashhive/crowdnode.js#ref-dashtx", + "crypticstorage": "^0.0.2", + "dashhd": "3.3.3", + "dashkeys": "1.1.4", + "dashphrase": "1.4.0", + "dashsight": "^1.6.1", + "dashtx": "^0.16.0", "qrcode-svg": "^1.1.0" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@dashevo/dashcore-lib": { - "version": "0.19.44", - "license": "MIT", - "dependencies": { - "@dashevo/x11-hash-js": "^1.0.2", - "@types/node": "^12.12.47", - "bloom-filter": "^0.2.0", - "bls-signatures": "^0.2.5", - "bn.js": "^4.12.0", - "bs58": "=4.0.1", - "elliptic": "^6.5.4", - "inherits": "=2.0.1", - "lodash": "^4.17.20", - "ripemd160": "^2.0.2", - "unorm": "^1.6.0" - } - }, - "node_modules/@dashevo/x11-hash-js": { - "version": "1.0.2", - "license": "MIT" - }, "node_modules/@dashincubator/base58check": { - "version": "1.3.2", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@dashincubator/base58check/-/base58check-1.4.1.tgz", + "integrity": "sha512-JSAO+viM3pVgM93XSBAUhLvK18BlRIsmYU4eGuyrj1lz3Xa1oplSel94oG0SI5d2qTxdy0NfGT3vEFbiKpfj5Q==", "license": "SEE LICENSE IN LICENSE", "bin": { "base58check": "bin/base58check.js" @@ -55,108 +36,89 @@ }, "node_modules/@dashincubator/ripemd160": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@dashincubator/ripemd160/-/ripemd160-3.0.0.tgz", + "integrity": "sha512-EbdXcceP2mW76NchCKp8UYNbZgWkLuV4Mbi30G82xRED32ljJzXsKaaVdzU0oVo2fVzPRXF1GhSF6Lq9beTVvA==", "license": "MIT" }, "node_modules/@dashincubator/secp256k1": { "version": "1.7.1-5", - "license": "MIT" - }, - "node_modules/@root/request": { - "version": "1.9.2", - "license": "(MIT OR Apache-2.0)" - }, - "node_modules/@types/node": { - "version": "12.20.55", - "license": "MIT" - }, - "node_modules/base-x": { - "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@dashincubator/secp256k1/-/secp256k1-1.7.1-5.tgz", + "integrity": "sha512-3iA+RDZrJsRFPpWhlYkp3EdoFAlKjdqkNFiRwajMrzcpA/G/IBX0AnC1pwRLkTrM+tUowcyGrkJfT03U4ETZeg==", "license": "MIT", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/bloom-filter": { - "version": "0.2.0" - }, - "node_modules/bls-signatures": { - "version": "0.2.5" - }, - "node_modules/bn.js": { - "version": "4.12.0", - "license": "MIT" + "optional": true }, - "node_modules/brorand": { - "version": "1.1.0", + "node_modules/@noble/secp256k1": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", + "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "license": "MIT" }, - "node_modules/bs58": { - "version": "4.0.1", - "license": "MIT", - "dependencies": { - "base-x": "^3.0.2" - } + "node_modules/@root/request": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@root/request/-/request-1.9.2.tgz", + "integrity": "sha512-wVaL9yVV9oDR9UNbPZa20qgY+4Ch6YN8JUkaE4el/uuS5dmhD8Lusm/ku8qJVNtmQA56XLzEDCRS6/vfpiHK2A==", + "license": "(MIT OR Apache-2.0)", + "optional": true }, "node_modules/crowdnode": { "version": "1.8.0", + "resolved": "git+ssh://git@github.com/dashhive/crowdnode.js.git#112b81844abfd2f7d64d66e8418088564fffc2d2", "license": "SEE LICENSE IN LICENSE", - "dependencies": { - "@dashevo/dashcore-lib": "^0.19.41", - "dashsight": "^1.3.0-0" - }, "bin": { "crowdnode": "bin/crowdnode.js" }, "optionalDependencies": { - "@root/request": "^1.9.1", - "dotenv": "^16.0.1", + "@dashincubator/base58check": "^1.4.1", + "@dashincubator/ripemd160": "^3.0.0", + "@dashincubator/secp256k1": "^1.7.1-5", + "@root/request": "^1.9.2", + "dashhd": "^3.3.3", + "dashkeys": "^1.1.4", + "dashsight": "^1.6.1", + "dashtx": "^0.16.0", + "dotenv": "^16.4.5", "qrcode-svg": "^1.1.0", - "tough-cookie": "^4.0.0", - "ws": "^8.8.0" - } - }, - "node_modules/crowdnode/node_modules/dashsight": { - "version": "1.3.5", - "license": "SEE LICENSE IN LICENSE", - "dependencies": { - "@root/request": "^1.9.2" - }, - "bin": { - "dashsight-balance": "bin/balance.js", - "dashsight-instantsend": "bin/instantsend.js", - "dashsight-tx": "bin/tx.js", - "dashsight-txs": "bin/txs.js", - "dashsight-utxos": "bin/utxos.js" - }, - "optionalDependencies": { - "dotenv": "^16.0.1" + "tough-cookie": "^4.1.4", + "ws": "^8.18.0" } }, "node_modules/crypticstorage": { - "version": "0.0.0", - "resolved": "git+ssh://git@github.com/dashhive/CrypticStorage.git#a695b8ef78360a34d94a040ba356a1565f34630b", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypticstorage/-/crypticstorage-0.0.2.tgz", + "integrity": "sha512-PyiKq03ekJU1AwzYVchlm+LaUvDy939S1smmCD0fa60HLKVM0m6zEj4J/MXcm1BLrwdaZk9eRdJcau77nIOPAw==", "license": "MIT" }, "node_modules/dashhd": { - "version": "3.0.5", - "license": "SEE LICENSE IN LICENSE", - "dependencies": { - "dashkeys": "^1.0.0" - } + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/dashhd/-/dashhd-3.3.3.tgz", + "integrity": "sha512-sbhLV8EtmebnlIdx/d1hcbnxdfka/0rcLx+UO5y44kZdu5tyJ5ftBFbhhIb38vd+T+Xfcwpeo0z+0ZDznRkfaw==", + "license": "SEE LICENSE IN LICENSE" }, "node_modules/dashkeys": { - "version": "1.0.0", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/dashkeys/-/dashkeys-1.1.4.tgz", + "integrity": "sha512-y62hg+r8V56gqUfvnyNqCmQ0MvA/wGmRPWfuKFKDCZY02dvWkhCD0zBRVpBGPjfk+T2gWKbkcrHOCrb2RXZ9cw==", "license": "SEE LICENSE IN LICENSE" }, "node_modules/dashphrase": { - "version": "1.3.9", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/dashphrase/-/dashphrase-1.4.0.tgz", + "integrity": "sha512-o+LdiPkiYmg07kXBE+2bbcJzBmeTQVPn1GS2XlQeo8lene+KknAprSyiYi5XtqV/QVgNjvzOV7qBst2MijSPAA==", "license": "SEE LICENSE IN LICENSE" }, "node_modules/dashsight": { - "version": "1.4.0-2", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/dashsight/-/dashsight-1.6.1.tgz", + "integrity": "sha512-FCGeFO9NIic+Gzr9DwLTLY19xripHMbd3dHIrt+tXULHPaoBYs2P1GARqKuvYMWR0m+QXOcODs8Czlih6wXNYg==", "license": "SEE LICENSE IN LICENSE", "dependencies": { - "@root/request": "^1.9.2" + "dashtx": "^0.9.0-3" }, "bin": { "dashsight-balance": "bin/balance.js", @@ -169,91 +131,48 @@ "dotenv": "^16.0.1" } }, + "node_modules/dashsight/node_modules/dashtx": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/dashtx/-/dashtx-0.9.0.tgz", + "integrity": "sha512-DDbH5vPChUpOrYMOoM+6g/Iy99KqG4nkJ6f8TphnGibzAY7mitjMgtFSc62YzbZdoPGYeSPm8N4jmz+Mbwm7Eg==", + "license": "SEE LICENSE IN LICENSE", + "bin": { + "dashtx-inspect": "bin/inspect.js" + } + }, + "node_modules/dashtx": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/dashtx/-/dashtx-0.16.0.tgz", + "integrity": "sha512-YyLYzq8OPBLAU2DYmQEk0KXqAZkpQcNYXmZEBHJUjeRNEU4q9xDVK1Tqj3AUekQ2E71Ccyn1xp07zdU9XVD7WA==", + "license": "SEE LICENSE IN LICENSE", + "bin": { + "dashtx-inspect": "bin/inspect.js" + } + }, "node_modules/dotenv": { - "version": "16.0.3", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "license": "BSD-2-Clause", "optional": true, "engines": { "node": ">=12" - } - }, - "node_modules/elliptic": { - "version": "6.5.4", - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/inherits": { - "version": "2.0.4", - "license": "ISC" - }, - "node_modules/hash-base": { - "version": "3.1.0", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash-base/node_modules/inherits": { - "version": "2.0.4", - "license": "ISC" - }, - "node_modules/hash.js": { - "version": "1.1.7", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hash.js/node_modules/inherits": { - "version": "2.0.4", - "license": "ISC" - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "license": "MIT", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "funding": { + "url": "https://dotenvx.com" } }, - "node_modules/inherits": { - "version": "2.0.1", - "license": "ISC" - }, - "node_modules/lodash": { - "version": "4.17.21", - "license": "MIT" - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "license": "ISC" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "license": "MIT" - }, "node_modules/psl": { "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "license": "MIT", "optional": true }, "node_modules/punycode": { - "version": "2.3.0", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", "optional": true, "engines": { @@ -262,6 +181,8 @@ }, "node_modules/qrcode-svg": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/qrcode-svg/-/qrcode-svg-1.1.0.tgz", + "integrity": "sha512-XyQCIXux1zEIA3NPb0AeR8UMYvXZzWEhgdBgBjH9gO7M48H9uoHzviNz8pXw3UzrAcxRRRn9gxHewAVK7bn9qw==", "license": "MIT", "bin": { "qrcode-svg": "bin/qrcode-svg.js" @@ -269,65 +190,22 @@ }, "node_modules/querystringify": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "license": "MIT", "optional": true }, - "node_modules/readable-stream": { - "version": "3.6.0", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readable-stream/node_modules/inherits": { - "version": "2.0.4", - "license": "ISC" - }, "node_modules/requires-port": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "license": "MIT", "optional": true }, - "node_modules/ripemd160": { - "version": "2.0.2", - "license": "MIT", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/tough-cookie": { - "version": "4.1.2", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "license": "BSD-3-Clause", "optional": true, "dependencies": { @@ -342,21 +220,18 @@ }, "node_modules/universalify": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "license": "MIT", "optional": true, "engines": { "node": ">= 4.0.0" } }, - "node_modules/unorm": { - "version": "1.6.0", - "license": "MIT or GPL-2.0", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "license": "MIT", "optional": true, "dependencies": { @@ -364,12 +239,10 @@ "requires-port": "^1.0.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "license": "MIT" - }, "node_modules/ws": { - "version": "8.12.0", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "license": "MIT", "optional": true, "engines": { diff --git a/package.json b/package.json index 74439d5..6a36f9e 100644 --- a/package.json +++ b/package.json @@ -25,23 +25,23 @@ "private": true, "main": "index.html", "scripts": { - "start": "npx sirv-cli -D -s --http2 --key ~/localhost.key.pem --cert ~/localhost.pem -p 5443 .", + "start": "npx sirv-cli -D -s --http2 --key ~/localhost.key.pem --cert ~/localhost.pem -p 5463 .", "http": "npx sirv-cli -p 5453 ." }, "engines": { "node": ">=18.0.0" }, "dependencies": { - "@dashevo/dashcore-lib": "^0.19.44", - "@dashincubator/base58check": "^1.3.2", + "@dashincubator/base58check": "^1.4.1", "@dashincubator/ripemd160": "^3.0.0", - "@dashincubator/secp256k1": "^1.7.1-5", - "crowdnode": "^1.8.0", - "dashhd": "3.0.5", - "dashkeys": "1.0.0", - "dashphrase": "1.3.9", - "dashsight": "^1.4.0-2", + "@noble/secp256k1": "^1.7.1", + "crowdnode": "dashhive/crowdnode.js#ref-dashtx", + "dashhd": "3.3.3", + "dashkeys": "1.1.4", + "dashphrase": "1.4.0", + "dashsight": "^1.6.1", + "dashtx": "^0.16.0", "qrcode-svg": "^1.1.0", - "crypticstorage": "dashhive/CrypticStorage" + "crypticstorage": "^0.0.2" } } diff --git a/secp.js b/secp.js new file mode 100644 index 0000000..ad254ac --- /dev/null +++ b/secp.js @@ -0,0 +1,10 @@ +import * as secp from './node_modules/@noble/secp256k1/lib/esm/index.js'; + +// @ts-ignore +window.Secp256k1 = secp +// @ts-ignore +window.nobleSecp256k1 = secp + +export const Secp256k1 = secp + +export default secp diff --git a/sw.js b/sw.js index 9379ab7..8c3334e 100644 --- a/sw.js +++ b/sw.js @@ -8,10 +8,13 @@ let fileCache = [ 'index.css', 'main.js', 'sw.js', + 'CryptStore.js', + 'webcrypto.js', 'imports.js', - 'qr.js', 'types.js', 'utils.js', + 'secp.js', + 'qr.js', 'lib/ui.js', 'lib/storage.js', 'components/format-to-dash.js', @@ -30,7 +33,7 @@ let fileCache = [ 'components/forms/stake.js', 'components/forms/unstake.js', 'components/forms/withdraw.js', - 'node_modules/@dashevo/dashcore-lib/dist/dashcore-lib.min.js', + // 'node_modules/@dashevo/dashcore-lib/dist/dashcore-lib.min.js', 'node_modules/@root/request/urequest.js', 'node_modules/qrcode-svg/dist/qrcode.min.js', 'node_modules/dashkeys/dashkeys.js', @@ -40,7 +43,8 @@ let fileCache = [ 'node_modules/dashsight/dashsocket.js', 'node_modules/crowdnode/dashapi.js', 'node_modules/crowdnode/crowdnode.js', - 'node_modules/@dashincubator/secp256k1/secp256k1.js', + 'node_modules/@noble/secp256k1/lib/esm/index.js', + // 'node_modules/@dashincubator/secp256k1/secp256k1.js', 'node_modules/@dashincubator/base58check/base58check.js', 'node_modules/@dashincubator/ripemd160/ripemd160.js', 'node_modules/crypticstorage/crypticstorage.js', diff --git a/webcrypto.js b/webcrypto.js new file mode 100644 index 0000000..e07041a --- /dev/null +++ b/webcrypto.js @@ -0,0 +1,8 @@ +// @noble/secp256k1 v1.7.1 imports the `crypto` module +// This exports the browsers `window.crypto` so that +// it can be used in an import map to fix `@noble/secp256k1` +// @dashincubator/secp256k1 was being used but it many commits behind + +export const crypto = window?.crypto || globalThis?.crypto + +export default crypto \ No newline at end of file