diff --git a/sigma-js/jest.config.js b/sigma-js/jest.config.js index 3c69644eec..addeb82443 100644 --- a/sigma-js/jest.config.js +++ b/sigma-js/jest.config.js @@ -1,11 +1,12 @@ /** @type {import("jest").Config} */ const config = { - transform: {}, // reduce non-cached test time by about 20x by disabling babel code transformation - moduleDirectories: ["/node_modules"], - moduleNameMapper: { - "sigmastate-js/main": - "/../sc/js/target/scala-2.13/sc-fastopt/main.js", - }, -}; - -module.exports = config; + transform: {}, // reduce non-cached test time by about 20x by disabling babel code transformation + moduleDirectories: ["/node_modules"], + moduleNameMapper: { + "sigmastate-js/main": + "/../sc/js/target/scala-2.13/sc-fastopt/main.js", + }, + }; + + module.exports = config; + \ No newline at end of file diff --git a/sigma-js/package-lock.json b/sigma-js/package-lock.json index c34f802f6e..7782470c01 100644 --- a/sigma-js/package-lock.json +++ b/sigma-js/package-lock.json @@ -1,17 +1,18 @@ { "name": "sigmastate-js", - "version": "0.4.0", + "version": "0.4.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sigmastate-js", - "version": "0.4.0", + "version": "0.4.6", "license": "MIT", "dependencies": { "@fleet-sdk/common": "0.1.3", + "@fleet-sdk/core": "^0.4.1", "@noble/hashes": "1.1.4", - "sigmajs-crypto-facade": "0.0.7" + "bip39": "^3.1.0" }, "devDependencies": { "jest": "^29.0.3", @@ -33,12 +34,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -90,14 +92,14 @@ "dev": true }, "node_modules/@babel/generator": { - "version": "7.22.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz", - "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -124,34 +126,37 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", "dev": true, "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -210,30 +215,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -263,14 +268,15 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -348,9 +354,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", - "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -537,34 +543,34 @@ } }, "node_modules/@babel/template": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.22.8", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz", - "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.7", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.7", - "@babel/types": "^7.22.5", - "debug": "^4.1.0", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", + "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -572,13 +578,13 @@ } }, "node_modules/@babel/types": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -599,6 +605,79 @@ "node": ">=14" } }, + "node_modules/@fleet-sdk/core": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/core/-/core-0.4.1.tgz", + "integrity": "sha512-GHjeDH+VtYGwhEQDmqfKajaYPKImxF+L1OpLTwzKJQS3tL7XKtNJIPXt/GAiedGhFij9Go2SDwO6mBUoWiDNxQ==", + "dependencies": { + "@fleet-sdk/common": "^0.4.1", + "@fleet-sdk/crypto": "^0.4.1", + "@fleet-sdk/serializer": "^0.4.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@fleet-sdk/core/node_modules/@fleet-sdk/common": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/common/-/common-0.4.1.tgz", + "integrity": "sha512-jivyBz7kAye1FrS2gDlZkVpu7rrWAw1aySX+OkIWJA703P9BrrAEmBGU0jz4tKL+3LY2CsJhulOlpSAuc3/ivQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@fleet-sdk/crypto": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/crypto/-/crypto-0.4.1.tgz", + "integrity": "sha512-emv3rx+b/WYunUfQwzal09xlMM7+Lii/7h2Yi09L97ab3UftFH6ykeuJgXBhzC1S/dTUtysHRnJOvEhhhG6TkA==", + "dependencies": { + "@fleet-sdk/common": "^0.4.1", + "@noble/hashes": "^1.4.0", + "@scure/base": "^1.1.6" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@fleet-sdk/crypto/node_modules/@fleet-sdk/common": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/common/-/common-0.4.1.tgz", + "integrity": "sha512-jivyBz7kAye1FrS2gDlZkVpu7rrWAw1aySX+OkIWJA703P9BrrAEmBGU0jz4tKL+3LY2CsJhulOlpSAuc3/ivQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@fleet-sdk/crypto/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@fleet-sdk/serializer": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/serializer/-/serializer-0.4.1.tgz", + "integrity": "sha512-zhqyf6hCbpnwD3Qr1/PcpJnd7KucGKpbu5aAb43pnwK4Ju4yKGP+btHKasoylHnOVa7IEA6hY4PuQBcK3SK62A==", + "dependencies": { + "@fleet-sdk/common": "^0.4.1", + "@fleet-sdk/crypto": "^0.4.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@fleet-sdk/serializer/node_modules/@fleet-sdk/common": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/common/-/common-0.4.1.tgz", + "integrity": "sha512-jivyBz7kAye1FrS2gDlZkVpu7rrWAw1aySX+OkIWJA703P9BrrAEmBGU0jz4tKL+3LY2CsJhulOlpSAuc3/ivQ==", + "engines": { + "node": ">=14" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -903,14 +982,14 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -926,9 +1005,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" @@ -941,21 +1020,15 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, "node_modules/@noble/hashes": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.4.tgz", @@ -967,6 +1040,14 @@ } ] }, + "node_modules/@scure/base": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", + "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1256,6 +1337,25 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/bip39": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz", + "integrity": "sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==", + "dependencies": { + "@noble/hashes": "^1.2.0" + } + }, + "node_modules/bip39/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1267,12 +1367,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1662,9 +1762,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -3162,17 +3262,6 @@ "node": ">=6" } }, - "node_modules/sigmajs-crypto-facade": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/sigmajs-crypto-facade/-/sigmajs-crypto-facade-0.0.7.tgz", - "integrity": "sha512-4XK8ZS9NKAbo8aGnU6o5GkBW6Upl8+OK8A1KreVDMAamfvZ0iq4LoVH8rHaeEPf9moVtaC4QZY5RYI+0OwiydA==", - "dependencies": { - "@noble/hashes": "^1.1.4" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -3576,12 +3665,13 @@ } }, "@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "requires": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" } }, "@babel/compat-data": { @@ -3622,14 +3712,14 @@ } }, "@babel/generator": { - "version": "7.22.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz", - "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", "dev": true, "requires": { - "@babel/types": "^7.22.5", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" } }, @@ -3647,28 +3737,31 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", - "dev": true + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dev": true, + "requires": { + "@babel/types": "^7.24.7" + } }, "@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", "dev": true, "requires": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } }, "@babel/helper-module-imports": { @@ -3709,24 +3802,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } }, "@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true }, "@babel/helper-validator-option": { @@ -3747,14 +3840,15 @@ } }, "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "dependencies": { "ansi-styles": { @@ -3816,9 +3910,9 @@ } }, "@babel/parser": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", - "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -3948,42 +4042,42 @@ } }, "@babel/template": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", "dev": true, "requires": { - "@babel/code-frame": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/traverse": { - "version": "7.22.8", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz", - "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.7", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.7", - "@babel/types": "^7.22.5", - "debug": "^4.1.0", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", + "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7", + "debug": "^4.3.1", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" } }, @@ -3998,6 +4092,61 @@ "resolved": "https://registry.npmjs.org/@fleet-sdk/common/-/common-0.1.3.tgz", "integrity": "sha512-gYEkHhgGpgIcmCL3nCw8E9zHkT2WLmR+mPdxFlUE6fwcwISURbJrP6W9mF7D5Y0ShAP5Is2w3edh7AyIc7ctIQ==" }, + "@fleet-sdk/core": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/core/-/core-0.4.1.tgz", + "integrity": "sha512-GHjeDH+VtYGwhEQDmqfKajaYPKImxF+L1OpLTwzKJQS3tL7XKtNJIPXt/GAiedGhFij9Go2SDwO6mBUoWiDNxQ==", + "requires": { + "@fleet-sdk/common": "^0.4.1", + "@fleet-sdk/crypto": "^0.4.1", + "@fleet-sdk/serializer": "^0.4.1" + }, + "dependencies": { + "@fleet-sdk/common": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/common/-/common-0.4.1.tgz", + "integrity": "sha512-jivyBz7kAye1FrS2gDlZkVpu7rrWAw1aySX+OkIWJA703P9BrrAEmBGU0jz4tKL+3LY2CsJhulOlpSAuc3/ivQ==" + } + } + }, + "@fleet-sdk/crypto": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/crypto/-/crypto-0.4.1.tgz", + "integrity": "sha512-emv3rx+b/WYunUfQwzal09xlMM7+Lii/7h2Yi09L97ab3UftFH6ykeuJgXBhzC1S/dTUtysHRnJOvEhhhG6TkA==", + "requires": { + "@fleet-sdk/common": "^0.4.1", + "@noble/hashes": "^1.4.0", + "@scure/base": "^1.1.6" + }, + "dependencies": { + "@fleet-sdk/common": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/common/-/common-0.4.1.tgz", + "integrity": "sha512-jivyBz7kAye1FrS2gDlZkVpu7rrWAw1aySX+OkIWJA703P9BrrAEmBGU0jz4tKL+3LY2CsJhulOlpSAuc3/ivQ==" + }, + "@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==" + } + } + }, + "@fleet-sdk/serializer": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/serializer/-/serializer-0.4.1.tgz", + "integrity": "sha512-zhqyf6hCbpnwD3Qr1/PcpJnd7KucGKpbu5aAb43pnwK4Ju4yKGP+btHKasoylHnOVa7IEA6hY4PuQBcK3SK62A==", + "requires": { + "@fleet-sdk/common": "^0.4.1", + "@fleet-sdk/crypto": "^0.4.1" + }, + "dependencies": { + "@fleet-sdk/common": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@fleet-sdk/common/-/common-0.4.1.tgz", + "integrity": "sha512-jivyBz7kAye1FrS2gDlZkVpu7rrWAw1aySX+OkIWJA703P9BrrAEmBGU0jz4tKL+3LY2CsJhulOlpSAuc3/ivQ==" + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -4238,14 +4387,14 @@ } }, "@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "requires": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" } }, "@jridgewell/resolve-uri": { @@ -4255,9 +4404,9 @@ "dev": true }, "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true }, "@jridgewell/sourcemap-codec": { @@ -4267,21 +4416,13 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - }, - "dependencies": { - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - } + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@noble/hashes": { @@ -4289,6 +4430,11 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.4.tgz", "integrity": "sha512-+PYsVPrTSqtVjatKt2A/Proukn2Yrz61OBThOCKErc5w2/r1Fh37vbDv0Eah7pyNltrmacjwTvdw3JoR+WE4TA==" }, + "@scure/base": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", + "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==" + }, "@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -4539,6 +4685,21 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "bip39": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz", + "integrity": "sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==", + "requires": { + "@noble/hashes": "^1.2.0" + }, + "dependencies": { + "@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==" + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -4550,12 +4711,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browserslist": { @@ -4823,9 +4984,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -5934,14 +6095,6 @@ "shelljs": "^0.8.5" } }, - "sigmajs-crypto-facade": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/sigmajs-crypto-facade/-/sigmajs-crypto-facade-0.0.7.tgz", - "integrity": "sha512-4XK8ZS9NKAbo8aGnU6o5GkBW6Upl8+OK8A1KreVDMAamfvZ0iq4LoVH8rHaeEPf9moVtaC4QZY5RYI+0OwiydA==", - "requires": { - "@noble/hashes": "^1.1.4" - } - }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", diff --git a/sigma-js/package.json b/sigma-js/package.json index bf2a81c280..e7077bf6f1 100644 --- a/sigma-js/package.json +++ b/sigma-js/package.json @@ -35,9 +35,10 @@ "ci:snapshot": "node ./scripts/setSnapshotVersion" }, "dependencies": { - "@noble/hashes": "1.1.4", "@fleet-sdk/common": "0.1.3", - "sigmajs-crypto-facade": "0.0.7" + "@fleet-sdk/core": "^0.4.1", + "@noble/hashes": "1.1.4", + "bip39": "^3.1.0" }, "devDependencies": { "jest": "^29.0.3", diff --git a/sigma-js/tests/data/headers.js b/sigma-js/tests/data/headers.js new file mode 100644 index 0000000000..d469d33a5f --- /dev/null +++ b/sigma-js/tests/data/headers.js @@ -0,0 +1,194 @@ +const headers = [ + { + id: '24587f75221fae3b672c735c70167928c5aef775cbd0e67e01c195735f824afe', + parentId: '10f7f78bd141a6a2cb8db90ec357648e21160f3bf896f26223db2cfaa87b1a3f', + version: 3, + timestamp: 1717863621391, + height: 1282256, + nBits: 117775526, + votes: '080000', + stateRoot: 'fc7dc6c7715127d38cbc16bdb909ff53a551fe88f0dd5bbbda669e55d9f968841a', + adProofsRoot: 'b5fded4d869c315a296503f2e624682343d55888a46429940b5bc2b29a55444b', + transactionsRoot: '973948f6d681294715a4f022b0c03c68cd32a7a1a668292e19fcd789a34eb43a', + extensionHash: '3ecf5d2666105adaf60c14f481d84c46dadf083ad7004ad0bb0c43b0a153793e', + powSolutions: { + pk: '03677d088e4958aedcd5cd65845540e91272eba99e4d98e382f5ae2351e0dfbefd', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: 'b5299a003629f80a', + d: '0', + }, + }, + { + id: '10f7f78bd141a6a2cb8db90ec357648e21160f3bf896f26223db2cfaa87b1a3f', + parentId: '394c7f3ae4269c06172706a68283c6067397360b31d5cd7c4bc53c2172b64897', + version: 3, + timestamp: 1717863408312, + height: 1282255, + nBits: 117775526, + votes: '080000', + stateRoot: 'ae566d8272662fe82de4378c53bed81e65268f0d5389880cc126e074026bae861a', + adProofsRoot: '34d602ec597ff48ff3deb727f821f90cc4645043be931ebdd449748ce94e22dc', + transactionsRoot: '824a8153966ff1f6c5811364cd49b33ca0b0668bf508b330d0818aa4f6ffc6a1', + extensionHash: '3ecf5d2666105adaf60c14f481d84c46dadf083ad7004ad0bb0c43b0a153793e', + powSolutions: { + pk: '03677d088e4958aedcd5cd65845540e91272eba99e4d98e382f5ae2351e0dfbefd', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: '95c02200a8e11d2e', + d: '0', + }, + }, + { + id: '394c7f3ae4269c06172706a68283c6067397360b31d5cd7c4bc53c2172b64897', + parentId: 'c672c0e9975f30b6d61931e4a3f4317174e19803b98fdc04b61bcaee44028dd6', + version: 3, + timestamp: 1717863344401, + height: 1282254, + nBits: 117775526, + votes: '000000', + stateRoot: '4a5401412138ed7a6a1f1df1706bcb2e36e1df4636581564312f4af23cba0b301a', + adProofsRoot: 'aa3af334320392f6a7a28b8dd8a8091b7242bdb64a5d47f17ed1dcdedf6501ba', + transactionsRoot: '4287a17eceb9678599d04c3325d7fa0db36ff0b85678be9dba566bb294a66cc8', + extensionHash: '3ecf5d2666105adaf60c14f481d84c46dadf083ad7004ad0bb0c43b0a153793e', + powSolutions: { + pk: '0223b461fab0b119677449b56760cb01586fc38b007764d4744e14a2da270322b5', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: '827fbb53377434f2', + d: '0', + }, + }, + { + id: 'c672c0e9975f30b6d61931e4a3f4317174e19803b98fdc04b61bcaee44028dd6', + parentId: '9e8e8584f9fd9653eb5976f1fc167753186a98a0438a6ae704b42c8697d4cecd', + version: 3, + timestamp: 1717863147263, + height: 1282253, + nBits: 117775526, + votes: '000000', + stateRoot: 'd34a28b1310d75200ea6a0c90e009b80f8dd2963f1e06ecffbacde4f42a3bfee1a', + adProofsRoot: 'e372fbb17ba24658f9e1ce643641a841efcd602e1c41790aefef973cd433ce9b', + transactionsRoot: 'ef23b2d71ca9489b46cb5251640010e27e34fa029a95b570c6c124a4173f684c', + extensionHash: 'b9be518371b867df5ac82a06443991ed8bf9306ebf55a7434b15210df9a0c539', + powSolutions: { + pk: '0295facb78290ac2b55f1453204d49df37be5bae9f185ed6704c1ba3ee372280c1', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: 'a1c10009e3a315f2', + d: '0', + }, + }, + { + id: '9e8e8584f9fd9653eb5976f1fc167753186a98a0438a6ae704b42c8697d4cecd', + parentId: 'd01f8967ca6bcd7aa13af207fc6ed6a8acb57b4074ec4392668a66fe781bfb23', + version: 3, + timestamp: 1717863122763, + height: 1282252, + nBits: 117775526, + votes: '000000', + stateRoot: '284e3943db7649c2b2a325e35a812ed346f32e18a31fc2eaaaf6b4b2f643ebfe1a', + adProofsRoot: '2f5f690a07c5d5cfd5dae197e542cecc8dc52ae18447c36a8968532df83fcc7b', + transactionsRoot: '98a15004c5e34a3ce209bd61eb328cf9ab7821d4804e0d5e2776a124d0545200', + extensionHash: 'b9be518371b867df5ac82a06443991ed8bf9306ebf55a7434b15210df9a0c539', + powSolutions: { + pk: '02eeec374f4e660e117fccbfec79e6fe5cdf44ac508fa228bfc654d2973f9bdc9a', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: 'e13800048268ca56', + d: '0', + }, + }, + { + id: 'd01f8967ca6bcd7aa13af207fc6ed6a8acb57b4074ec4392668a66fe781bfb23', + parentId: '9a380a48131925a260f613659b34492a9b8ff7eb39f98aad4987079db203ef4d', + version: 3, + timestamp: 1717862773912, + height: 1282251, + nBits: 117775526, + votes: '000000', + stateRoot: 'c09c380b054005326e8b4f122da6b1e9d9ddf45be3f5c1a1d3d4b3e9253592a01a', + adProofsRoot: '8680e6c0d0fe1e017c39ceda3c619ea7850e72f81885174dbc9b0bef7d74456e', + transactionsRoot: '99d630ae8ead0ee7e68caa4caf21967a70b1e586c4613fe08a1ed37ab9fa32f5', + extensionHash: '8d45e1653f21750f583b53ec970d3f828e92501483b9471693794e18fbcaf8cf', + powSolutions: { + pk: '0295facb78290ac2b55f1453204d49df37be5bae9f185ed6704c1ba3ee372280c1', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: 'a4d20018a87b8a4a', + d: '0', + }, + }, + { + id: '9a380a48131925a260f613659b34492a9b8ff7eb39f98aad4987079db203ef4d', + parentId: '83a8eade82a6d71c6e42a6bd22d713c49809b3f8a2874ef6b691346f2bd2da58', + version: 3, + timestamp: 1717862705685, + height: 1282250, + nBits: 117775526, + votes: '000000', + stateRoot: 'd066847f4f30064b29aaa901717dcf4f2500c446622af666bbc9af5066fff2991a', + adProofsRoot: 'a09323112a35ce2210732482dfb3d9135b8799b0ea1d9decdc801dea271c69b0', + transactionsRoot: 'f643de048397d12b1c58579f23fb55cdfe9ce74d66ab899024b8557e44ff5769', + extensionHash: 'ea48106638079bd93c6124af301c1ace2be76d9275c6cf82a60adea21185fcc5', + powSolutions: { + pk: '0274e729bb6615cbda94d9d176a2f1525068f12b330e38bbbf387232797dfd891f', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: '65fe0004e59d407a', + d: '0', + }, + }, + { + id: '83a8eade82a6d71c6e42a6bd22d713c49809b3f8a2874ef6b691346f2bd2da58', + parentId: '31ea3b11d226c1c2ffe3ed52ed467aa89fe69c648422b920c4a6795b5bc3f261', + version: 3, + timestamp: 1717862655809, + height: 1282249, + nBits: 117775526, + votes: '080000', + stateRoot: 'b94b0cd75a8ced75435bf646b142699774b7719a7dc6d7bf3521231707883a4c1a', + adProofsRoot: 'eb40c786a40450f371ae379c1dc3431d8ea1f30e8e3a134e171d4792bbe106c2', + transactionsRoot: 'af8c49a0e721076de8c35fecc1ba450b52a581875bd9b4ac3756d5453b0b70f8', + extensionHash: '987952f8d2eba20163aab8fdfe71f9a2c900f7757862ddcf8402552cc1988b99', + powSolutions: { + pk: '03677d088e4958aedcd5cd65845540e91272eba99e4d98e382f5ae2351e0dfbefd', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: 'dd4138c023ae6df4', + d: '0', + }, + }, + { + id: '31ea3b11d226c1c2ffe3ed52ed467aa89fe69c648422b920c4a6795b5bc3f261', + parentId: '67d045e914359c8934d205ef05818688944d94cb4c211032e7fe48f21e4f9762', + version: 3, + timestamp: 1717862652982, + height: 1282248, + nBits: 117775526, + votes: '080000', + stateRoot: '113aaf2565e6b5879adb961d43920f1c772789af58758fe57cf71ebbc1c2e43d1a', + adProofsRoot: 'c01fa3201e7cf0e6c4b63c32d8e3d84dd4850101d6d10a6e0e6540b8bdb09ac3', + transactionsRoot: 'e8e91d37c7c376a36947a487a5fa3404565f6146b5e41837ab11d74ffe0a8a11', + extensionHash: '9845d1f3409b51c3a61300b8119955caf086b0e497cd67ee08f7167212615bff', + powSolutions: { + pk: '03677d088e4958aedcd5cd65845540e91272eba99e4d98e382f5ae2351e0dfbefd', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: '6ce31b4000e2a1f8', + d: '0', + }, + }, + { + id: '67d045e914359c8934d205ef05818688944d94cb4c211032e7fe48f21e4f9762', + parentId: 'b4d4bd706d385ae3a2d090ce9ede579f481bd0b4f8f116a508e73f682054ab23', + version: 3, + timestamp: 1717862631198, + height: 1282247, + nBits: 117775526, + votes: '080000', + stateRoot: '71d8ea5a2d1fb9bee68acca4cac30bbb15eb67304856027e5c7567b4e801ba6f1a', + adProofsRoot: '23cb8d94d01428e692ebcbe0ad42c4b67ff0a2f4c2b924a0b09435f1a284d9ab', + transactionsRoot: 'dec521e86dcee6830e85a72df206f850b05361cfc17d2ade42af1fdbf21c24e6', + extensionHash: '5c623cf8cf41ec7f48f3e296f8e620f085e26552481bdacec672e0c5e8acc9c2', + powSolutions: { + pk: '03677d088e4958aedcd5cd65845540e91272eba99e4d98e382f5ae2351e0dfbefd', + w: '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + n: 'b8daa6001046f503', + d: '0', + }, + }, +]; + +module.exports = headers; \ No newline at end of file diff --git a/sigma-js/tests/data/info.js b/sigma-js/tests/data/info.js new file mode 100644 index 0000000000..193d19ad25 --- /dev/null +++ b/sigma-js/tests/data/info.js @@ -0,0 +1,21 @@ +//https://api.ergoplatform.com/api/v1/info +const info = { + lastBlockId: '5b9b19ac028c6956b4cdf8ec75227934b8134ff3635ed3aceac8a8bf20788dce', + height: 1282261, + maxBoxGix: 6197269, + maxTxGix: 1167892, + params: { + height: 506880, + storageFeeFactor: 1250000, + minValuePerByte: 360, + maxBlockSize: 1271009, + maxBlockCost: 7030268, + blockVersion: 2, + tokenAccessCost: 100, + inputCost: 2000, + dataInputCost: 100, + outputCost: 100, + }, +}; + +module.exports = info; \ No newline at end of file diff --git a/sigma-js/tests/data/unsignedTrasactions.js b/sigma-js/tests/data/unsignedTrasactions.js new file mode 100644 index 0000000000..614ab9324b --- /dev/null +++ b/sigma-js/tests/data/unsignedTrasactions.js @@ -0,0 +1,70 @@ +const poolToAliceTx = { + inputs: [ + { + boxId: "fe4daef7e5eaa2bb93013d94c1ae78c272d9ac11e9b1d4e1f515405ef2668de8", + value: "5000000000", + ergoTree: + "0008cd02f8bf1ab71f755192e39eb54fe4e7de5362ce618f9ac04550b96f87b0e674ed7c", + creationHeight: 1280810, + assets: [ + { + tokenId: + "5bf691fbf0c4b17f8f8cece83fa947f62f480bfbd242bd58946f85535125db4d", + amount: "100000000000000", + }, + { + tokenId: + "f60bff91f7ae3f3a5f0c2d35b46ef8991f213a61d7f7e453d344fa52a42d9f9a", + amount: "500000000", + }, + ], + additionalRegisters: {}, + transactionId: + "2194af861e036f3a7012a6efda33686b32a7fffe188ae408a291cdb0fd7dcb4e", + index: 0, + extension: {}, + }, + ], + dataInputs: [], + outputs: [ + { + value: "1000000", + ergoTree: + "0008cd034e8a84ced7cfe5a25d7914c600a0cdb7e8117c175aff93b0a76b0902e8d777d4", + creationHeight: 1282261, + assets: [], + additionalRegisters: {}, + }, + { + value: "1000000", + ergoTree: + "1005040004000e36100204a00b08cd0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ea02d192a39a8cc7a701730073011001020402d19683030193a38cc7b2a57300000193c2b2a57301007473027303830108cdeeac93b1a57304", + creationHeight: 1282261, + assets: [], + additionalRegisters: {}, + }, + { + value: "4998000000", + ergoTree: + "0008cd02f8bf1ab71f755192e39eb54fe4e7de5362ce618f9ac04550b96f87b0e674ed7c", + creationHeight: 1282261, + assets: [ + { + tokenId: + "5bf691fbf0c4b17f8f8cece83fa947f62f480bfbd242bd58946f85535125db4d", + amount: "100000000000000", + }, + { + tokenId: + "f60bff91f7ae3f3a5f0c2d35b46ef8991f213a61d7f7e453d344fa52a42d9f9a", + amount: "500000000", + }, + ], + additionalRegisters: {}, + }, + ], +}; + +module.exports = { + poolToAliceTx +} \ No newline at end of file diff --git a/sigma-js/tests/data/users.js b/sigma-js/tests/data/users.js new file mode 100644 index 0000000000..c793994537 --- /dev/null +++ b/sigma-js/tests/data/users.js @@ -0,0 +1,19 @@ +const ALICE_MNEMONIC = + 'swim current hurry local faint obey scare vessel inch chest lock paddle since world agree1'; +const BOB_MNEMONIC = + 'grit sorry wise village fork movie kingdom trend jar grant icon equal vessel case nominee'; +const POOL_MNEMONIC = + 'phrase belt winner top helmet satoshi unfold gas little until choose hurt rough minute name'; + +const ALICE_ADDRESS = '9h4PvCt8B4ZJtzmpneRwatFwufMgTSLm8UXK2waxuHhgZjLZkgK'; +const BOB_ADDRESS = '9hh35g9W39kSKFuScYaLC7XqU8nunb3kmPXjwVkCyUsdx6ZdVnJ'; +const POOL_ADDRESS = '9gQcQmLujhaWzyLxaRPKq1Fu5H9uAeikxiudRLiz9TmzBCixGo4'; + +module.exports = { + ALICE_MNEMONIC, + BOB_MNEMONIC, + POOL_MNEMONIC, + ALICE_ADDRESS, + BOB_ADDRESS, + POOL_ADDRESS +} \ No newline at end of file diff --git a/sigma-js/tests/data/utils.js b/sigma-js/tests/data/utils.js new file mode 100644 index 0000000000..48145620d7 --- /dev/null +++ b/sigma-js/tests/data/utils.js @@ -0,0 +1,42 @@ +const { AvlTree$, GroupElement$ } = require('sigmastate-js/main'); + +function blockchainParameterFromErgoNodeIfo(info){ + return{ + storageFeeFactor: info.params.storageFeeFactor, + minValuePerByte: info.params.minValuePerByte, + maxBlockSize: info.params.maxBlockSize, + tokenAccessCost: info.params.tokenAccessCost, + inputCost: info.params.inputCost, + dataInputCost: info.params.dataInputCost, + outputCost: info.params.outputCost, + maxBlockCost: info.params.maxBlockCost, + softForkStartingHeight: 100, + softForkVotesCollected: 50, + blockVersion: info.params.blockVersion, + } +}; + +function sigmastateHeader(header){ + return { + id: header.id, + version: header.version, + parentId: header.parentId, + ADProofsRoot: header.adProofsRoot, + stateRoot: AvlTree$.fromDigest(header.stateRoot), + transactionsRoot: header.transactionsRoot, + timestamp: header.timestamp, + nBits: header.nBits, + height: header.height, + extensionRoot: header.extensionHash, + minerPk: GroupElement$.fromPointHex(header.powSolutions.pk), + powOnetimePk: GroupElement$.fromPointHex(header.powSolutions.w), + powNonce: header.powSolutions.n, + powDistance: BigInt(header.powSolutions.d), + votes: header.votes, + }; +} + +module.exports = { + blockchainParameterFromErgoNodeIfo, + sigmastateHeader +} \ No newline at end of file diff --git a/sigma-js/tests/data/utxo.js b/sigma-js/tests/data/utxo.js new file mode 100644 index 0000000000..07d429856c --- /dev/null +++ b/sigma-js/tests/data/utxo.js @@ -0,0 +1,41 @@ +const poolUtxo = [ + { + boxId: 'fe4daef7e5eaa2bb93013d94c1ae78c272d9ac11e9b1d4e1f515405ef2668de8', + transactionId: '2194af861e036f3a7012a6efda33686b32a7fffe188ae408a291cdb0fd7dcb4e', + blockId: 'a7b3deaae00a8edf11637ffd5a74e328c731b842bb0e080da27b905c0baacde7', + value: '5000000000', + index: 0, + globalIndex: 6150710, + creationHeight: 1280810, + settlementHeight: 1280812, + ergoTree: '0008cd02f8bf1ab71f755192e39eb54fe4e7de5362ce618f9ac04550b96f87b0e674ed7c', + ergoTreeConstants: '', + ergoTreeScript: '{SigmaProp(ProveDlog(ECPoint(f8bf1a,5ba113,...)))}', + address: '9gQcQmLujhaWzyLxaRPKq1Fu5H9uAeikxiudRLiz9TmzBCixGo4', + assets: [ + { + tokenId: '5bf691fbf0c4b17f8f8cece83fa947f62f480bfbd242bd58946f85535125db4d', + index: 0, + amount: '100000000000000', + name: 'rsBTC', + decimals: 8, + type: 'EIP-004', + }, + { + tokenId: 'f60bff91f7ae3f3a5f0c2d35b46ef8991f213a61d7f7e453d344fa52a42d9f9a', + index: 1, + amount: '500000000', + name: 'SigUSD', + decimals: 2, + type: 'EIP-004', + }, + ], + additionalRegisters: {}, + spentTransactionId: null, + mainChain: true, + }, +]; + +module.exports = { + poolUtxo +} \ No newline at end of file diff --git a/sigma-js/tests/examples/SignTrasaction.spec.js b/sigma-js/tests/examples/SignTrasaction.spec.js new file mode 100644 index 0000000000..525593c39d --- /dev/null +++ b/sigma-js/tests/examples/SignTrasaction.spec.js @@ -0,0 +1,58 @@ +const { ProverBuilder$ } = require("sigmastate-js/main"); + +const bip39 = require("bip39"); +const { POOL_MNEMONIC } = require("../data/users"); +const { + blockchainParameterFromErgoNodeIfo, + sigmastateHeader, +} = require("../data/utils"); +const headers = require("../data/headers"); +const info = require("../data/info"); +const { poolToAliceTx } = require("../data/unsignedTrasactions"); + +describe("SigmaProver", () => { + it("should sign a simple transaction", async () => { + const networkMainnet = 0; + const unsignedTx = poolToAliceTx; + + const buffer = await bip39.mnemonicToSeed(POOL_MNEMONIC); + const mnemonicPhrase = buffer.toString("hex"); + const BLOCKCHAIN_PARAMETERS = blockchainParameterFromErgoNodeIfo(info); + const prover = ProverBuilder$.create(BLOCKCHAIN_PARAMETERS, networkMainnet) + .withMnemonic(mnemonicPhrase, "") + .build(); + + const sHeaders = headers.map(sigmastateHeader); + const stateCtx = { + sigmaLastHeaders: sHeaders.slice(1), + previousStateDigest: sHeaders[1].stateRoot.digest, + sigmaPreHeader: sHeaders[0], + }; + + const reducedInput = prover.reduceTransactionInput( + stateCtx, + unsignedTx, + unsignedTx.inputs, + unsignedTx.dataInputs, + [], + 0 + ); + expect(reducedInput).toBeDefined(); + + const reducedTx = prover.reduce( + stateCtx, + unsignedTx, + unsignedTx.inputs, + unsignedTx.dataInputs, + [], + 0 + ); + expect(reducedTx).toBeDefined(); + + const hints = prover.generateCommitments(reducedTx); + expect(hints).toBeDefined(); + + // let signedTx = prover.signReduced(reducedTx, hints); + // expect(signedTx).toBeDefined(); + }); +});