From 101fbd867b4166490e4607dd4fa19bc426b7ee10 Mon Sep 17 00:00:00 2001 From: Evgenii Lisitskii Date: Wed, 9 Oct 2024 11:27:26 +0800 Subject: [PATCH] Wasm friendly tx script evaluator (#90) * make tx script evaluator wasm friendly * change utxo type to include script ver * fix evaluator with version * uncomment basic test for tx eval * bump version * chore: fix linting --------- Co-authored-by: TW Co-authored-by: twwu123 Co-authored-by: SIDANWhatever --- package-lock.json | 396 ++------- packages/Cargo.lock | 30 +- packages/Cargo.toml | 2 +- packages/sidan-csl-rs/Cargo.toml | 18 +- .../src/core/utils/certificates.rs | 2 +- .../sidan-csl-rs/src/core/utils/evaluator.rs | 366 ++++++++ packages/sidan-csl-rs/src/core/utils/mod.rs | 2 + packages/sidan-csl-rs/src/model/action.rs | 7 +- packages/sidan-csl-rs/src/model/js_vec.rs | 4 + .../src/model/tx_builder_types/utxo.rs | 11 +- packages/sidan-csl-rs/src/wasm/transaction.rs | 2 +- packages/sidan-csl-rs/src/wasm/txbuilder.rs | 4 +- packages/whisky-examples/Cargo.toml | 4 +- packages/whisky/Cargo.toml | 12 +- packages/whisky/src/builder/tx_eval.rs | 468 +---------- yarn.lock | 788 ------------------ 16 files changed, 509 insertions(+), 1607 deletions(-) create mode 100644 packages/sidan-csl-rs/src/core/utils/evaluator.rs delete mode 100644 yarn.lock diff --git a/package-lock.json b/package-lock.json index 7eb1148..e4a0955 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,6 @@ }, "node_modules/@apidevtools/json-schema-ref-parser": { "version": "9.0.9", - "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", - "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", "dev": true, "license": "MIT", "dependencies": { @@ -30,8 +28,6 @@ }, "node_modules/@babel/code-frame": { "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", - "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dev": true, "license": "MIT", "dependencies": { @@ -44,8 +40,6 @@ }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "license": "MIT", "engines": { @@ -54,8 +48,6 @@ }, "node_modules/@babel/highlight": { "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", - "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dev": true, "license": "MIT", "dependencies": { @@ -68,17 +60,69 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@jsdevtools/ono": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", - "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true, "license": "MIT" }, "node_modules/@types/glob": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==", "dev": true, "license": "MIT", "dependencies": { @@ -88,29 +132,21 @@ }, "node_modules/@types/json-schema": { "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true, "license": "MIT" }, "node_modules/@types/lodash": { "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", - "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==", "dev": true, "license": "MIT" }, "node_modules/@types/minimatch": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { "version": "20.11.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", - "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", "dev": true, "license": "MIT", "dependencies": { @@ -119,56 +155,45 @@ }, "node_modules/@types/parse-json": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", - "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", "dev": true, "license": "MIT" }, "node_modules/@types/prettier": { "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", - "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", "dev": true, "license": "MIT" }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/any-promise": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "dev": true, "license": "MIT" }, "node_modules/argparse": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, "license": "Python-2.0" }, "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, "license": "MIT" }, "node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "license": "MIT", "dependencies": { @@ -178,15 +203,11 @@ }, "node_modules/call-me-maybe": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", - "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", "dev": true, "license": "MIT" }, "node_modules/callsites": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "license": "MIT", "engines": { @@ -194,31 +215,27 @@ } }, "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/ci-info": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true, "license": "MIT" }, "node_modules/cli-color": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.4.tgz", - "integrity": "sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==", "dev": true, "license": "ISC", "dependencies": { @@ -233,26 +250,23 @@ } }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", "dev": true, "license": "MIT", "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "version": "1.1.4", "dev": true, "license": "MIT" }, "node_modules/commander": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, "license": "MIT", "engines": { @@ -261,22 +275,16 @@ }, "node_modules/compare-versions": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", "dev": true, "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true, "license": "MIT" }, "node_modules/cosmiconfig": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", "dev": true, "license": "MIT", "dependencies": { @@ -292,8 +300,6 @@ }, "node_modules/d": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", - "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", "dev": true, "license": "ISC", "dependencies": { @@ -306,8 +312,6 @@ }, "node_modules/error-ex": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "license": "MIT", "dependencies": { @@ -316,8 +320,6 @@ }, "node_modules/es5-ext": { "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "dev": true, "hasInstallScript": true, "license": "ISC", @@ -333,8 +335,6 @@ }, "node_modules/es6-iterator": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", "dev": true, "license": "MIT", "dependencies": { @@ -345,8 +345,6 @@ }, "node_modules/es6-symbol": { "version": "3.1.4", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", - "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", "dev": true, "license": "ISC", "dependencies": { @@ -359,8 +357,6 @@ }, "node_modules/es6-weak-map": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", "dev": true, "license": "ISC", "dependencies": { @@ -372,8 +368,6 @@ }, "node_modules/escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "license": "MIT", "engines": { @@ -382,8 +376,6 @@ }, "node_modules/esniff": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", "dev": true, "license": "ISC", "dependencies": { @@ -398,8 +390,6 @@ }, "node_modules/event-emitter": { "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", "dev": true, "license": "MIT", "dependencies": { @@ -409,8 +399,6 @@ }, "node_modules/ext": { "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", "dev": true, "license": "ISC", "dependencies": { @@ -419,8 +407,6 @@ }, "node_modules/find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -433,8 +419,6 @@ }, "node_modules/find-versions": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", - "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", "dev": true, "license": "MIT", "dependencies": { @@ -446,8 +430,6 @@ }, "node_modules/flowgen": { "version": "1.21.0", - "resolved": "https://registry.npmjs.org/flowgen/-/flowgen-1.21.0.tgz", - "integrity": "sha512-pFNFFyMLRmW6njhOIm5TrbGUDTv64aujmys2KrkRE2NYD8sXwJUyicQRwU5SPRBRJnFSD/FNlnHo2NnHI5eJSw==", "dev": true, "license": "ISC", "dependencies": { @@ -466,15 +448,11 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true, "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", "funding": { @@ -483,8 +461,6 @@ }, "node_modules/get-stdin": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", - "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", "dev": true, "license": "MIT", "engines": { @@ -496,9 +472,6 @@ }, "node_modules/glob": { "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -518,8 +491,6 @@ }, "node_modules/glob-promise": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", - "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", "dev": true, "license": "ISC", "dependencies": { @@ -533,19 +504,15 @@ } }, "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "version": "4.0.0", "dev": true, "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/hasown": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "license": "MIT", "dependencies": { @@ -557,8 +524,6 @@ }, "node_modules/husky": { "version": "4.2.5", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", - "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -586,86 +551,8 @@ "url": "https://opencollective.com/husky" } }, - "node_modules/husky/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/husky/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/husky/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/husky/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/husky/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/import-fresh": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "license": "MIT", "dependencies": { @@ -681,9 +568,6 @@ }, "node_modules/inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "license": "ISC", "dependencies": { @@ -693,15 +577,11 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, "license": "ISC" }, "node_modules/interpret": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, "license": "MIT", "engines": { @@ -710,15 +590,11 @@ }, "node_modules/is-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true, "license": "MIT" }, "node_modules/is-core-module": { "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "license": "MIT", "dependencies": { @@ -730,8 +606,6 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "license": "MIT", "engines": { @@ -740,8 +614,6 @@ }, "node_modules/is-glob": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "license": "MIT", "dependencies": { @@ -753,22 +625,16 @@ }, "node_modules/is-promise": { "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", "dev": true, "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true, "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "license": "MIT", "dependencies": { @@ -780,16 +646,11 @@ }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true, "license": "MIT" }, "node_modules/json-schema-ref-parser": { "version": "9.0.9", - "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", - "integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==", - "deprecated": "Please switch to @apidevtools/json-schema-ref-parser", "dev": true, "license": "MIT", "dependencies": { @@ -801,8 +662,6 @@ }, "node_modules/json-schema-to-typescript": { "version": "10.1.5", - "resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-10.1.5.tgz", - "integrity": "sha512-X8bNNksfCQo6LhEuqNxmZr4eZpPjXZajmimciuk8eWXzZlif9Brq7WuMGD/SOhBKcRKP2SGVDNZbC28WQqx9Rg==", "dev": true, "license": "MIT", "dependencies": { @@ -831,22 +690,16 @@ }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true, "license": "ISC" }, "node_modules/lines-and-columns": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true, "license": "MIT" }, "node_modules/locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -858,15 +711,11 @@ }, "node_modules/lodash": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true, "license": "MIT" }, "node_modules/lru-queue": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -875,8 +724,6 @@ }, "node_modules/memoizee": { "version": "0.4.15", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", - "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", "dev": true, "license": "ISC", "dependencies": { @@ -892,8 +739,6 @@ }, "node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", "dependencies": { @@ -905,8 +750,6 @@ }, "node_modules/minimist": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "license": "MIT", "funding": { @@ -915,8 +758,6 @@ }, "node_modules/mkdirp": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, "license": "MIT", "bin": { @@ -928,8 +769,6 @@ }, "node_modules/mz": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, "license": "MIT", "dependencies": { @@ -940,15 +779,11 @@ }, "node_modules/next-tick": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true, "license": "ISC" }, "node_modules/object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "license": "MIT", "engines": { @@ -957,8 +792,6 @@ }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "license": "ISC", "dependencies": { @@ -967,8 +800,6 @@ }, "node_modules/opencollective-postinstall": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", "dev": true, "license": "MIT", "bin": { @@ -977,8 +808,6 @@ }, "node_modules/p-limit": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -993,8 +822,6 @@ }, "node_modules/p-locate": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -1006,8 +833,6 @@ }, "node_modules/p-try": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "license": "MIT", "engines": { @@ -1016,8 +841,6 @@ }, "node_modules/parent-module": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "license": "MIT", "dependencies": { @@ -1029,8 +852,6 @@ }, "node_modules/parse-json": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "license": "MIT", "dependencies": { @@ -1048,8 +869,6 @@ }, "node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", "engines": { @@ -1058,8 +877,6 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "license": "MIT", "engines": { @@ -1068,15 +885,11 @@ }, "node_modules/path-parse": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true, "license": "MIT" }, "node_modules/path-type": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, "license": "MIT", "engines": { @@ -1085,15 +898,11 @@ }, "node_modules/picocolors": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true, "license": "ISC" }, "node_modules/pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1105,8 +914,6 @@ }, "node_modules/please-upgrade-node": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", "dev": true, "license": "MIT", "dependencies": { @@ -1115,8 +922,6 @@ }, "node_modules/prettier": { "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "license": "MIT", "bin": { @@ -1131,8 +936,6 @@ }, "node_modules/rechoir": { "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "dependencies": { "resolve": "^1.1.6" @@ -1143,8 +946,6 @@ }, "node_modules/resolve": { "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "license": "MIT", "dependencies": { @@ -1161,8 +962,6 @@ }, "node_modules/resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "license": "MIT", "engines": { @@ -1171,9 +970,6 @@ }, "node_modules/rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -1188,15 +984,11 @@ }, "node_modules/semver-compare": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true, "license": "MIT" }, "node_modules/semver-regex": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", - "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", "dev": true, "license": "MIT", "engines": { @@ -1205,8 +997,6 @@ }, "node_modules/shelljs": { "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -1223,8 +1013,6 @@ }, "node_modules/slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "license": "MIT", "engines": { @@ -1232,22 +1020,18 @@ } }, "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "license": "MIT", "engines": { @@ -1259,8 +1043,6 @@ }, "node_modules/thenify": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, "license": "MIT", "dependencies": { @@ -1269,8 +1051,6 @@ }, "node_modules/thenify-all": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", "dev": true, "license": "MIT", "dependencies": { @@ -1282,8 +1062,6 @@ }, "node_modules/timers-ext": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", - "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", "dev": true, "license": "ISC", "dependencies": { @@ -1293,15 +1071,11 @@ }, "node_modules/type": { "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==", "dev": true, "license": "ISC" }, "node_modules/typescript": { "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -1314,22 +1088,16 @@ }, "node_modules/typescript-compiler": { "version": "1.4.1-2", - "resolved": "https://registry.npmjs.org/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz", - "integrity": "sha512-EMopKmoAEJqA4XXRFGOb7eSBhmQMbBahW6P1Koayeatp0b4AW2q/bBqYWkpG7QVQc9HGQUiS4trx2ZHcnAaZUg==", "dev": true, "license": "MIT" }, "node_modules/undici-types": { "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true, "license": "MIT" }, "node_modules/which-pm-runs": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", "dev": true, "license": "MIT", "engines": { @@ -1338,15 +1106,11 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true, "license": "ISC" }, "node_modules/yaml": { "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, "license": "ISC", "engines": { diff --git a/packages/Cargo.lock b/packages/Cargo.lock index a2a42ba..e311872 100644 --- a/packages/Cargo.lock +++ b/packages/Cargo.lock @@ -1766,9 +1766,9 @@ dependencies = [ [[package]] name = "pallas-addresses" -version = "0.30.1" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c38fac39e0da3b0fc4c859635c72e97584f01f3a0f4f1508b0851c02d6d52f15" +checksum = "84460293bb3323066e9ce608702750c14f02bc36d41c469e44b3eef5ec0fdbf6" dependencies = [ "base58", "bech32 0.9.1", @@ -1782,9 +1782,9 @@ dependencies = [ [[package]] name = "pallas-codec" -version = "0.30.1" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8a4b87dbc8bcb8aeb865f7cca5e1eb29744330e23b307169fc30537648b264" +checksum = "747279d1bc612986035619a3eaded8f9f4ceae29668aa7a5feae83681a0e93f4" dependencies = [ "hex", "minicbor", @@ -1795,9 +1795,9 @@ dependencies = [ [[package]] name = "pallas-crypto" -version = "0.30.1" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b98c3f204299d47d9b581ab425043789caff1f491c078ee3d3f109d6556f725" +checksum = "1b6f8b08e32c7dbb50302222701ae15ef9ac1a7cc39225ce29c253f6ddab2aa7" dependencies = [ "cryptoxide", "hex", @@ -1809,9 +1809,9 @@ dependencies = [ [[package]] name = "pallas-primitives" -version = "0.30.1" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f64835dd9cbdd75a38961a190b983f02746c872340daf1a921eada8c525a4b6" +checksum = "24929d461308626183d5bf15290e6315f4cc67fa38a1a66469425919683cceb2" dependencies = [ "base58", "bech32 0.9.1", @@ -1825,9 +1825,9 @@ dependencies = [ [[package]] name = "pallas-traverse" -version = "0.30.1" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad516b05ba7d838ee84f9998d7b2b4ff7acc178cb052bcfd5fea9edc2ef6023f" +checksum = "73ca94c2278a160c226d6f5bb1756ea5f355421158aaa697445f59f09477a6a4" dependencies = [ "hex", "itertools 0.13.0", @@ -2644,7 +2644,7 @@ dependencies = [ [[package]] name = "sidan-csl-rs" -version = "0.8.7" +version = "0.9.0" dependencies = [ "cardano-serialization-lib", "cryptoxide", @@ -3104,9 +3104,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "uplc" -version = "1.1.1" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f8851275d6f9485ececa08046ddeeac3c158dce0d3229cf8fe2a2d627440a3" +checksum = "dcee5aac88875e74cf7a01655691e968e12529450d322604dc6f0852c293dad2" dependencies = [ "blst", "cryptoxide", @@ -3258,7 +3258,7 @@ dependencies = [ [[package]] name = "whisky" -version = "0.8.7" +version = "0.9.0" dependencies = [ "async-trait", "cryptoxide", @@ -3283,7 +3283,7 @@ dependencies = [ [[package]] name = "whisky-examples" -version = "0.8.7" +version = "0.9.0" dependencies = [ "actix-cors", "actix-web", diff --git a/packages/Cargo.toml b/packages/Cargo.toml index 5d4fe3a..12ddba0 100644 --- a/packages/Cargo.toml +++ b/packages/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -version = "0.8.7" +version = "0.9.0" resolver = "2" members = [ "sidan-csl-rs", diff --git a/packages/sidan-csl-rs/Cargo.toml b/packages/sidan-csl-rs/Cargo.toml index af000e4..524316e 100644 --- a/packages/sidan-csl-rs/Cargo.toml +++ b/packages/sidan-csl-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sidan-csl-rs" -version = "0.8.7" +version = "0.9.0" edition = "2021" license = "Apache-2.0" description = "Wrapper around the cardano-serialization-lib for easier transaction building, heavily inspired by cardano-cli APIs" @@ -22,26 +22,26 @@ schemars = "0.8.8" [target.'cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))'.dependencies] # uplc = { version = "=1.0.26-alpha", default-features = false, features = ["native-secp256k1"] } # uplc = "=1.0.26-alpha" -uplc = "=1.1.1" +uplc = "=1.1.4" wasm-bindgen = { version = "=0.2.92", features = ["serde-serialize"] } rand_os = "0.1" noop_proc_macro = "0.3.0" -pallas-codec = { version = "0.30.1", features = ["num-bigint"] } -pallas-primitives = "0.30.1" -pallas-traverse = "0.30.1" +pallas-codec = { version = "0.30.2", features = ["num-bigint"] } +pallas-primitives = "0.30.2" +pallas-traverse = "0.30.2" # wasm [target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies] serde-wasm-bindgen = "0.4.5" # uplc = { version = "=1.0.26-alpha", default-features = false, features = ["native-secp256k1"] } -uplc = "=1.1.1" +uplc = "=1.1.4" wasm-bindgen = { version = "=0.2.92", features = ["serde-serialize"] } rand_os = { version = "0.1", features = ["wasm-bindgen"] } js-sys = "=0.3.61" wasm-bindgen-futures = "=0.4.34" -pallas-codec = { version = "0.30.1", features = ["num-bigint"] } -pallas-primitives = "0.30.1" -pallas-traverse = "0.30.1" +pallas-codec = { version = "0.30.2", features = ["num-bigint"] } +pallas-primitives = "0.30.2" +pallas-traverse = "0.30.2" [profile.release] # Tell `rustc` to optimize for small code size. diff --git a/packages/sidan-csl-rs/src/core/utils/certificates.rs b/packages/sidan-csl-rs/src/core/utils/certificates.rs index 33be1f5..87cec98 100644 --- a/packages/sidan-csl-rs/src/core/utils/certificates.rs +++ b/packages/sidan-csl-rs/src/core/utils/certificates.rs @@ -15,7 +15,7 @@ use super::to_bignum; pub fn to_csl_drep(drep: &DRep) -> Result { match drep { - DRep::DRepId(drep_id) => Ok(csl::DRep::from_bech32(&drep_id)?), + DRep::DRepId(drep_id) => Ok(csl::DRep::from_bech32(drep_id)?), DRep::AlwaysAbstain => Ok(csl::DRep::new_always_abstain()), DRep::AlwaysNoConfidence => Ok(csl::DRep::new_always_no_confidence()), } diff --git a/packages/sidan-csl-rs/src/core/utils/evaluator.rs b/packages/sidan-csl-rs/src/core/utils/evaluator.rs new file mode 100644 index 0000000..88e4632 --- /dev/null +++ b/packages/sidan-csl-rs/src/core/utils/evaluator.rs @@ -0,0 +1,366 @@ +use pallas_codec::utils::NonEmptyKeyValuePairs; +use pallas_primitives::conway::NativeScript; +use pallas_primitives::conway::PlutusV1Script; +use pallas_primitives::conway::PlutusV2Script; +use pallas_primitives::conway::PlutusV3Script; +use pallas_primitives::conway::RedeemerTag as PRedeemerTag; +use std::collections::HashMap; +use uplc::tx::SlotConfig; + +use crate::core::constants::get_cost_models_from_network; +use crate::core::tx_parser::MeshTxParser; +use crate::csl::{Address, JsError}; +use crate::model::{Action, Asset, Budget, JsVecString, Network, RedeemerTag, UTxO, UtxoOutput}; +use crate::wasm::WasmResult; +use crate::*; +use pallas_codec::minicbor::Decoder; +use pallas_codec::utils::{Bytes, CborWrap, PositiveCoin}; +use pallas_primitives::{ + conway::{ + AssetName, Coin, CostMdls, DatumOption, PlutusData, PolicyId, PostAlonzoTransactionOutput, + PseudoScript, ScriptRef, TransactionOutput, Value, + }, + Fragment, +}; +use pallas_traverse::{Era, MultiEraTx}; +use uplc::{ + tx::{eval_phase_two, ResolvedInput}, + Hash, TransactionInput, +}; + +#[wasm_bindgen] +pub fn evaluate_tx_scripts_js( + tx_hex: String, + resolved_utxos: JsVecString, + additional_txs: JsVecString, + network: String, +) -> WasmResult { + let mut deserialized_utxos: Vec = Vec::new(); + for utxo_json in resolved_utxos { + match serde_json::from_str(utxo_json.as_str()) { + Ok(utxo) => deserialized_utxos.push(utxo), + Err(e) => { + return WasmResult::new_error("failure".to_string(), format!("{:?}", e)); + } + } + } + + let deserialize_network = match serde_json::from_str(network.as_str()) { + Ok(network) => network, + Err(e) => { + return WasmResult::new_error("failure".to_string(), format!("{:?}", e)); + } + }; + + let eval_result = evaluate_tx_scripts( + &tx_hex, + &deserialized_utxos, + &additional_txs.into_vec(), + &deserialize_network, + ); + + match eval_result { + Ok(actions) => { + let actions_json = serde_json::to_string(&actions).unwrap(); + WasmResult::new("success".to_string(), actions_json) + } + Err(e) => WasmResult::new_error("failure".to_string(), format!("{:?}", e)), + } +} + +pub fn evaluate_tx_scripts( + tx_hex: &str, + inputs: &[UTxO], + additional_txs: &[String], + network: &Network, +) -> Result, JsError> { + let tx_bytes = hex::decode(tx_hex).expect("Invalid tx hex"); + let mtx = MultiEraTx::decode_for_era(Era::Conway, &tx_bytes); + let tx = match mtx { + Ok(MultiEraTx::Conway(tx)) => tx.into_owned(), + _ => return Err(JsError::from_str("Invalid Tx Era")), + }; + + let tx_outs: Vec = additional_txs + .iter() + .flat_map(|tx| { + let parsed_tx = MeshTxParser::new(tx).unwrap(); + println!( + "txout: {:?}", + &parsed_tx.get_tx_outs_utxo().unwrap().clone() + ); + println!("txout_cbor: {:?}", &parsed_tx.get_tx_outs_cbor().clone()); + parsed_tx.get_tx_outs_utxo().unwrap() //TODO: handle error + }) + .collect(); + + // combine inputs and tx_outs + let all_inputs: Vec = inputs.iter().chain(tx_outs.iter()).cloned().collect(); + + eval_phase_two( + &tx, + &to_pallas_utxos(&all_inputs)?, + Some(&get_cost_mdls(network)?), + None, + &SlotConfig::default(), + false, + |_r| (), + ) + .map_err(|err| JsError::from_str(&format!("Error occurred during evaluation: {}", err))) + .map(|reds| { + reds.into_iter() + .map(|red| Action { + index: red.index, + budget: Budget { + mem: red.ex_units.mem, + steps: red.ex_units.steps, + }, + tag: match red.tag { + PRedeemerTag::Spend => RedeemerTag::Spend, + PRedeemerTag::Mint => RedeemerTag::Mint, + PRedeemerTag::Cert => RedeemerTag::Cert, + PRedeemerTag::Reward => RedeemerTag::Reward, + PRedeemerTag::Vote => RedeemerTag::Vote, + PRedeemerTag::Propose => RedeemerTag::Propose, + }, + }) + .collect() + }) +} + +fn get_cost_mdls(network: &Network) -> Result { + let cost_model_list = get_cost_models_from_network(network); + if cost_model_list.len() < 3 { + return Err(JsError::from_str( + "Cost models have to contain at least PlutusV1, PlutusV2, and PlutusV3 costs", + )); + }; + Ok(CostMdls { + plutus_v1: Some(cost_model_list[0].clone()), + plutus_v2: Some(cost_model_list[1].clone()), + plutus_v3: Some(cost_model_list[2].clone()), + }) +} + +fn to_pallas_utxos(utxos: &Vec) -> Result, JsError> { + let mut resolved_inputs = Vec::new(); + for utxo in utxos { + let tx_hash: [u8; 32] = hex::decode(&utxo.input.tx_hash) + .map_err(|err| JsError::from_str(&format!("Invalid tx hash found: {}", err)))? + .try_into() + .map_err(|_e| JsError::from_str("Invalid tx hash length found"))?; + + let resolved_input = ResolvedInput { + input: TransactionInput { + transaction_id: Hash::from(tx_hash), + index: utxo.input.output_index.into(), + }, + output: TransactionOutput::PostAlonzo(PostAlonzoTransactionOutput { + address: Bytes::from(Address::from_bech32(&utxo.output.address)?.to_bytes()), + value: to_pallas_value(&utxo.output.amount)?, + datum_option: to_pallas_datum(&utxo.output)?, + script_ref: to_pallas_script_ref(&utxo.output)?, + }), + }; + resolved_inputs.push(resolved_input); + } + Ok(resolved_inputs) +} + +fn to_pallas_script_ref(utxo_output: &UtxoOutput) -> Result>, JsError> { + if let Some(script_ref) = &utxo_output.script_ref { + let script_bytes = hex::decode(script_ref.script_hex.clone()) + .map_err(|err| JsError::from_str(&format!("Invalid script hex found: {}", err)))?; + + let unwrapped_bytes = Decoder::new(&script_bytes) + .bytes() + .map_err(|err| JsError::from_str(&format!("Invalid script hex found: {}", err)))?; + + match &script_ref.script_version { + Some(version) => match version { + model::LanguageVersion::V1 => Ok(Some(CborWrap(PseudoScript::PlutusV1Script( + PlutusV1Script(unwrapped_bytes.to_vec().into()), + )))), + model::LanguageVersion::V2 => Ok(Some(CborWrap(PseudoScript::PlutusV2Script( + PlutusV2Script(unwrapped_bytes.to_vec().into()), + )))), + model::LanguageVersion::V3 => Ok(Some(CborWrap(PseudoScript::PlutusV3Script( + PlutusV3Script(unwrapped_bytes.to_vec().into()), + )))), + }, + None => Ok(Some(CborWrap(PseudoScript::NativeScript( + NativeScript::decode_fragment(unwrapped_bytes).map_err(|err| { + JsError::from_str(&format!("Invalid native script found: {}", err)) + })?, + )))), + } + } else { + Ok(None) + } +} + +fn to_pallas_datum(utxo_output: &UtxoOutput) -> Result, JsError> { + if let Some(inline_datum) = &utxo_output.plutus_data { + //hex to bytes + let plutus_data_bytes = hex::decode(inline_datum) + .map_err(|err| JsError::from_str(&format!("Invalid plutus data found: {}", err)))?; + let datum = CborWrap( + PlutusData::decode_fragment(&plutus_data_bytes) + .map_err(|_e| JsError::from_str("Invalid plutus data found"))?, + ); + Ok(Some(DatumOption::Data(datum))) + } else if let Some(datum_hash) = &utxo_output.data_hash { + let datum_hash_bytes: [u8; 32] = hex::decode(datum_hash) + .map_err(|err| JsError::from_str(&format!("Invalid datum hash found: {}", err)))? + .try_into() + .map_err(|_e| JsError::from_str("Invalid byte length of datum hash found"))?; + Ok(Some(DatumOption::Hash(Hash::from(datum_hash_bytes)))) + } else { + Ok(None) + } +} + +fn to_pallas_value(assets: &Vec) -> Result { + if assets.len() == 1 { + match assets[0].unit().as_str() { + "lovelace" => Ok(Value::Coin(assets[0].quantity().parse::().unwrap())), + _ => Err(JsError::from_str("Invalid value")), + } + } else { + to_pallas_multi_asset_value(assets) + } +} + +fn to_pallas_multi_asset_value(assets: &Vec) -> Result { + let mut coins: Coin = 0; + let mut asset_mapping: HashMap> = HashMap::new(); + for asset in assets { + if asset.unit() == "lovelace" || asset.unit().is_empty() { + coins = asset.quantity().parse::().unwrap(); + } else { + let asset_unit = asset.unit(); + let (policy_id, asset_name) = asset_unit.split_at(56); + asset_mapping + .entry(policy_id.to_string()) + .or_default() + .push((asset_name.to_string(), asset.quantity().clone())) + } + } + + let mut multi_asset = Vec::new(); + for (policy_id, asset_list) in &asset_mapping { + let policy_id_bytes: [u8; 28] = hex::decode(policy_id) + .map_err(|err| JsError::from_str(&format!("Invalid policy id found: {}", err)))? + .try_into() + .map_err(|_e| JsError::from_str("Invalid length policy id found"))?; + + let policy_id = PolicyId::from(policy_id_bytes); + let mut mapped_assets = Vec::new(); + for asset in asset_list { + let (asset_name, asset_quantity) = asset; + let asset_name_bytes = + AssetName::from(hex::decode(asset_name).map_err(|err| { + JsError::from_str(&format!("Invalid asset name found: {}", err)) + })?); + mapped_assets.push(( + asset_name_bytes, + PositiveCoin::try_from(asset_quantity.parse::().unwrap()).unwrap(), + )); + } + multi_asset.push((policy_id, NonEmptyKeyValuePairs::Def(mapped_assets))); + } + let pallas_multi_asset = pallas_codec::utils::NonEmptyKeyValuePairs::Def(multi_asset); + Ok(Value::Multiasset(coins, pallas_multi_asset)) +} + +#[cfg(test)] +mod test { + use super::*; + use crate::csl; + use model::{LanguageVersion, ScriptRef, UtxoInput}; + use pallas_codec::minicbor::Decoder; + use serde_json::json; + + #[test] + fn test_eval() { + let result = evaluate_tx_scripts( + "84a80082825820604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad9800825820604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad98010d81825820604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad9801128182582004b9070a30bd63abaaf59a3c48a1575c4127bb0edb00ecd5141fd18a85c721aa000181a200581d601fd5bab167338971d92b4d8f0bdf57d889903e6e934e7ea38c7dadf1011b00000002529898c810a200581d601fd5bab167338971d92b4d8f0bdf57d889903e6e934e7ea38c7dadf1011b0000000252882db4111a000412f1021a0002b74b0b5820775d0cf3c95993f6210e4410e92f72ebc3942ce9c1433694749aa239e5d13387a200818258201557f444f3ae6e61dfed593ae15ec8dbd57b8138972bf16fde5b4c559f41549b5840729f1f14ef05b7cf9b0d7583e6777674f80ae64a35bbd6820cc3c82ddf0412ca1d751b7d886eece3c6e219e1c5cc9ef3d387a8d2078f47125d54b474fbdfbd0105818400000182190b111a000b5e35f5f6", + &vec![UTxO { + input: UtxoInput { + tx_hash: "604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad98".to_string(), + output_index: 0 + }, + output: UtxoOutput { + address: "addr_test1wzlwsgq97vchypqzk8u8lz30w932tvx7akcj7csm02scl7qlghd97".to_string(), + amount: vec![Asset::new_from_str("lovelace", "986990")], + data_hash: None, + plutus_data: Some(csl::PlutusData::from_json(& + json!({ + "constructor": 0, + "fields": [] + }) + .to_string(), csl::PlutusDatumSchema::DetailedSchema).unwrap().to_hex()), + script_hash: None, + script_ref: None, + } + }, + UTxO { + input: UtxoInput { + tx_hash: "604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad98".to_string(), + output_index: 1 + }, + output: UtxoOutput { + address: "addr_test1vq0atw43vuecjuwe9dxc7z7l2lvgnyp7d6f5ul4r3376mug8v67h5".to_string(), + amount: vec![Asset::new_from_str("lovelace", "9974857893")], + data_hash: None, + plutus_data: None, + script_hash: None, + script_ref: None, + } + }, + UTxO { + input: UtxoInput { + tx_hash: "04b9070a30bd63abaaf59a3c48a1575c4127bb0edb00ecd5141fd18a85c721aa".to_string(), + output_index: 0 + }, + output: UtxoOutput { + address: "addr_test1wzlwsgq97vchypqzk8u8lz30w932tvx7akcj7csm02scl7qlghd97".to_string(), + amount: vec![Asset::new_from_str("lovelace", "986990")], + data_hash: None, + plutus_data: None, + script_hash: None, + script_ref: Some(ScriptRef { script_hex: "5655010000322223253330054a229309b2b1bad0025735".to_string(), script_version: Some(LanguageVersion::V2)}) + } + }], + &[], + &Network::Mainnet + ); + + let redeemers = result.unwrap(); + let mut redeemer_json = serde_json::Map::new(); + for redeemer in redeemers { + redeemer_json.insert("index".to_string(), redeemer.index.to_string().into()); + let mut ex_unit_json = serde_json::Map::new(); + ex_unit_json.insert("mem".to_string(), redeemer.budget.mem.into()); + ex_unit_json.insert("steps".to_string(), redeemer.budget.steps.into()); + redeemer_json.insert( + "ex_units".to_string(), + serde_json::Value::Object(ex_unit_json), + ); + } + assert_eq!( + serde_json::json!({"ex_units":{"mem":2833,"steps":528893},"index":"0"}).to_string(), + serde_json::json!(redeemer_json).to_string() + ) + } + + #[test] + fn test_cbor() { + let script_bytes = hex::decode("5655010000322223253330054a229309b2b1bad0025735").unwrap(); + let decoded_bytes = Decoder::new(&script_bytes).bytes().unwrap(); + assert_eq!( + hex::decode("55010000322223253330054a229309b2b1bad0025735").unwrap(), + decoded_bytes + ); + } +} diff --git a/packages/sidan-csl-rs/src/core/utils/mod.rs b/packages/sidan-csl-rs/src/core/utils/mod.rs index e3f24ed..398eeb0 100644 --- a/packages/sidan-csl-rs/src/core/utils/mod.rs +++ b/packages/sidan-csl-rs/src/core/utils/mod.rs @@ -8,6 +8,7 @@ mod transaction; mod ungroup; mod value; mod vote; +mod evaluator; pub use address::*; pub use aiken::*; @@ -19,3 +20,4 @@ pub use transaction::*; pub use ungroup::*; pub use value::*; pub use vote::*; +pub use evaluator::*; diff --git a/packages/sidan-csl-rs/src/model/action.rs b/packages/sidan-csl-rs/src/model/action.rs index 3620ed5..ec316a5 100644 --- a/packages/sidan-csl-rs/src/model/action.rs +++ b/packages/sidan-csl-rs/src/model/action.rs @@ -1,13 +1,16 @@ +use serde::{Deserialize, Serialize}; use super::Budget; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct Action { pub index: u32, pub budget: Budget, pub tag: RedeemerTag, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub enum RedeemerTag { Spend, Mint, diff --git a/packages/sidan-csl-rs/src/model/js_vec.rs b/packages/sidan-csl-rs/src/model/js_vec.rs index 9bf823c..c66c9e5 100644 --- a/packages/sidan-csl-rs/src/model/js_vec.rs +++ b/packages/sidan-csl-rs/src/model/js_vec.rs @@ -26,6 +26,10 @@ impl JsVecString { pub fn add(&mut self, elem: String) { self.0.push(elem.clone()); } + + pub(crate) fn into_vec(self) -> Vec { + self.0 + } } impl IntoIterator for JsVecString { diff --git a/packages/sidan-csl-rs/src/model/tx_builder_types/utxo.rs b/packages/sidan-csl-rs/src/model/tx_builder_types/utxo.rs index 692a88d..95380b0 100644 --- a/packages/sidan-csl-rs/src/model/tx_builder_types/utxo.rs +++ b/packages/sidan-csl-rs/src/model/tx_builder_types/utxo.rs @@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize}; use crate::model::Asset; +use super::LanguageVersion; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UtxoInput { @@ -9,6 +11,13 @@ pub struct UtxoInput { pub tx_hash: String, } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScriptRef { + pub script_hex: String, + pub script_version: Option, +} + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UtxoOutput { @@ -16,7 +25,7 @@ pub struct UtxoOutput { pub amount: Vec, pub data_hash: Option, pub plutus_data: Option, - pub script_ref: Option, + pub script_ref: Option, pub script_hash: Option, } diff --git a/packages/sidan-csl-rs/src/wasm/transaction.rs b/packages/sidan-csl-rs/src/wasm/transaction.rs index 06a8cf1..52ed876 100644 --- a/packages/sidan-csl-rs/src/wasm/transaction.rs +++ b/packages/sidan-csl-rs/src/wasm/transaction.rs @@ -23,4 +23,4 @@ pub fn js_sign_transaction(tx_hex: String, signing_keys: JsVecString) -> WasmRes .as_slice(), ); WasmResult::from_result(result) -} +} \ No newline at end of file diff --git a/packages/sidan-csl-rs/src/wasm/txbuilder.rs b/packages/sidan-csl-rs/src/wasm/txbuilder.rs index 02a2bb0..b6ed85d 100644 --- a/packages/sidan-csl-rs/src/wasm/txbuilder.rs +++ b/packages/sidan-csl-rs/src/wasm/txbuilder.rs @@ -42,8 +42,8 @@ pub fn js_serialize_tx_body(mesh_tx_builder_body_json: &str, params_json: &str) #[test] fn test_js_serialize_tx_body() { - let mesh_tx_builder_body_json = r#"{"inputs":[{"scriptTxIn":{"txIn":{"txHash":"72a934097270cfdf8cdc445deba5928a004c52c78cbfe94c0024d4f043cc0e77","txIndex":0,"amount":[{"unit":"lovelace","quantity":"1017160"}],"address":"addr_test1wrw35u9mkg76cj0h3npuu4d5zjc3kyl57kyx460cu6zu93gpjj7h0"},"scriptTxIn":{"scriptSource":{"providedScriptSource":{"scriptCbor":"59032759032401010033333323232323232322322322322322322533300c323232323253323301230013013375400426464646464a66602e66e1d20000011533301a301937540102a0042c2a66602e600c0022a66603460326ea8020540085854ccc05ccdc3a40080022a66603460326ea8020540085854ccc05ccdc3a400c0022a66603460326ea8020540085858c05cdd5003899191929919980c99b87480000104cc008dd59801980d9baa00c30013301d375202a97ae01533301930080041330023756600660366ea8030c004cc074dd4809a5eb8054ccc064cdc3a40080082660046eacc00cc06cdd500618009980e9ba90114bd7009919299980d99198008009bac3021302230223022302200322533302000114a0264a66603c66e3cdd7181180100e0a511330030030013023001100114a064a66603c002294054ccc078c0840044c8c8c94ccc078cdc79bae30230030141533301e3371e002038266e1c009200114a02940dd7181118118011bad302130223022001375860400022940c8cc004004dd5981000111299980f8008a5eb804c8ccc888c8cc00400400c894ccc094004400c4c8cc09cdd3998139ba90063302730240013302730250014bd7019801801981480118138009bae301e0013756603e0026600600660460046042002603e603e603e603e60366ea8030dd2a400444646600200200644a66603c00229404c94ccc070cdd7802180e98108010a5113300300300130210012301c301d301d301d301d301d301d0013016375400c60326034004603000260286ea8008dc3a40042c602a602c004602800260280046024002601c6ea800452613656375c0026eb8004dd70009bae001375c002ae6955ceaab9e5573eae815d0aba24c011e581cd161d64eef0eeb59f9124f520f8c8f3b717ed04198d54c8b17e604ae004c011e581c3dc7e4d31bf34d68a822712c47bbf544d74c22fe2350ae7bb51a3f02004c011e581c3dc7e4d31bf34d68a822712c47bbf544d74c22fe2350ae7bb51a3f02004c011e581c18c154376a49c965027adb6afbe97ce43c96a2f9b8bf0eaf9ff15851004c011e581ccc0932775ffd17eba5738509ad28e45637b3d3d45d182d5f1fbf9fe20001","languageVersion":"v3"}},"datumSource":{"inlineDatumSource":{"txHash":"72a934097270cfdf8cdc445deba5928a004c52c78cbfe94c0024d4f043cc0e77","txIndex":0}},"redeemer":{"data":"d87980","exUnits":{"mem":7000000,"steps":3000000000}}}}},{"pubKeyTxIn":{"txIn":{"txHash":"3c05db00dfec497ce870faaa67e6176f8e08352689bee93e203c12cc800c3ebc","txIndex":4,"amount":[{"unit":"lovelace","quantity":"106756821"}],"address":"addr_test1qrgkr4jwau8wkk0ezf84yruv3uahzlksgxvd2nytzlnqft4x8s2nlvl23f82fut92a82jytnw4k7p0esygk2p626vjdqu58u9n"}}}],"outputs":[],"collaterals":[{"txIn":{"txHash":"3c05db00dfec497ce870faaa67e6176f8e08352689bee93e203c12cc800c3ebc","txIndex":0,"amount":[{"unit":"lovelace","quantity":"5000000"}],"address":"addr_test1qrgkr4jwau8wkk0ezf84yruv3uahzlksgxvd2nytzlnqft4x8s2nlvl23f82fut92a82jytnw4k7p0esygk2p626vjdqu58u9n"}}],"requiredSignatures":["d161d64eef0eeb59f9124f520f8c8f3b717ed04198d54c8b17e604ae","5ca51b304b1f79d92eada8c58c513e969458dcd27ce4f5bc47823ffa"],"referenceInputs":[{"txHash":"8d68748457cd0f1a8596f41fd2125a415315897d2da4a4b94335829cee7198ae","txIndex":0}],"mints":[],"changeAddress":"addr_test1qrgkr4jwau8wkk0ezf84yruv3uahzlksgxvd2nytzlnqft4x8s2nlvl23f82fut92a82jytnw4k7p0esygk2p626vjdqu58u9n","metadata":[],"validityRange":{"invalidBefore":null,"invalidHereafter":null},"certificates":[],"signingKey":[],"withdrawals":[{"plutusScriptWithdrawal":{"address":"stake_test17q7u0exnr0e5669gyfcjc3am74zdwnpzlc34ptnmk5dr7qszs53fr","coin":0,"scriptSource":{"inlineScriptSource":{"refTxIn":{"txHash":"f75b8c0ce490b11ba002bc7ed483119665eb8b52d9a11afb0b4a448ca2663d52","txIndex"#; - // let mesh_tx_builder_body_json = r#"{"inputs":[{"pubKeyTxIn":{"txIn":{"txHash":"5b0145fe7b0212a7807e7dba24997049374d965f587300a2039b73cd30806c78","txIndex":1,"amount":[{"unit":"lovelace","quantity":"1132923230"}],"address":"addr_test1qq0yavv5uve45rwvfaw96qynrqt8ckpmkwcg08vlwxxdncxk82f5wz75mzaesmqzl79xqsmedwgucwtuav5str6untqqmykcpn"}}}],"outputs":[{"address":"addr_test1wpnlxv2xv9a9ucvnvzqakwepzl9ltx7jzgm53av2e9ncv4sysemm8","amount":[{"unit":"lovelace","quantity":"1600000"}],"datum":{"hash":{"type":"Mesh","content":"supersecret"}},"referenceScript":null}],"collaterals":[{"txIn":{"txHash":"ec0c2e70b898cf531b03c9db937602e98c45378d9fa8e8a5b5a91ec5c1d7540d","txIndex":5,"amount":[{"unit":"lovelace","quantity":"5000000"}],"address":"addr_test1qq0yavv5uve45rwvfaw96qynrqt8ckpmkwcg08vlwxxdncxk82f5wz75mzaesmqzl79xqsmedwgucwtuav5str6untqqmykcpn"}}],"requiredSignatures":[],"referenceInputs":[],"mints":[],"changeAddress":"addr_test1qq0yavv5uve45rwvfaw96qynrqt8ckpmkwcg08vlwxxdncxk82f5wz75mzaesmqzl79xqsmedwgucwtuav5str6untqqmykcpn","metadata":[],"validityRange":{"invalidBefore":null,"invalidHereafter":null},"certificates":[],"signingKey":[],"withdrawals":[]}"#; + // let mesh_tx_builder_body_json = r#"{"inputs":[{"scriptTxIn":{"txIn":{"txHash":"72a934097270cfdf8cdc445deba5928a004c52c78cbfe94c0024d4f043cc0e77","txIndex":0,"amount":[{"unit":"lovelace","quantity":"1017160"}],"address":"addr_test1wrw35u9mkg76cj0h3npuu4d5zjc3kyl57kyx460cu6zu93gpjj7h0"},"scriptTxIn":{"scriptSource":{"providedScriptSource":{"scriptCbor":"59032759032401010033333323232323232322322322322322322533300c323232323253323301230013013375400426464646464a66602e66e1d20000011533301a301937540102a0042c2a66602e600c0022a66603460326ea8020540085854ccc05ccdc3a40080022a66603460326ea8020540085854ccc05ccdc3a400c0022a66603460326ea8020540085858c05cdd5003899191929919980c99b87480000104cc008dd59801980d9baa00c30013301d375202a97ae01533301930080041330023756600660366ea8030c004cc074dd4809a5eb8054ccc064cdc3a40080082660046eacc00cc06cdd500618009980e9ba90114bd7009919299980d99198008009bac3021302230223022302200322533302000114a0264a66603c66e3cdd7181180100e0a511330030030013023001100114a064a66603c002294054ccc078c0840044c8c8c94ccc078cdc79bae30230030141533301e3371e002038266e1c009200114a02940dd7181118118011bad302130223022001375860400022940c8cc004004dd5981000111299980f8008a5eb804c8ccc888c8cc00400400c894ccc094004400c4c8cc09cdd3998139ba90063302730240013302730250014bd7019801801981480118138009bae301e0013756603e0026600600660460046042002603e603e603e603e60366ea8030dd2a400444646600200200644a66603c00229404c94ccc070cdd7802180e98108010a5113300300300130210012301c301d301d301d301d301d301d0013016375400c60326034004603000260286ea8008dc3a40042c602a602c004602800260280046024002601c6ea800452613656375c0026eb8004dd70009bae001375c002ae6955ceaab9e5573eae815d0aba24c011e581cd161d64eef0eeb59f9124f520f8c8f3b717ed04198d54c8b17e604ae004c011e581c3dc7e4d31bf34d68a822712c47bbf544d74c22fe2350ae7bb51a3f02004c011e581c3dc7e4d31bf34d68a822712c47bbf544d74c22fe2350ae7bb51a3f02004c011e581c18c154376a49c965027adb6afbe97ce43c96a2f9b8bf0eaf9ff15851004c011e581ccc0932775ffd17eba5738509ad28e45637b3d3d45d182d5f1fbf9fe20001","languageVersion":"v3"}},"datumSource":{"inlineDatumSource":{"txHash":"72a934097270cfdf8cdc445deba5928a004c52c78cbfe94c0024d4f043cc0e77","txIndex":0}},"redeemer":{"data":"d87980","exUnits":{"mem":7000000,"steps":3000000000}}}}},{"pubKeyTxIn":{"txIn":{"txHash":"3c05db00dfec497ce870faaa67e6176f8e08352689bee93e203c12cc800c3ebc","txIndex":4,"amount":[{"unit":"lovelace","quantity":"106756821"}],"address":"addr_test1qrgkr4jwau8wkk0ezf84yruv3uahzlksgxvd2nytzlnqft4x8s2nlvl23f82fut92a82jytnw4k7p0esygk2p626vjdqu58u9n"}}}],"outputs":[],"collaterals":[{"txIn":{"txHash":"3c05db00dfec497ce870faaa67e6176f8e08352689bee93e203c12cc800c3ebc","txIndex":0,"amount":[{"unit":"lovelace","quantity":"5000000"}],"address":"addr_test1qrgkr4jwau8wkk0ezf84yruv3uahzlksgxvd2nytzlnqft4x8s2nlvl23f82fut92a82jytnw4k7p0esygk2p626vjdqu58u9n"}}],"requiredSignatures":["d161d64eef0eeb59f9124f520f8c8f3b717ed04198d54c8b17e604ae","5ca51b304b1f79d92eada8c58c513e969458dcd27ce4f5bc47823ffa"],"referenceInputs":[{"txHash":"8d68748457cd0f1a8596f41fd2125a415315897d2da4a4b94335829cee7198ae","txIndex":0}],"mints":[],"changeAddress":"addr_test1qrgkr4jwau8wkk0ezf84yruv3uahzlksgxvd2nytzlnqft4x8s2nlvl23f82fut92a82jytnw4k7p0esygk2p626vjdqu58u9n","metadata":[],"validityRange":{"invalidBefore":null,"invalidHereafter":null},"certificates":[],"signingKey":[],"withdrawals":[{"plutusScriptWithdrawal":{"address":"stake_test17q7u0exnr0e5669gyfcjc3am74zdwnpzlc34ptnmk5dr7qszs53fr","coin":0,"scriptSource":{"inlineScriptSource":{"refTxIn":{"txHash":"f75b8c0ce490b11ba002bc7ed483119665eb8b52d9a11afb0b4a448ca2663d52","txIndex"#; + let mesh_tx_builder_body_json = r#"{"inputs":[{"pubKeyTxIn":{"txIn":{"txHash":"5b0145fe7b0212a7807e7dba24997049374d965f587300a2039b73cd30806c78","txIndex":1,"amount":[{"unit":"lovelace","quantity":"1132923230"}],"address":"addr_test1qq0yavv5uve45rwvfaw96qynrqt8ckpmkwcg08vlwxxdncxk82f5wz75mzaesmqzl79xqsmedwgucwtuav5str6untqqmykcpn"}}}],"outputs":[{"address":"addr_test1wpnlxv2xv9a9ucvnvzqakwepzl9ltx7jzgm53av2e9ncv4sysemm8","amount":[{"unit":"lovelace","quantity":"1600000"}],"datum":{"hash":{"type":"Mesh","content":"supersecret"}},"referenceScript":null}],"collaterals":[{"txIn":{"txHash":"ec0c2e70b898cf531b03c9db937602e98c45378d9fa8e8a5b5a91ec5c1d7540d","txIndex":5,"amount":[{"unit":"lovelace","quantity":"5000000"}],"address":"addr_test1qq0yavv5uve45rwvfaw96qynrqt8ckpmkwcg08vlwxxdncxk82f5wz75mzaesmqzl79xqsmedwgucwtuav5str6untqqmykcpn"}}],"requiredSignatures":[],"referenceInputs":[],"mints":[],"changeAddress":"addr_test1qq0yavv5uve45rwvfaw96qynrqt8ckpmkwcg08vlwxxdncxk82f5wz75mzaesmqzl79xqsmedwgucwtuav5str6untqqmykcpn","metadata":[],"validityRange":{"invalidBefore":null,"invalidHereafter":null},"certificates":[],"signingKey":[],"withdrawals":[]}"#; let params_json = r#"{"epoch":0,"coinsPerUtxoSize":0,"priceMem":0,"priceStep":0,"minFeeA":0,"minFeeB":0,"keyDeposit":2000000,"maxTxSize":16384,"maxValSize":5000,"poolDeposit":500000000,"maxCollateralInputs":3,"decentralisation":0,"maxBlockSize":65536,"collateralPercent":150,"maxBlockHeaderSize":1100,"minPoolCost":"340000000","maxTxExMem":"14000000","maxTxExSteps":"10000000000","maxBlockExMem":"62000000","maxBlockExSteps":"20000000000","minFeeRefScriptCostPerByte":15}"#; let tx_build_result = js_serialize_tx_body(mesh_tx_builder_body_json, params_json); println!("{:?}", tx_build_result); diff --git a/packages/whisky-examples/Cargo.toml b/packages/whisky-examples/Cargo.toml index 358d62c..df9bcbf 100644 --- a/packages/whisky-examples/Cargo.toml +++ b/packages/whisky-examples/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whisky-examples" -version = "0.8.7" +version = "0.9.0" edition = "2021" license = "Apache-2.0" description = "The Cardano Rust SDK, inspired by MeshJS" @@ -13,4 +13,4 @@ path = "src/server.rs" actix-cors = "0.7.0" actix-web = "4.9.0" serde = "1.0.209" -whisky = { version = "=0.8.7", path = "../whisky" } +whisky = { version = "=0.9.0", path = "../whisky" } diff --git a/packages/whisky/Cargo.toml b/packages/whisky/Cargo.toml index 7fb4a83..6f3f1e9 100644 --- a/packages/whisky/Cargo.toml +++ b/packages/whisky/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whisky" -version = "0.8.7" +version = "0.9.0" edition = "2021" license = "Apache-2.0" description = "The Cardano Rust SDK, inspired by MeshJS" @@ -16,15 +16,15 @@ serde_json = "1.0" cryptoxide = "0.4.4" serde-wasm-bindgen = "0.6.5" async-trait = "0.1.79" -uplc = "=1.1.1" +uplc = "=1.1.4" wasm-bindgen = { version = "=0.2.92", features = ["serde-serialize"] } rand_os = "0.1" noop_proc_macro = "0.3.0" -pallas-codec = { version = "0.30.1", features = ["num-bigint"] } -pallas-primitives = "0.30.1" -pallas-traverse = "0.30.1" +pallas-codec = { version = "0.30.2", features = ["num-bigint"] } +pallas-primitives = "0.30.2" +pallas-traverse = "0.30.2" maestro-rust-sdk = "1.1.3" -sidan-csl-rs = { version = "=0.8.7", path = "../sidan-csl-rs" } +sidan-csl-rs = { version = "=0.9.0", path = "../sidan-csl-rs" } reqwest = "0.12.5" tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] } diff --git a/packages/whisky/src/builder/tx_eval.rs b/packages/whisky/src/builder/tx_eval.rs index ba33c6f..bbd7360 100644 --- a/packages/whisky/src/builder/tx_eval.rs +++ b/packages/whisky/src/builder/tx_eval.rs @@ -1,30 +1,7 @@ use async_trait::async_trait; -use pallas_codec::utils::NonEmptyKeyValuePairs; -use pallas_primitives::conway::PlutusV3Script; -use pallas_primitives::conway::RedeemerTag as PRedeemerTag; -use sidan_csl_rs::core::constants::get_cost_models_from_network; -use sidan_csl_rs::csl::{self, JsError}; -use std::collections::HashMap; -use uplc::tx::SlotConfig; - -use csl::Address; -use pallas_codec::minicbor::Decoder; -use pallas_codec::utils::{Bytes, CborWrap, PositiveCoin}; -use pallas_primitives::{ - conway::{ - AssetName, Coin, CostMdls, DatumOption, PlutusData, PolicyId, PostAlonzoTransactionOutput, - PseudoScript, ScriptRef, TransactionOutput, Value, - }, - Fragment, -}; -use pallas_traverse::{Era, MultiEraTx}; -use sidan_csl_rs::core::tx_parser::MeshTxParser; -use sidan_csl_rs::model::{Action, Asset, Budget, Network, RedeemerTag, UTxO, UtxoOutput}; -use uplc::{ - tx::{eval_phase_two, ResolvedInput}, - Hash, TransactionInput, -}; - +use sidan_csl_rs::csl::JsError; +use sidan_csl_rs::model::{Action, Network, UTxO}; +use sidan_csl_rs::core::utils::evaluate_tx_scripts; use crate::service::Evaluator; #[derive(Clone, Debug)] @@ -50,58 +27,7 @@ impl MeshTxEvaluator { additional_txs: &[String], network: &Network, ) -> Result, JsError> { - let tx_bytes = hex::decode(tx_hex).expect("Invalid tx hex"); - let mtx = MultiEraTx::decode_for_era(Era::Conway, &tx_bytes); - let tx = match mtx { - Ok(MultiEraTx::Conway(tx)) => tx.into_owned(), - _ => return Err(JsError::from_str("Invalid Tx Era")), - }; - - let tx_outs: Vec = additional_txs - .iter() - .flat_map(|tx| { - let parsed_tx = MeshTxParser::new(tx).unwrap(); - println!( - "txout: {:?}", - &parsed_tx.get_tx_outs_utxo().unwrap().clone() - ); - println!("txout_cbor: {:?}", &parsed_tx.get_tx_outs_cbor().clone()); - parsed_tx.get_tx_outs_utxo().unwrap() //TODO: handle error - }) - .collect(); - - // combine inputs and tx_outs - let all_inputs: Vec = inputs.iter().chain(tx_outs.iter()).cloned().collect(); - - eval_phase_two( - &tx, - &to_pallas_utxos(&all_inputs)?, - Some(&get_cost_mdls(network)?), - None, - &SlotConfig::default(), - false, - |_r| (), - ) - .map_err(|err| JsError::from_str(&format!("Error occurred during evaluation: {}", err))) - .map(|reds| { - reds.into_iter() - .map(|red| Action { - index: red.index, - budget: Budget { - mem: red.ex_units.mem, - steps: red.ex_units.steps, - }, - tag: match red.tag { - PRedeemerTag::Spend => RedeemerTag::Spend, - PRedeemerTag::Mint => RedeemerTag::Mint, - PRedeemerTag::Cert => RedeemerTag::Cert, - PRedeemerTag::Reward => RedeemerTag::Reward, - PRedeemerTag::Vote => RedeemerTag::Vote, - PRedeemerTag::Propose => RedeemerTag::Propose, - }, - }) - .collect() - }) + evaluate_tx_scripts(tx_hex, inputs, additional_txs, network) } } @@ -116,388 +42,4 @@ impl Evaluator for MeshTxEvaluator { ) -> Result, JsError> { self.evaluate_tx_sync(tx_hex, inputs, additional_txs, network) } -} - -fn get_cost_mdls(network: &Network) -> Result { - let cost_model_list = get_cost_models_from_network(network); - if cost_model_list.len() < 3 { - return Err(JsError::from_str( - "Cost models have to contain at least PlutusV1, PlutusV2, and PlutusV3 costs", - )); - }; - Ok(CostMdls { - plutus_v1: Some(cost_model_list[0].clone()), - plutus_v2: Some(cost_model_list[1].clone()), - plutus_v3: Some(cost_model_list[2].clone()), - }) -} - -fn to_pallas_utxos(utxos: &Vec) -> Result, JsError> { - let mut resolved_inputs = Vec::new(); - for utxo in utxos { - let tx_hash: [u8; 32] = hex::decode(&utxo.input.tx_hash) - .map_err(|err| JsError::from_str(&format!("Invalid tx hash found: {}", err)))? - .try_into() - .map_err(|_e| JsError::from_str("Invalid tx hash length found"))?; - - let resolved_input = ResolvedInput { - input: TransactionInput { - transaction_id: Hash::from(tx_hash), - index: utxo.input.output_index.into(), - }, - output: TransactionOutput::PostAlonzo(PostAlonzoTransactionOutput { - address: Bytes::from( - Address::from_bech32(&utxo.output.address) - .unwrap() - .to_bytes(), - ), - value: to_pallas_value(&utxo.output.amount)?, - datum_option: to_pallas_datum(&utxo.output)?, - script_ref: to_pallas_script_ref(&utxo.output)?, - }), - }; - resolved_inputs.push(resolved_input); - } - Ok(resolved_inputs) -} - -// TODO: handle native and plutusV1 scripts -fn to_pallas_script_ref(utxo_output: &UtxoOutput) -> Result>, JsError> { - if let Some(script) = &utxo_output.script_ref { - let script_bytes = hex::decode(script) - .map_err(|err| JsError::from_str(&format!("Invalid script hex found: {}", err)))?; - - let unwrapped_bytes = Decoder::new(&script_bytes) - .bytes() - .map_err(|err| JsError::from_str(&format!("Invalid script hex found: {}", err)))?; - - // TODO: handle dynamic script version - Ok(Some(CborWrap(PseudoScript::PlutusV3Script( - PlutusV3Script(unwrapped_bytes.to_vec().into()), - )))) - } else { - Ok(None) - } -} - -fn to_pallas_datum(utxo_output: &UtxoOutput) -> Result, JsError> { - if let Some(inline_datum) = &utxo_output.plutus_data { - let csl_plutus_data = csl::PlutusData::from_hex(inline_datum).map_err(|err| { - JsError::from_str(&format!( - "Invalid plutus data found for utxo: [{:?}], err: {}", - utxo_output, err - )) - })?; - - let plutus_data_bytes = csl_plutus_data.to_bytes(); - let datum = CborWrap( - PlutusData::decode_fragment(&plutus_data_bytes) - .map_err(|_e| JsError::from_str("Invalid plutus data found"))?, - ); - Ok(Some(DatumOption::Data(datum))) - } else if let Some(datum_hash) = &utxo_output.data_hash { - let datum_hash_bytes: [u8; 32] = hex::decode(datum_hash) - .map_err(|err| JsError::from_str(&format!("Invalid datum hash found: {}", err)))? - .try_into() - .map_err(|_e| JsError::from_str("Invalid byte length of datum hash found"))?; - Ok(Some(DatumOption::Hash(Hash::from(datum_hash_bytes)))) - } else { - Ok(None) - } -} - -fn to_pallas_value(assets: &Vec) -> Result { - if assets.len() == 1 { - match assets[0].unit().as_str() { - "lovelace" => Ok(Value::Coin(assets[0].quantity().parse::().unwrap())), - _ => Err(JsError::from_str("Invalid value")), - } - } else { - to_pallas_multi_asset_value(assets) - } -} - -fn to_pallas_multi_asset_value(assets: &Vec) -> Result { - let mut coins: Coin = 0; - let mut asset_mapping: HashMap> = HashMap::new(); - for asset in assets { - if asset.unit() == "lovelace" || asset.unit().is_empty() { - coins = asset.quantity().parse::().unwrap(); - } else { - let asset_unit = asset.unit(); - let (policy_id, asset_name) = asset_unit.split_at(56); - asset_mapping - .entry(policy_id.to_string()) - .or_default() - .push((asset_name.to_string(), asset.quantity().clone())) - } - } - - let mut multi_asset = Vec::new(); - for (policy_id, asset_list) in &asset_mapping { - let policy_id_bytes: [u8; 28] = hex::decode(policy_id) - .map_err(|err| JsError::from_str(&format!("Invalid policy id found: {}", err)))? - .try_into() - .map_err(|_e| JsError::from_str("Invalid length policy id found"))?; - - let policy_id = PolicyId::from(policy_id_bytes); - let mut mapped_assets = Vec::new(); - for asset in asset_list { - let (asset_name, asset_quantity) = asset; - let asset_name_bytes = - AssetName::from(hex::decode(asset_name).map_err(|err| { - JsError::from_str(&format!("Invalid asset name found: {}", err)) - })?); - mapped_assets.push(( - asset_name_bytes, - PositiveCoin::try_from(asset_quantity.parse::().unwrap()).unwrap(), - )); - } - multi_asset.push((policy_id, NonEmptyKeyValuePairs::Def(mapped_assets))); - } - let pallas_multi_asset = pallas_codec::utils::NonEmptyKeyValuePairs::Def(multi_asset); - Ok(Value::Multiasset(coins, pallas_multi_asset)) -} - -#[cfg(test)] -mod test { - use pallas_codec::minicbor::Decoder; - - // use crate::builder::WData; - - // use super::*; - // use sidan_csl_rs::model::{Asset, UTxO, UtxoInput, UtxoOutput}; - // #[test] - // fn test_eval() { - // let result = tx_eval("84a80083825820879f68fef00fa676abcfba0396916299eddbf29e1103442aee031b383ee0f3ad01825820f51f44f1f16ceca8a96903b8f494a2da857a244066fa30c67e641d0f729fbde80c825820f51f44f1f16ceca8a96903b8f494a2da857a244066fa30c67e641d0f729fbde80d0181a300583910634a34d9c1ec5dd0cae61e4c86a4e85214bafdc80c57214fc80745b55ca749261aa3b17aa2cd4b026bc6566c4b14421d6083edce64ffe5cb011a1e6233b3028201d81858b1d8799fd8799fd87a9f581c103207deb2d24502f8438b5fcc556291877d5d365dafea4fcbd6d1d2ffd8799fd8799fd8799f581c5ca749261aa3b17aa2cd4b026bc6566c4b14421d6083edce64ffe5cbffffffffd8799fd87a9f581cfc259a2fc1a9fa6a6a902675aeba5415d0c33fc72049f5dc80e2b76effd8799fd8799fd8799f581c5ca749261aa3b17aa2cd4b026bc6566c4b14421d6083edce64ffe5cbffffffffd879801a000874101a1dcd6500ff021a0003c7cd09a00b5820b3d4c887f173ac071aff2e5ef18943311e9cad5cb7c4b578bebc82e1ff7628a50d818258203fbdf2b0b4213855dd9b87f7c94a50cf352ba6edfdded85ecb22cf9ceb75f814070e82581c36314aebecfbc929ee447dcb50fd690604eceae9403a298d9b1f9a54581c5ca51b304b1f79d92eada8c58c513e969458dcd27ce4f5bc47823ffa1285825820f51f44f1f16ceca8a96903b8f494a2da857a244066fa30c67e641d0f729fbde80d825820efe6fbbdd6b993d96883b96c572bfcaa0a4a138c83bd948dec1751d1bfda09b300825820879f68fef00fa676abcfba0396916299eddbf29e1103442aee031b383ee0f3ad01825820c4678d163c493e363f9e7fd9a310855ca6b4bdf508c73a463e1532d168dfb9a800825820f51f44f1f16ceca8a96903b8f494a2da857a244066fa30c67e641d0f729fbde80ca3008282582062f8f9ce8a5ed02fd67d6f2885b927874241a94b41e08fa5a99fc1e3bbca6453584051c0fe402fa75da2959e85eec47c45cf26149d8607be131ebaee4e86c92fe9e6ce9fa581192d7d644a216f4fbfd9fe94d6a827aba2ed0d81db6ff30095e8eb0d8258207f4747ca0c20a1e5c28716c4a10fffbcbe8fe6253cb427ae2f0e24d231a980845840e50b051bdad6c6c04d72bd5ed42f5bd981fa60c6709bacd24b5757f60418dabaa5455674e5135ab04d569f4db519ae1905ebbd47dca08df810a15c063ce0550503800583840000d87980821a000315621a04398879840001d87980821a000315621a04398879840002d87980821a000315621a04398879f5f6", - // &vec![UTxO { - // input: UtxoInput { - // tx_hash: "879f68fef00fa676abcfba0396916299eddbf29e1103442aee031b383ee0f3ad".to_string(), - // output_index: 1 - // }, - // output: UtxoOutput { - // address: "addr_test1zptl0h0ceq3d4tgrlkqgyv2n5cwez0juj9rm63uw8nxhpv6u5ayjvx4rk9a29n2tqf4uv4nvfv2yy8tqs0kuue8luh9sczalnn".to_string(), - // amount: vec![Asset { - // unit: "lovelace".to_string(), - // quantity: "5000000".to_string(), - // }], - // data_hash: None, - // plutus_data: Some(json!({ - // "constructor": 0, - // "fields": [] - // }).to_string()), - // script_hash: None, - // script_ref: Some("590a8c010000333323232323232323232232232232222323232533300f323232323232323232323232323232323232323253330233370e90000008a99981199b8748008c0880084c94ccc090cdc3a4000604600226464646464646464a66605e60640042646644646600200200444a66606800229444c8c94ccc0cccc0880180084cc010010004528181c0011bae30360013758602a605601c660626ea409ccc0c4dd480225eb80c94ccc0b4cdc3a4000002264646464a666068606e004264649319299981999b87480000044c8c94ccc0e0c0ec0084c9263253330363370e900000089919299981d981f00109924c60520022c607800260680042a66606c66e1d20020011323232323232533303f3042002149858dd6982000098200011bad303e001303e002375a607800260680042c60680022c607200260620062a66606666e1d200200115333036303100314985858c0c4008c08800c58c0d4004c0d4008c0cc004c0ac01858c0ac01458dd7181800098180011bae302e001302e002302c001302c002375c605400260440022c6464a66604a66e1d20003024001132323253330283370e900218138008981698130008b180b981298081812800981580098118008b19809000919b873330103756601c6046601c60460020429110048008dd6180618108020b0a99981199b87480080044c8c94ccc094cdc3a40046048008264a66604c66e1d20003025001132323253330293370e90021814000899191919299981699b87480080044c8c8c8c8c8c8c8c94ccc0d54ccc0d54ccc0d4010400c52808010a50100114a066660326eacc060c0c80540b0c05cc078c0c8c074c0c80352001323232323232323232533303c3370e9001181d80109919299981f002899b88010001003375a60840026074004002264a66607866e1d2002303b00213232533303e0050031337120200026eb4c108004c0e8008004528181d80119b8748008c0e8dd5181d80099bb00033330380014c103d87a80004c0103d87980003370e9001181c1baa303c001303c002303a0013032301e3032001301930310143302137586034606002605866e3c0040acdd7181a800981a8011bad3033001302b00314a06056004603e002605e002604e0022c6030604c6022604c002605800260480022c660186eb0c03cc08c01800458c0a4004c0840644c8c94ccc094cdc3a400460480082646464a66605066e1d200030270011323232323253330303033002132323232325333032533303253330325333032005100414a020062940400852808008a50323232323232323232533303a3370e9001181c80109919299981e002899b88001018003375a60800026070004002264a66607466e1d2002303900213232533303c0050031337120020306eb4c100004c0e0008004528181c80119b8748008c0e0dd5181c80099bb00033330360014c103d87a80004c0103d87980003370e9001181b1baa303a001303a00230380013030301b30300013017302f012323253330323370e900200089919299981a19b8748008c0cc0044c8c8c8c94ccc0ecc0f800854ccc0e0cdc7800819099b8700301414a02c6eb8c0f0004c0f0008dd6981d00098190008b181c00098180010a5030300013020302e004323253330313370e900200089919299981999b8748010c0c80044c8c94ccc0e0c0ec0084cdc78008178b1bae30390013031001163037001302f00214a0605e002603e605a6030605a00c66660266eacc048c0b003c098c04401120023301c3758602a605601c04e2c60620026644646600200200644a666064002297ae013232533303153330313375e6036605e00400e266e1cccc070dd5980d1817801014802a400429404cc0d4008cc0100100044cc010010004c0d8008c0d0004dd6180d98148061807000980a181418099814000981700098130008b198071bac30113025008001302b001302300416375a605200260420326042030604c002604c00460480026038026464a66603e66e1d2002301e00113232323253330233370e90010008980780189919299981299b8748000c0900044c8c8c94ccc0a0cdc3a4000002260286602a0106eb8c0b4c0980084c050cc054020dd7181698130011813000981580098118008b1814800981080118108009805180f8021bae3025001301d001163008301c001230223023302330233023001222232533302300114a0264a666048002264646464a66604aa66604a66e3c0040244cdc78010040a5013370e00600e2940dd718148019bae30283029002375a604e605060500026eb0c09800852818130009919198008008011129998128008a5eb804c8ccc888c8cc00400400c894ccc0ac004400c4c8cc0b4dd3998169ba90063302d37526eb8c0a8004cc0b4dd41bad302b0014bd7019801801981780118168009bae30240013756604a002660060066052004604e002646600200200a44a666048002297adef6c6013232323253330253371e911000021003133029337606ea4008dd3000998030030019bab3026003375c60480046050004604c0024604060426042604260426042604260420024466012004466ebcc018c0680040088c078c07cc07cc07cc07cc07cc07cc07cc07c0048c074c0780048c070004888c8c8c94ccc06ccdc3a40040022900009bad30203019002301900132533301a3370e90010008a60103d87a8000132323300100100222533302000114c103d87a800013232323253330213371e014004266e95200033025375000297ae0133006006003375a60440066eb8c080008c090008c088004dd5980f980c001180c000991980080080211299980e8008a6103d87a8000132323232533301e3371e010004266e95200033022374c00297ae01330060060033756603e0066eb8c074008c084008c07c0048dca0009119b8a00200122323300100100322533301900114c0103d87a8000132325333018300500213374a90001980e00125eb804cc010010004c074008c06c00488c8cc00400400c894ccc06000452809919299980b99b8f00200514a226600800800260380046eb8c0680048c058c05cc05c0048c94ccc044cdc3a400000226464a66602c60320042930b1bae3017001300f002153330113370e900100089919299980b180c8010a4c2c6eb8c05c004c03c00858c03c0045261365632533300f3370e90000008a99980918068028a4c2c2a66601e66e1d20020011323253330143017002132498c94ccc048cdc3a4000002264646464a66603260380042649319299980b99b87480000044c8c94ccc070c07c00852616375c603a002602a0082c602a0062c6eb4c068004c068008c060004c04000858c04000458c054004c03401454ccc03ccdc3a400800226464a666028602e0042930b1bad3015001300d00516300d0043001004232533300e3370e90000008a99980898060010a4c2c2a66601c66e1d200200113232323253330153018002149858dd7180b000980b0011bad3014001300c0021533300e3370e9002000899192999809980b0010a4c2c6eb8c050004c03000858c030004dd70009bae001375c0024600a6ea80048c00cdd5000ab9a5573aaae7955cfaba05742ae8930011e581ce6e5285a878161c101a59b4e36f1f99e5e464d30f510be3ee34f907f004c011e581cd161d64eef0eeb59f9124f520f8c8f3b717ed04198d54c8b17e604ae004c011e581c2291f67ee643db1a830734bd54d39022c5d1f990682e689c95d8fed00001".to_string()), - // } - // }, - // UTxO { - // input: UtxoInput { - // tx_hash: "f51f44f1f16ceca8a96903b8f494a2da857a244066fa30c67e641d0f729fbde8".to_string(), - // output_index: 12 - // }, - // output: UtxoOutput { - // address: "addr_test1zqgryp77ktfy2qhcgw94lnz4v2gcwl2axew6l6j0e0tdr5ju5ayjvx4rk9a29n2tqf4uv4nvfv2yy8tqs0kuue8luh9sl4yffp".to_string(), - // amount: vec![Asset { - // unit: "lovelace".to_string(), - // quantity: "5000000".to_string(), - // }], - // data_hash: None, - // plutus_data: Some(json!({ - // "constructor": 0, - // "fields": [] - // }).to_string()), - // script_hash: None, - // script_ref: None, - // } - // }, - // UTxO { - // input: UtxoInput { - // tx_hash: "f51f44f1f16ceca8a96903b8f494a2da857a244066fa30c67e641d0f729fbde8".to_string(), - // output_index: 13 - // }, - // output: UtxoOutput { - // address: "addr_test1qqmrzjhtanauj20wg37uk58adyrqfm82a9qr52vdnv0e54r42v0mu8ngky0f5yxmh3wl3z0da2fryk59kavth0u8xhvsufgmc8".to_string(), - // amount: vec![Asset { - // unit: "lovelace".to_string(), - // quantity: "143618073".to_string(), - // }, Asset { - // unit: "5066154a102ee037390c5236f78db23239b49c5748d3d349f3ccf04b55534458".to_string(), - // quantity: "499000000".to_string(), - // }], - // data_hash: None, - // plutus_data: Some(json!({ - // "constructor": 0, - // "fields": [] - // }).to_string()), - // script_hash: None, - // script_ref: None, - // } - // }, - // UTxO { - // input: UtxoInput { - // tx_hash: "efe6fbbdd6b993d96883b96c572bfcaa0a4a138c83bd948dec1751d1bfda09b3".to_string(), - // output_index: 0 - // }, - // output: UtxoOutput { - // address: "addr_test1zqjmsmh2sjjy508e3068pck6lgp23k2msypgc52cxcgzjlju5ayjvx4rk9a29n2tqf4uv4nvfv2yy8tqs0kuue8luh9s5cdt49".to_string(), - // amount: vec![Asset { - // unit: "lovelace".to_string(), - // quantity: "1909330".to_string(), - // }, Asset { - // unit: "e6e5285a878161c101a59b4e36f1f99e5e464d30f510be3ee34f907f".to_string(), - // quantity: "1".to_string(), - // }], - // data_hash: None, - // plutus_data: Some(json!({ - // "constructor": 0, - // "fields": [ - // { - // "bytes": "e6e5285a878161c101a59b4e36f1f99e5e464d30f510be3ee34f907f" - // }, - // { - // "constructor": 0, - // "fields": [ - // { - // "constructor": 1, - // "fields": [ - // { - // "bytes": "25b86eea84a44a3cf98bf470e2dafa02a8d95b81028c51583610297e" - // } - // ] - // }, - // { - // "constructor": 0, - // "fields": [ - // { - // "constructor": 0, - // "fields": [ - // { - // "constructor": 0, - // "fields": [ - // { - // "bytes": "5ca749261aa3b17aa2cd4b026bc6566c4b14421d6083edce64ffe5cb" - // } - // ] - // } - // ] - // } - // ] - // } - // ] - // }, - // { - // "bytes": "5ca51b304b1f79d92eada8c58c513e969458dcd27ce4f5bc47823ffa" - // }, - // { - // "bytes": "bbb1a36cc3e076d689176e77374ca26d4e09047c9d9dbd10ab0dcdae" - // } - // ] - // }).to_string()), - // script_hash: None, - // script_ref: None, - // } - // }, - // UTxO { - // input: UtxoInput { - // tx_hash: "c4678d163c493e363f9e7fd9a310855ca6b4bdf508c73a463e1532d168dfb9a8".to_string(), - // output_index: 0 - // }, - // output: UtxoOutput { - // address: "addr_test1zqgryp77ktfy2qhcgw94lnz4v2gcwl2axew6l6j0e0tdr5ju5ayjvx4rk9a29n2tqf4uv4nvfv2yy8tqs0kuue8luh9sl4yffp".to_string(), - // amount: vec![Asset { - // unit: "lovelace".to_string(), - // quantity: "12684330".to_string(), - // }], - // data_hash: None, - // plutus_data: None, - // script_hash: None, - // script_ref: Some("590a8c010000333323232323232323232232232232222323232533300f323232323232323232323232323232323232323253330233370e90000008a99981199b8748008c0880084c94ccc090cdc3a4000604600226464646464646464a66605e60640042646644646600200200444a66606800229444c8c94ccc0cccc0880180084cc010010004528181c0011bae30360013758602a605601c660626ea409ccc0c4dd480225eb80c94ccc0b4cdc3a4000002264646464a666068606e004264649319299981999b87480000044c8c94ccc0e0c0ec0084c9263253330363370e900000089919299981d981f00109924c60520022c607800260680042a66606c66e1d20020011323232323232533303f3042002149858dd6982000098200011bad303e001303e002375a607800260680042c60680022c607200260620062a66606666e1d200200115333036303100314985858c0c4008c08800c58c0d4004c0d4008c0cc004c0ac01858c0ac01458dd7181800098180011bae302e001302e002302c001302c002375c605400260440022c6464a66604a66e1d20003024001132323253330283370e900218138008981698130008b180b981298081812800981580098118008b19809000919b873330103756601c6046601c60460020429110048008dd6180618108020b0a99981199b87480080044c8c94ccc094cdc3a40046048008264a66604c66e1d20003025001132323253330293370e90021814000899191919299981699b87480080044c8c8c8c8c8c8c8c94ccc0d54ccc0d54ccc0d4010400c52808010a50100114a066660326eacc060c0c80540b0c05cc078c0c8c074c0c80352001323232323232323232533303c3370e9001181d80109919299981f002899b88010001003375a60840026074004002264a66607866e1d2002303b00213232533303e0050031337120200026eb4c108004c0e8008004528181d80119b8748008c0e8dd5181d80099bb00033330380014c103d87a80004c0103d87980003370e9001181c1baa303c001303c002303a0013032301e3032001301930310143302137586034606002605866e3c0040acdd7181a800981a8011bad3033001302b00314a06056004603e002605e002604e0022c6030604c6022604c002605800260480022c660186eb0c03cc08c01800458c0a4004c0840644c8c94ccc094cdc3a400460480082646464a66605066e1d200030270011323232323253330303033002132323232325333032533303253330325333032005100414a020062940400852808008a50323232323232323232533303a3370e9001181c80109919299981e002899b88001018003375a60800026070004002264a66607466e1d2002303900213232533303c0050031337120020306eb4c100004c0e0008004528181c80119b8748008c0e0dd5181c80099bb00033330360014c103d87a80004c0103d87980003370e9001181b1baa303a001303a00230380013030301b30300013017302f012323253330323370e900200089919299981a19b8748008c0cc0044c8c8c8c94ccc0ecc0f800854ccc0e0cdc7800819099b8700301414a02c6eb8c0f0004c0f0008dd6981d00098190008b181c00098180010a5030300013020302e004323253330313370e900200089919299981999b8748010c0c80044c8c94ccc0e0c0ec0084cdc78008178b1bae30390013031001163037001302f00214a0605e002603e605a6030605a00c66660266eacc048c0b003c098c04401120023301c3758602a605601c04e2c60620026644646600200200644a666064002297ae013232533303153330313375e6036605e00400e266e1cccc070dd5980d1817801014802a400429404cc0d4008cc0100100044cc010010004c0d8008c0d0004dd6180d98148061807000980a181418099814000981700098130008b198071bac30113025008001302b001302300416375a605200260420326042030604c002604c00460480026038026464a66603e66e1d2002301e00113232323253330233370e90010008980780189919299981299b8748000c0900044c8c8c94ccc0a0cdc3a4000002260286602a0106eb8c0b4c0980084c050cc054020dd7181698130011813000981580098118008b1814800981080118108009805180f8021bae3025001301d001163008301c001230223023302330233023001222232533302300114a0264a666048002264646464a66604aa66604a66e3c0040244cdc78010040a5013370e00600e2940dd718148019bae30283029002375a604e605060500026eb0c09800852818130009919198008008011129998128008a5eb804c8ccc888c8cc00400400c894ccc0ac004400c4c8cc0b4dd3998169ba90063302d37526eb8c0a8004cc0b4dd41bad302b0014bd7019801801981780118168009bae30240013756604a002660060066052004604e002646600200200a44a666048002297adef6c6013232323253330253371e911000021003133029337606ea4008dd3000998030030019bab3026003375c60480046050004604c0024604060426042604260426042604260420024466012004466ebcc018c0680040088c078c07cc07cc07cc07cc07cc07cc07cc07c0048c074c0780048c070004888c8c8c94ccc06ccdc3a40040022900009bad30203019002301900132533301a3370e90010008a60103d87a8000132323300100100222533302000114c103d87a800013232323253330213371e014004266e95200033025375000297ae0133006006003375a60440066eb8c080008c090008c088004dd5980f980c001180c000991980080080211299980e8008a6103d87a8000132323232533301e3371e010004266e95200033022374c00297ae01330060060033756603e0066eb8c074008c084008c07c0048dca0009119b8a00200122323300100100322533301900114c0103d87a8000132325333018300500213374a90001980e00125eb804cc010010004c074008c06c00488c8cc00400400c894ccc06000452809919299980b99b8f00200514a226600800800260380046eb8c0680048c058c05cc05c0048c94ccc044cdc3a400000226464a66602c60320042930b1bae3017001300f002153330113370e900100089919299980b180c8010a4c2c6eb8c05c004c03c00858c03c0045261365632533300f3370e90000008a99980918068028a4c2c2a66601e66e1d20020011323253330143017002132498c94ccc048cdc3a4000002264646464a66603260380042649319299980b99b87480000044c8c94ccc070c07c00852616375c603a002602a0082c602a0062c6eb4c068004c068008c060004c04000858c04000458c054004c03401454ccc03ccdc3a400800226464a666028602e0042930b1bad3015001300d00516300d0043001004232533300e3370e90000008a99980898060010a4c2c2a66601c66e1d200200113232323253330153018002149858dd7180b000980b0011bad3014001300c0021533300e3370e9002000899192999809980b0010a4c2c6eb8c050004c03000858c030004dd70009bae001375c0024600a6ea80048c00cdd5000ab9a5573aaae7955cfaba05742ae8930011e581ce6e5285a878161c101a59b4e36f1f99e5e464d30f510be3ee34f907f004c011e581c36314aebecfbc929ee447dcb50fd690604eceae9403a298d9b1f9a54004c011e581c2291f67ee643db1a830734bd54d39022c5d1f990682e689c95d8fed00001".to_string()), - // } - // }]).unwrap(); - // } - - // #[test] - // fn test_eval() { - // let evaluator = MeshTxEvaluator::new(); - // let result = evaluator.evaluate_tx_sync( - // "84a80082825820604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad9800825820604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad98010d81825820604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad9801128182582004b9070a30bd63abaaf59a3c48a1575c4127bb0edb00ecd5141fd18a85c721aa000181a200581d601fd5bab167338971d92b4d8f0bdf57d889903e6e934e7ea38c7dadf1011b00000002529898c810a200581d601fd5bab167338971d92b4d8f0bdf57d889903e6e934e7ea38c7dadf1011b0000000252882db4111a000412f1021a0002b74b0b5820775d0cf3c95993f6210e4410e92f72ebc3942ce9c1433694749aa239e5d13387a200818258201557f444f3ae6e61dfed593ae15ec8dbd57b8138972bf16fde5b4c559f41549b5840729f1f14ef05b7cf9b0d7583e6777674f80ae64a35bbd6820cc3c82ddf0412ca1d751b7d886eece3c6e219e1c5cc9ef3d387a8d2078f47125d54b474fbdfbd0105818400000182190b111a000b5e35f5f6", - // &vec![UTxO { - // input: UtxoInput { - // tx_hash: "604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad98".to_string(), - // output_index: 0 - // }, - // output: UtxoOutput { - // address: "addr_test1wzlwsgq97vchypqzk8u8lz30w932tvx7akcj7csm02scl7qlghd97".to_string(), - // amount: vec![Asset::new_from_str("lovelace", "986990")], - // data_hash: None, - // plutus_data: Some(WData::JSON( - // serde_json::json!({ - // "constructor": 0, - // "fields": [] - // }) - // .to_string(), - // ).to_cbor().unwrap()), - // script_hash: None, - // script_ref: None, - // } - // }, - // UTxO { - // input: UtxoInput { - // tx_hash: "604943e070ffbf81cc09bb2942029f5f5361108a3c0b96a7309e6aa70370ad98".to_string(), - // output_index: 1 - // }, - // output: UtxoOutput { - // address: "addr_test1vq0atw43vuecjuwe9dxc7z7l2lvgnyp7d6f5ul4r3376mug8v67h5".to_string(), - // amount: vec![Asset::new_from_str("lovelace", "9974857893")], - // data_hash: None, - // plutus_data: None, - // script_hash: None, - // script_ref: None, - // } - // }, - // UTxO { - // input: UtxoInput { - // tx_hash: "04b9070a30bd63abaaf59a3c48a1575c4127bb0edb00ecd5141fd18a85c721aa".to_string(), - // output_index: 0 - // }, - // output: UtxoOutput { - // address: "addr_test1wzlwsgq97vchypqzk8u8lz30w932tvx7akcj7csm02scl7qlghd97".to_string(), - // amount: vec![Asset::new_from_str("lovelace", "986990")], - // data_hash: None, - // plutus_data: None, - // script_hash: None, - // script_ref: Some("5655010000322223253330054a229309b2b1bad0025735".to_string()) - // } - // }], - // &[], - // &Network::Mainnet - // ); - - // let redeemers = result.unwrap(); - // let mut redeemer_json = serde_json::Map::new(); - // for redeemer in redeemers { - // redeemer_json.insert("index".to_string(), redeemer.index.to_string().into()); - // let mut ex_unit_json = serde_json::Map::new(); - // ex_unit_json.insert("mem".to_string(), redeemer.budget.mem.into()); - // ex_unit_json.insert("steps".to_string(), redeemer.budget.steps.into()); - // redeemer_json.insert( - // "ex_units".to_string(), - // serde_json::Value::Object(ex_unit_json), - // ); - // } - // assert_eq!( - // serde_json::json!({"ex_units":{"mem":2833,"steps":528893},"index":"0"}).to_string(), - // serde_json::json!(redeemer_json).to_string() - // ) - // } - - #[test] - fn test_cbor() { - let script_bytes = hex::decode("5655010000322223253330054a229309b2b1bad0025735").unwrap(); - let decoded_bytes = Decoder::new(&script_bytes).bytes().unwrap(); - assert_eq!( - hex::decode("55010000322223253330054a229309b2b1bad0025735").unwrap(), - decoded_bytes - ); - } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 1e8a959..0000000 --- a/yarn.lock +++ /dev/null @@ -1,788 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@apidevtools/json-schema-ref-parser@9.0.9": - version "9.0.9" - resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz" - integrity sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w== - dependencies: - "@jsdevtools/ono" "^7.1.3" - "@types/json-schema" "^7.0.6" - call-me-maybe "^1.0.1" - js-yaml "^4.1.0" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7": - version "7.24.2" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz" - integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== - dependencies: - "@babel/highlight" "^7.24.2" - picocolors "^1.0.0" - -"@babel/helper-validator-identifier@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - -"@babel/highlight@^7.16.7", "@babel/highlight@^7.24.2": - version "7.24.2" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz" - integrity sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@jsdevtools/ono@^7.1.3": - version "7.1.3" - resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" - integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== - -"@types/glob@*": - version "8.1.0" - resolved "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz" - integrity sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w== - dependencies: - "@types/minimatch" "^5.1.2" - "@types/node" "*" - -"@types/json-schema@^7.0.6": - version "7.0.15" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - -"@types/lodash@^4.14.168": - version "4.17.0" - resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz" - integrity sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA== - -"@types/minimatch@^5.1.2": - version "5.1.2" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz" - integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== - -"@types/node@*": - version "20.11.30" - resolved "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz" - integrity sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw== - dependencies: - undici-types "~5.26.4" - -"@types/parse-json@^4.0.0": - version "4.0.2" - resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz" - integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== - -"@types/prettier@^2.1.5": - version "2.7.3" - resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz" - integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -any-promise@^1.0.0: - version "1.3.0" - resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz" - integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -call-me-maybe@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz" - integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cli-color@^2.0.0: - version "2.0.4" - resolved "https://registry.npmjs.org/cli-color/-/cli-color-2.0.4.tgz" - integrity sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA== - dependencies: - d "^1.0.1" - es5-ext "^0.10.64" - es6-iterator "^2.0.3" - memoizee "^0.4.15" - timers-ext "^0.1.7" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -commander@^6.1.0: - version "6.2.1" - resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== - -compare-versions@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz" - integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -cosmiconfig@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz" - integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.1.0" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.7.2" - -d@^1.0.1, d@^1.0.2, d@1: - version "1.0.2" - resolved "https://registry.npmjs.org/d/-/d-1.0.2.tgz" - integrity sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw== - dependencies: - es5-ext "^0.10.64" - type "^2.7.2" - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.53, es5-ext@^0.10.62, es5-ext@^0.10.64, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: - version "0.10.64" - resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz" - integrity sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg== - dependencies: - es6-iterator "^2.0.3" - es6-symbol "^3.1.3" - esniff "^2.0.1" - next-tick "^1.1.0" - -es6-iterator@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz" - integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1, es6-symbol@^3.1.3: - version "3.1.4" - resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz" - integrity sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg== - dependencies: - d "^1.0.2" - ext "^1.7.0" - -es6-weak-map@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz" - integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== - dependencies: - d "1" - es5-ext "^0.10.46" - es6-iterator "^2.0.3" - es6-symbol "^3.1.1" - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -esniff@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz" - integrity sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg== - dependencies: - d "^1.0.1" - es5-ext "^0.10.62" - event-emitter "^0.3.5" - type "^2.7.2" - -event-emitter@^0.3.5: - version "0.3.5" - resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz" - integrity sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA== - dependencies: - d "1" - es5-ext "~0.10.14" - -ext@^1.7.0: - version "1.7.0" - resolved "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz" - integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== - dependencies: - type "^2.7.2" - -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-versions@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz" - integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== - dependencies: - semver-regex "^2.0.0" - -flowgen@1.21.0: - version "1.21.0" - resolved "https://registry.npmjs.org/flowgen/-/flowgen-1.21.0.tgz" - integrity sha512-pFNFFyMLRmW6njhOIm5TrbGUDTv64aujmys2KrkRE2NYD8sXwJUyicQRwU5SPRBRJnFSD/FNlnHo2NnHI5eJSw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/highlight" "^7.16.7" - commander "^6.1.0" - lodash "^4.17.20" - prettier "^2.5.1" - shelljs "^0.8.4" - typescript "~4.4.4" - typescript-compiler "^1.4.1-2" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -function-bind@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" - integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== - -get-stdin@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz" - integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== - -glob-promise@^3.4.0: - version "3.4.0" - resolved "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz" - integrity sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw== - dependencies: - "@types/glob" "*" - -glob@*, glob@^7.0.0, glob@^7.1.3, glob@^7.1.6: - version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -hasown@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz" - integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== - dependencies: - function-bind "^1.1.2" - -husky@4.2.5: - version "4.2.5" - resolved "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz" - integrity sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ== - dependencies: - chalk "^4.0.0" - ci-info "^2.0.0" - compare-versions "^3.6.0" - cosmiconfig "^6.0.0" - find-versions "^3.2.0" - opencollective-postinstall "^2.0.2" - pkg-dir "^4.2.0" - please-upgrade-node "^3.2.0" - slash "^3.0.0" - which-pm-runs "^1.0.0" - -import-fresh@^3.1.0: - version "3.3.0" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -interpret@^1.0.0: - version "1.4.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - -is-core-module@^2.13.0: - version "2.13.1" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz" - integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== - dependencies: - hasown "^2.0.0" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.1: - version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-promise@^2.2.2: - version "2.2.2" - resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz" - integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-ref-parser@^9.0.6: - version "9.0.9" - resolved "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz" - integrity sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q== - dependencies: - "@apidevtools/json-schema-ref-parser" "9.0.9" - -json-schema-to-typescript@^10.1.5: - version "10.1.5" - resolved "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-10.1.5.tgz" - integrity sha512-X8bNNksfCQo6LhEuqNxmZr4eZpPjXZajmimciuk8eWXzZlif9Brq7WuMGD/SOhBKcRKP2SGVDNZbC28WQqx9Rg== - dependencies: - "@types/json-schema" "^7.0.6" - "@types/lodash" "^4.14.168" - "@types/prettier" "^2.1.5" - cli-color "^2.0.0" - get-stdin "^8.0.0" - glob "^7.1.6" - glob-promise "^3.4.0" - is-glob "^4.0.1" - json-schema-ref-parser "^9.0.6" - json-stringify-safe "^5.0.1" - lodash "^4.17.20" - minimist "^1.2.5" - mkdirp "^1.0.4" - mz "^2.7.0" - prettier "^2.2.0" - -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash@^4.17.20: - version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lru-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz" - integrity sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ== - dependencies: - es5-ext "~0.10.2" - -memoizee@^0.4.15: - version "0.4.15" - resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz" - integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== - dependencies: - d "^1.0.1" - es5-ext "^0.10.53" - es6-weak-map "^2.0.3" - event-emitter "^0.3.5" - is-promise "^2.2.2" - lru-queue "^0.1.0" - next-tick "^1.1.0" - timers-ext "^0.1.7" - -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.5: - version "1.2.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -mz@^2.7.0: - version "2.7.0" - resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== - dependencies: - any-promise "^1.0.0" - object-assign "^4.0.1" - thenify-all "^1.0.0" - -next-tick@^1.1.0, next-tick@1: - version "1.1.0" - resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz" - integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -opencollective-postinstall@^2.0.2: - version "2.0.3" - resolved "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz" - integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -please-upgrade-node@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - -prettier@^2.2.0, prettier@^2.5.1: - version "2.8.8" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" - integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== - dependencies: - resolve "^1.1.6" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve@^1.1.6: - version "1.22.8" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" - integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== - dependencies: - is-core-module "^2.13.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -rimraf@3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz" - integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== - -semver-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz" - integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== - -shelljs@^0.8.4: - version "0.8.5" - resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz" - integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -thenify-all@^1.0.0: - version "1.6.0" - resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz" - integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== - dependencies: - thenify ">= 3.1.0 < 4" - -"thenify@>= 3.1.0 < 4": - version "3.3.1" - resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz" - integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== - dependencies: - any-promise "^1.0.0" - -timers-ext@^0.1.7: - version "0.1.7" - resolved "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz" - integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== - dependencies: - es5-ext "~0.10.46" - next-tick "1" - -type@^2.7.2: - version "2.7.2" - resolved "https://registry.npmjs.org/type/-/type-2.7.2.tgz" - integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== - -typescript-compiler@^1.4.1-2: - version "1.4.1-2" - resolved "https://registry.npmjs.org/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz" - integrity sha512-EMopKmoAEJqA4XXRFGOb7eSBhmQMbBahW6P1Koayeatp0b4AW2q/bBqYWkpG7QVQc9HGQUiS4trx2ZHcnAaZUg== - -typescript@~4.4.4: - version "4.4.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -which-pm-runs@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz" - integrity sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA== - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -yaml@^1.7.2: - version "1.10.2" - resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==