diff --git a/bin/marketplace b/bin/marketplace index 6d32802..d81b0df 100755 --- a/bin/marketplace +++ b/bin/marketplace @@ -7,4 +7,4 @@ SCRIPT_DIR=$(dirname "$SCRIPT_PATH") SCRIPT=$(realpath "$SCRIPT_DIR/../handles-marketplace-contracts/src/entrypoints/cli.ts" 2>/dev/null || realpath "$SCRIPT_DIR/../src/entrypoint.ts") TSX=$(realpath "$SCRIPT_DIR/../node_modules/.bin/tsx") -"$TSX" "$SCRIPT" "$@" +NODE_ENV=preprod "$TSX" "$SCRIPT" "$@" diff --git a/package-lock.json b/package-lock.json index 47c1d42..1a763b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "app-root-path": "^3.1.0", "commander": "^12.1.0", + "cross-fetch": "^4.0.0", "decimal.js": "^10.4.3", "ts-res": "^1.1.1" }, @@ -21,9 +22,6 @@ "@koralabs/helios": "0.16.8-2", "@koralabs/kora-labs-common": "^5.1.8", "@koralabs/kora-labs-contract-testing": "0.0.9", - "@rollup/plugin-commonjs": "^28.0.1", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.3.0", "@types/node": "^22.1.0", "@typescript-eslint/eslint-plugin": "^6.7.5", "@typescript-eslint/parser": "^6.7.5", @@ -36,9 +34,7 @@ "eslint-plugin-import": "^2.28.1", "eslint-plugin-simple-import-sort": "^12.1.1", "prettier": "^2.8.8", - "rollup": "^4.24.0", - "rollup-plugin-copy": "^3.5.0", - "rollup-plugin-typescript2": "^0.36.0", + "tsup": "^8.3.5", "tsx": "^4.17.0", "typescript": "^5.6.3" } @@ -574,11 +570,161 @@ "deprecated": "Use @eslint/object-schema instead", "dev": true }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } }, "node_modules/@koralabs/helios": { "version": "0.16.8-2", @@ -675,327 +821,264 @@ "node": ">= 8" } }, - "node_modules/@rollup/plugin-commonjs": { - "version": "28.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.1.tgz", - "integrity": "sha512-+tNWdlWKbpB3WgBN7ijjYkq9X5uhjmcvyjEght4NmH5fAU++zfQzAJ6wumLS+dNcvwEZhKx2Z+skY8m7v0wGSA==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "fdir": "^6.2.0", - "is-reference": "1.2.1", - "magic-string": "^0.30.3", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0 || 14 >= 14.17" - }, - "peerDependencies": { - "rollup": "^2.68.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", - "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", - "dev": true, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/@rollup/plugin-json": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", - "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^5.1.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.3.0.tgz", - "integrity": "sha512-9eO5McEICxMzJpDW9OnMYSv4Sta3hmt7VtBFz5zR9273suNOydOyq/FrGeGy+KsTRFm8w0SLVhzig2ILFT63Ag==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.78.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/pluginutils": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz", - "integrity": "sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==", + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" - }, + "license": "MIT", + "optional": true, "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": ">=14" } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", - "integrity": "sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.4.tgz", + "integrity": "sha512-jfUJrFct/hTA0XDM5p/htWKoNNTbDLY0KRwEt6pyOA6k2fmk0WVwl65PdUdJZgzGEHWx+49LilkcSaumQRyNQw==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.0.tgz", - "integrity": "sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.4.tgz", + "integrity": "sha512-j4nrEO6nHU1nZUuCfRKoCcvh7PIywQPUCBa2UsootTHvTHIoIu2BzueInGJhhvQO/2FTRdNYpf63xsgEqH9IhA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz", - "integrity": "sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.4.tgz", + "integrity": "sha512-GmU/QgGtBTeraKyldC7cDVVvAJEOr3dFLKneez/n7BvX57UdhOqDsVwzU7UOnYA7AAOt+Xb26lk79PldDHgMIQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.0.tgz", - "integrity": "sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.4.tgz", + "integrity": "sha512-N6oDBiZCBKlwYcsEPXGDE4g9RoxZLK6vT98M8111cW7VsVJFpNEqvJeIPfsCzbf0XEakPslh72X0gnlMi4Ddgg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.24.4.tgz", + "integrity": "sha512-py5oNShCCjCyjWXCZNrRGRpjWsF0ic8f4ieBNra5buQz0O/U6mMXCpC1LvrHuhJsNPgRt36tSYMidGzZiJF6mw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.24.4.tgz", + "integrity": "sha512-L7VVVW9FCnTTp4i7KrmHeDsDvjB4++KOBENYtNYAiYl96jeBThFfhP6HVxL74v4SiZEVDH/1ILscR5U9S4ms4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.0.tgz", - "integrity": "sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.4.tgz", + "integrity": "sha512-10ICosOwYChROdQoQo589N5idQIisxjaFE/PAnX2i0Zr84mY0k9zul1ArH0rnJ/fpgiqfu13TFZR5A5YJLOYZA==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.0.tgz", - "integrity": "sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.4.tgz", + "integrity": "sha512-ySAfWs69LYC7QhRDZNKqNhz2UKN8LDfbKSMAEtoEI0jitwfAG2iZwVqGACJT+kfYvvz3/JgsLlcBP+WWoKCLcw==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.0.tgz", - "integrity": "sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.4.tgz", + "integrity": "sha512-uHYJ0HNOI6pGEeZ/5mgm5arNVTI0nLlmrbdph+pGXpC9tFHFDQmDMOEqkmUObRfosJqpU8RliYoGz06qSdtcjg==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.0.tgz", - "integrity": "sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.4.tgz", + "integrity": "sha512-38yiWLemQf7aLHDgTg85fh3hW9stJ0Muk7+s6tIkSUOMmi4Xbv5pH/5Bofnsb6spIwD5FJiR+jg71f0CH5OzoA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.0.tgz", - "integrity": "sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.4.tgz", + "integrity": "sha512-q73XUPnkwt9ZNF2xRS4fvneSuaHw2BXuV5rI4cw0fWYVIWIBeDZX7c7FWhFQPNTnE24172K30I+dViWRVD9TwA==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.0.tgz", - "integrity": "sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.4.tgz", + "integrity": "sha512-Aie/TbmQi6UXokJqDZdmTJuZBCU3QBDA8oTKRGtd4ABi/nHgXICulfg1KI6n9/koDsiDbvHAiQO3YAUNa/7BCw==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.0.tgz", - "integrity": "sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.4.tgz", + "integrity": "sha512-P8MPErVO/y8ohWSP9JY7lLQ8+YMHfTI4bAdtCi3pC2hTeqFJco2jYspzOzTUB8hwUWIIu1xwOrJE11nP+0JFAQ==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", - "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.4.tgz", + "integrity": "sha512-K03TljaaoPK5FOyNMZAAEmhlyO49LaE4qCsr0lYHUKyb6QacTNF9pnfPpXnFlFD3TXuFbFbz7tJ51FujUXkXYA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz", - "integrity": "sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.4.tgz", + "integrity": "sha512-VJYl4xSl/wqG2D5xTYncVWW+26ICV4wubwN9Gs5NrqhJtayikwCXzPL8GDsLnaLU3WwhQ8W02IinYSFJfyo34Q==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.0.tgz", - "integrity": "sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.4.tgz", + "integrity": "sha512-ku2GvtPwQfCqoPFIJCqZ8o7bJcj+Y54cZSr43hHca6jLwAiCbZdBUOrqE6y29QFajNAzzpIOwsckaTFmN6/8TA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.0.tgz", - "integrity": "sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.4.tgz", + "integrity": "sha512-V3nCe+eTt/W6UYNr/wGvO1fLpHUrnlirlypZfKCT1fG6hWfqhPgQV/K/mRBXBpxc0eKLIF18pIOFVPh0mqHjlg==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz", - "integrity": "sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.4.tgz", + "integrity": "sha512-LTw1Dfd0mBIEqUVCxbvTE/LLo+9ZxVC9k99v1v4ahg9Aak6FpqOfNu5kRkeTAn0wphoC4JU7No1/rL+bBCEwhg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -1020,28 +1103,8 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true - }, - "node_modules/@types/fs-extra": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.5.tgz", - "integrity": "sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", "dev": true, - "license": "MIT", - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } + "license": "MIT" }, "node_modules/@types/json-schema": { "version": "7.0.15", @@ -1055,13 +1118,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "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": "22.1.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", @@ -1071,12 +1127,6 @@ "undici-types": "~6.13.0" } }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true - }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -1340,6 +1390,13 @@ "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/app-root-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", @@ -1626,6 +1683,32 @@ "ieee754": "^1.2.1" } }, + "node_modules/bundle-require": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.0.0.tgz", + "integrity": "sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.18" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -1725,6 +1808,22 @@ "node": "*" } }, + "node_modules/chokidar": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -1767,13 +1866,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/colorette": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", - "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", - "dev": true, - "license": "MIT" - }, "node_modules/commander": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", @@ -1782,12 +1874,6 @@ "node": ">=18" } }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1821,6 +1907,16 @@ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, + "node_modules/consola": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", + "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, "node_modules/crc": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/crc/-/crc-4.3.2.tgz", @@ -1866,6 +1962,15 @@ "sha.js": "^2.4.8" } }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1948,12 +2053,13 @@ } }, "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1987,15 +2093,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -2066,6 +2163,13 @@ "url": "https://dotenvx.com" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -2591,12 +2695,6 @@ "node": ">=4.0" } }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -2685,23 +2783,6 @@ "node": ">=8" } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2747,18 +2828,21 @@ "is-callable": "^1.1.3" } }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", "dev": true, + "license": "ISC", "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">=12" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/fs.realpath": { @@ -3001,12 +3085,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -3345,12 +3423,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true - }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", @@ -3396,25 +3468,6 @@ "node": ">=8" } }, - "node_modules/is-plain-object": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz", - "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -3515,6 +3568,32 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -3557,18 +3636,6 @@ "json5": "lib/cli.js" } }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -3591,6 +3658,36 @@ "node": ">= 0.8.0" } }, + "node_modules/lilconfig": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "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/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -3618,6 +3715,13 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "dev": true, + "license": "MIT" + }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -3627,38 +3731,12 @@ "get-func-name": "^2.0.1" } }, - "node_modules/magic-string": { - "version": "0.30.12", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", - "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "bin": { - "semver": "bin/semver.js" - } + "license": "ISC" }, "node_modules/md5.js": { "version": "1.3.5", @@ -3730,11 +3808,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "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": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } }, "node_modules/natural-compare": { "version": "1.4.0", @@ -3742,6 +3843,26 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/nofilter": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", @@ -3751,6 +3872,16 @@ "node": ">=12.19" } }, + "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": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", @@ -3895,14 +4026,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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==", + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "dev": true, - "engines": { - "node": ">=6" - } + "license": "BlueOak-1.0.0" }, "node_modules/parent-module": { "version": "1.0.1", @@ -3949,6 +4078,23 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -3983,6 +4129,13 @@ "node": ">=0.12" } }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -3995,73 +4148,14 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "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": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/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": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/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": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/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": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pkg-dir/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==", + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, "engines": { - "node": ">=8" + "node": ">= 6" } }, "node_modules/pluralize-esm": { @@ -4083,6 +4177,49 @@ "node": ">= 0.4" } }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -4150,6 +4287,20 @@ "node": ">= 6" } }, + "node_modules/readdirp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", @@ -4255,10 +4406,11 @@ } }, "node_modules/rollup": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", - "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.4.tgz", + "integrity": "sha512-vGorVWIsWfX3xbcyAS+I047kFKapHYivmkaT63Smj77XwvLSJos6M1xGqZnBPFQFBRZDOcG1QnYEIxAvTr/HjA==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -4270,127 +4422,27 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.24.0", - "@rollup/rollup-android-arm64": "4.24.0", - "@rollup/rollup-darwin-arm64": "4.24.0", - "@rollup/rollup-darwin-x64": "4.24.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.24.0", - "@rollup/rollup-linux-arm-musleabihf": "4.24.0", - "@rollup/rollup-linux-arm64-gnu": "4.24.0", - "@rollup/rollup-linux-arm64-musl": "4.24.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.24.0", - "@rollup/rollup-linux-riscv64-gnu": "4.24.0", - "@rollup/rollup-linux-s390x-gnu": "4.24.0", - "@rollup/rollup-linux-x64-gnu": "4.24.0", - "@rollup/rollup-linux-x64-musl": "4.24.0", - "@rollup/rollup-win32-arm64-msvc": "4.24.0", - "@rollup/rollup-win32-ia32-msvc": "4.24.0", - "@rollup/rollup-win32-x64-msvc": "4.24.0", + "@rollup/rollup-android-arm-eabi": "4.24.4", + "@rollup/rollup-android-arm64": "4.24.4", + "@rollup/rollup-darwin-arm64": "4.24.4", + "@rollup/rollup-darwin-x64": "4.24.4", + "@rollup/rollup-freebsd-arm64": "4.24.4", + "@rollup/rollup-freebsd-x64": "4.24.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.24.4", + "@rollup/rollup-linux-arm-musleabihf": "4.24.4", + "@rollup/rollup-linux-arm64-gnu": "4.24.4", + "@rollup/rollup-linux-arm64-musl": "4.24.4", + "@rollup/rollup-linux-powerpc64le-gnu": "4.24.4", + "@rollup/rollup-linux-riscv64-gnu": "4.24.4", + "@rollup/rollup-linux-s390x-gnu": "4.24.4", + "@rollup/rollup-linux-x64-gnu": "4.24.4", + "@rollup/rollup-linux-x64-musl": "4.24.4", + "@rollup/rollup-win32-arm64-msvc": "4.24.4", + "@rollup/rollup-win32-ia32-msvc": "4.24.4", + "@rollup/rollup-win32-x64-msvc": "4.24.4", "fsevents": "~2.3.2" } }, - "node_modules/rollup-plugin-copy": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-copy/-/rollup-plugin-copy-3.5.0.tgz", - "integrity": "sha512-wI8D5dvYovRMx/YYKtUNt3Yxaw4ORC9xo6Gt9t22kveWz1enG9QrhVlagzwrxSC455xD1dHMKhIJkbsQ7d48BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/fs-extra": "^8.0.1", - "colorette": "^1.1.0", - "fs-extra": "^8.1.0", - "globby": "10.0.1", - "is-plain-object": "^3.0.0" - }, - "engines": { - "node": ">=8.3" - } - }, - "node_modules/rollup-plugin-copy/node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/rollup-plugin-copy/node_modules/globby": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", - "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/rollup-plugin-copy/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/rollup-plugin-copy/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/rollup-plugin-typescript2": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz", - "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^4.1.2", - "find-cache-dir": "^3.3.2", - "fs-extra": "^10.0.0", - "semver": "^7.5.4", - "tslib": "^2.6.2" - }, - "peerDependencies": { - "rollup": ">=1.26.3", - "typescript": ">=2.4.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", - "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", - "dev": true, - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -4583,6 +4635,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -4592,6 +4657,48 @@ "node": ">=8" } }, + "node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map/node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/source-map/node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/source-map/node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", @@ -4621,6 +4728,22 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string.prototype.trim": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", @@ -4682,6 +4805,20 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -4703,6 +4840,76 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/sucrase": { + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/sucrase/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sucrase/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -4736,6 +4943,78 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "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": { + "any-promise": "^1.0.0" + } + }, + "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": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tinyexec": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz", + "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", + "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -4748,6 +5027,12 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -4769,6 +5054,13 @@ "typescript": ">=4.2.0" } }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/ts-res": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ts-res/-/ts-res-1.1.1.tgz", @@ -4792,44 +5084,554 @@ "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", "dev": true }, - "node_modules/tsx": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.17.0.tgz", - "integrity": "sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==", + "node_modules/tsup": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.3.5.tgz", + "integrity": "sha512-Tunf6r6m6tnZsG9GYWndg0z8dEV7fD733VBFzFJ5Vcm1FtlXB8xBD/rtrBi2a3YKEV7hHtxiZtW5EAVADoe1pA==", "dev": true, + "license": "MIT", "dependencies": { - "esbuild": "~0.23.0", - "get-tsconfig": "^4.7.5" + "bundle-require": "^5.0.0", + "cac": "^6.7.14", + "chokidar": "^4.0.1", + "consola": "^3.2.3", + "debug": "^4.3.7", + "esbuild": "^0.24.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", + "resolve-from": "^5.0.0", + "rollup": "^4.24.0", + "source-map": "0.8.0-beta.0", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.1", + "tinyglobby": "^0.2.9", + "tree-kill": "^1.2.2" }, "bin": { - "tsx": "dist/cli.mjs" + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" }, "engines": { - "node": ">=18.0.0" + "node": ">=18" }, - "optionalDependencies": { - "fsevents": "~2.3.3" + "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.5.0" + }, + "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } } }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "node_modules/tsup/node_modules/@esbuild/aix-ppc64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", + "cpu": [ + "ppc64" + ], "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">= 0.8.0" + "node": ">=18" } }, - "node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "node_modules/tsup/node_modules/@esbuild/android-arm": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", + "cpu": [ + "arm" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=4" + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/android-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/android-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/darwin-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/darwin-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/freebsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-arm": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-ia32": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-loong64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-mips64el": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-ppc64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-riscv64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-s390x": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/netbsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openbsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/sunos-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-ia32": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/esbuild": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" + } + }, + "node_modules/tsup/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tsx": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.17.0.tgz", + "integrity": "sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==", + "dev": true, + "dependencies": { + "esbuild": "~0.23.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "engines": { + "node": ">=4" } }, "node_modules/type-fest": { @@ -4951,15 +5753,6 @@ "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", "dev": true }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -4975,6 +5768,22 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -5051,6 +5860,25 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 80edd7e..a798447 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "dist/index.js", "module": "dist/index.js", "scripts": { - "build": "rm -rf ./dist && rollup -c", + "build": "tsup", "prettier": "npx prettier -w '**/*.{js,ts,json,.*}'", "lint": "concurrently \"npx prettier --check '**/*.{js,ts,json,.*}'\" \"npx eslint . --max-warnings=0\"", "test": "tsx -r dotenv/config src/tests/tx.test.ts" @@ -21,9 +21,6 @@ "@koralabs/helios": "0.16.8-2", "@koralabs/kora-labs-common": "^5.1.8", "@koralabs/kora-labs-contract-testing": "0.0.9", - "@rollup/plugin-commonjs": "^28.0.1", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.3.0", "@types/node": "^22.1.0", "@typescript-eslint/eslint-plugin": "^6.7.5", "@typescript-eslint/parser": "^6.7.5", @@ -36,15 +33,14 @@ "eslint-plugin-import": "^2.28.1", "eslint-plugin-simple-import-sort": "^12.1.1", "prettier": "^2.8.8", - "rollup": "^4.24.0", - "rollup-plugin-copy": "^3.5.0", - "rollup-plugin-typescript2": "^0.36.0", + "tsup": "^8.3.5", "tsx": "^4.17.0", "typescript": "^5.6.3" }, "dependencies": { "app-root-path": "^3.1.0", "commander": "^12.1.0", + "cross-fetch": "^4.0.0", "decimal.js": "^10.4.3", "ts-res": "^1.1.1" } diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index dec6a6b..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,38 +0,0 @@ -import pkg from "./package.json" assert { type: "json" }; - -import commonjs from "@rollup/plugin-commonjs"; -import json from "@rollup/plugin-json"; -import resolve from "@rollup/plugin-node-resolve"; -import { builtinModules } from "module"; -import copy from "rollup-plugin-copy"; -import typescript from "rollup-plugin-typescript2"; - -const external = [ - ...Object.keys(pkg.dependencies || {}), - ...Object.keys(pkg.peerDependencies || {}), - ...builtinModules, -]; - -export default { - input: "./src/index.ts", - output: { - file: "dist/index.cjs", // Specify the output file with directory - format: "cjs", - sourcemap: true, - }, - plugins: [ - resolve(), - commonjs(), - json(), - typescript({ - tsconfig: "tsconfig.json", - }), - copy({ - targets: [ - { src: "src/contract/marketplace.helios", dest: "dist/contract" }, - { src: "src/contract/marketplace.helios", dest: "./contract" }, - ], - }), - ], - external, -}; diff --git a/src/buy.ts b/src/buy.ts index 026bff6..6e70b3a 100644 --- a/src/buy.ts +++ b/src/buy.ts @@ -1,10 +1,16 @@ -import { MIN_FEE, MIN_LOVELACE } from "./constants"; +import { HANDLE_POLICY_ID, MIN_FEE, MIN_LOVELACE } from "./constants"; import { buildDatumTag, decodeDatum, decodeParametersDatum } from "./datum"; -import { mayFail, mayFailAsync } from "./helpers"; -import { bigIntMax, fetchNetworkParameters, getUplcProgram } from "./utils"; +import { deployedScripts } from "./deployed"; +import { mayFail, mayFailAsync, mayFailTransaction } from "./helpers"; +import { + bigIntMax, + fetchLatestmarketplaceScriptDetail, + fetchNetworkParameters, + getUplcProgram, +} from "./utils"; import * as helios from "@koralabs/helios"; -import { Network, ScriptDetails } from "@koralabs/kora-labs-common"; +import { IUTxO, Network } from "@koralabs/kora-labs-common"; import { Buy } from "redeemer"; import { Err, Ok, Result } from "ts-res"; @@ -14,16 +20,16 @@ import { Err, Ok, Result } from "ts-res"; * @typedef {object} BuyConfig * @property {string} changeBech32Address Change address of wallet who is performing `list` * @property {string[]} cborUtxos UTxOs (cbor format) of wallet - * @property {string} handleCborUtxo UTxO (cbor format) of handle to buy - * @property {ScriptDetails} refScriptDetail Deployed marketplace contract detail - * @property {string} refScriptCborUtxo UTxO (cbor format) where marketplace contract is deployed + * @property {string | undefined | null} collateralCborUtxo Collateral UTxO. Can be null, then we will select one in function + * @property {string} handleHex Handle name's hex format (asset name label is also included) + * @property {IUTxO} listingUtxo UTxO where this handle is listed */ interface BuyConfig { changeBech32Address: string; cborUtxos: string[]; - handleCborUtxo: string; /// handle (to buy) is in this utxo - refScriptDetail: ScriptDetails; - refScriptCborUtxo: string; + collateralCborUtxo?: string | null; + handleHex: string; + listingUtxo: IUTxO; } /** @@ -32,37 +38,43 @@ interface BuyConfig { * @typedef {object} BuyWithAuthConfig * @property {string} changeBech32Address Change address of wallet who is performing `list` * @property {string[]} cborUtxos UTxOs (cbor format) of wallet - * @property {string} handleCborUtxo UTxO (cbor format) of handle to buy + * @property {string | undefined | null} collateralCborUtxo Collateral UTxO. Can be null, then we will select one in function + * @property {string} handleHex Handle name's hex format (asset name label is also included) + * @property {IUTxO} listingUtxo UTxO where this handle is listed * @property {string} authorizerPubKeyHash Pub Key Hash of authorizer - * @property {ScriptDetails} refScriptDetail Deployed marketplace contract detail - * @property {string} refScriptCborUtxo UTxO (cbor format) where marketplace contract is deployed */ interface BuyWithAuthConfig { changeBech32Address: string; cborUtxos: string[]; - handleCborUtxo: string; /// handle (to buy) is in this utxo + collateralCborUtxo?: string | null; + handleHex: string; + listingUtxo: IUTxO; authorizerPubKeyHash: string; - refScriptDetail: ScriptDetails; - refScriptCborUtxo: string; } /** * Buy Handle on marketplace * @param {BuyConfig} config * @param {Network} network - * @returns {Promise>} + * @returns {Promise>} */ + const buy = async ( config: BuyConfig, network: Network -): Promise> => { - const { - changeBech32Address, - cborUtxos, - handleCborUtxo, - refScriptDetail, - refScriptCborUtxo, - } = config; +): Promise> => { + const { changeBech32Address, cborUtxos, handleHex, listingUtxo } = config; + + /// fetch marketplace reference script detail + const refScriptDetailResult = await mayFailAsync(() => + fetchLatestmarketplaceScriptDetail() + ).complete(); + + /// use deployed script if fetch is failed + const refScriptDetail = refScriptDetailResult.ok + ? refScriptDetailResult.data + : Object.values(deployedScripts[network])[0]; + const { cbor, datumCbor, refScriptUtxo } = refScriptDetail; if (!cbor) return Err(`Deploy script cbor is empty`); if (!datumCbor) return Err(`Deploy script's datum cbor is empty`); @@ -95,9 +107,24 @@ const buy = async ( const utxos = cborUtxos.map((cborUtxo) => helios.TxInput.fromFullCbor([...Buffer.from(cborUtxo, "hex")]) ); - const handleUtxo = helios.TxInput.fromFullCbor([ - ...Buffer.from(handleCborUtxo, "hex"), - ]); + const handleUtxo = new helios.TxInput( + new helios.TxOutputId( + helios.TxId.fromHex(listingUtxo.tx_id), + listingUtxo.index + ), + new helios.TxOutput( + helios.Address.fromBech32(listingUtxo.address), + new helios.Value( + BigInt(listingUtxo.lovelace), + new helios.Assets([[HANDLE_POLICY_ID, [[handleHex, 1]]]]) + ), + listingUtxo.datum + ? helios.Datum.inline( + helios.UplcData.fromCbor(helios.hexToBytes(listingUtxo.datum)) + ) + : null + ) + ); const handleRawDatum = handleUtxo.output.datum; if (!handleRawDatum) return Err("Handle UTxO datum not found"); @@ -157,10 +184,27 @@ const buy = async ( ); handleBuyOutput.correctLovelace(networkParams); - /// make ref input - const refInput = helios.TxInput.fromFullCbor([ - ...Buffer.from(refScriptCborUtxo, "hex"), - ]); + /// make ref script input + const refInput = new helios.TxInput( + new helios.TxOutputId(refScriptDetail.refScriptUtxo || ""), + new helios.TxOutput( + helios.Address.fromBech32(refScriptDetail.refScriptAddress || ""), + new helios.Value( + BigInt(1), + new helios.Assets([ + [HANDLE_POLICY_ID, [[refScriptDetail.handleHex, 1]]], + ]) + ), + refScriptDetail.datumCbor + ? helios.Datum.inline( + helios.UplcData.fromCbor( + helios.hexToBytes(refScriptDetail.datumCbor) + ) + ) + : null, + helios.UplcProgram.fromCbor(refScriptDetail.cbor || "") + ) + ); /// build tx const tx = new helios.Tx() @@ -172,32 +216,42 @@ const buy = async ( .addOutput(handleBuyOutput); /// finalize tx - const txCompleteResult = await mayFailAsync(() => - tx.finalize(networkParams, changeAddress, unSelected) + const txCompleteResult = await mayFailTransaction( + () => tx.finalize(networkParams, changeAddress, unSelected), + refScriptDetail.unoptimizedCbor ).complete(); - if (!txCompleteResult.ok) - return Err(`Finalizing Tx error: ${txCompleteResult.error}`); - return Ok(txCompleteResult.data); + if (!txCompleteResult.ok) return Err(txCompleteResult.error); + return Ok(txCompleteResult.data.toCborHex()); }; /** * Buy Handle on marketplace with one of authorizers * @param {BuyWithAuthConfig} config * @param {Network} network - * @returns {Promise>} + * @returns {Promise>} */ const buyWithAuth = async ( config: BuyWithAuthConfig, network: Network -): Promise> => { +): Promise> => { const { changeBech32Address, cborUtxos, - handleCborUtxo, + handleHex, + listingUtxo, authorizerPubKeyHash, - refScriptDetail, - refScriptCborUtxo, } = config; + + /// fetch marketplace reference script detail + const refScriptDetailResult = await mayFailAsync(() => + fetchLatestmarketplaceScriptDetail() + ).complete(); + + /// use deployed script if fetch is failed + const refScriptDetail = refScriptDetailResult.ok + ? refScriptDetailResult.data + : Object.values(deployedScripts[network])[0]; + const { cbor, datumCbor, refScriptUtxo } = refScriptDetail; if (!cbor) return Err(`Deploy script cbor is empty`); if (!datumCbor) return Err(`Deploy script's datum cbor is empty`); @@ -238,9 +292,24 @@ const buyWithAuth = async ( const utxos = cborUtxos.map((cborUtxo) => helios.TxInput.fromFullCbor([...Buffer.from(cborUtxo, "hex")]) ); - const handleUtxo = helios.TxInput.fromFullCbor([ - ...Buffer.from(handleCborUtxo, "hex"), - ]); + const handleUtxo = new helios.TxInput( + new helios.TxOutputId( + helios.TxId.fromHex(listingUtxo.tx_id), + listingUtxo.index + ), + new helios.TxOutput( + helios.Address.fromBech32(listingUtxo.address), + new helios.Value( + BigInt(listingUtxo.lovelace), + new helios.Assets([[HANDLE_POLICY_ID, [[handleHex, 1]]]]) + ), + listingUtxo.datum + ? helios.Datum.inline( + helios.UplcData.fromCbor(helios.hexToBytes(listingUtxo.datum)) + ) + : null + ) + ); const handleRawDatum = handleUtxo.output.datum; if (!handleRawDatum) return Err("Handle UTxO datum not found"); @@ -290,10 +359,27 @@ const buyWithAuth = async ( ); handleBuyOutput.correctLovelace(networkParams); - /// make ref input - const refInput = helios.TxInput.fromFullCbor([ - ...Buffer.from(refScriptCborUtxo, "hex"), - ]); + /// make ref script input + const refInput = new helios.TxInput( + new helios.TxOutputId(refScriptDetail.refScriptUtxo || ""), + new helios.TxOutput( + helios.Address.fromBech32(refScriptDetail.refScriptAddress || ""), + new helios.Value( + BigInt(1), + new helios.Assets([ + [HANDLE_POLICY_ID, [[refScriptDetail.handleHex, 1]]], + ]) + ), + refScriptDetail.datumCbor + ? helios.Datum.inline( + helios.UplcData.fromCbor( + helios.hexToBytes(refScriptDetail.datumCbor) + ) + ) + : null, + helios.UplcProgram.fromCbor(refScriptDetail.cbor || "") + ) + ); /// build tx const tx = new helios.Tx() @@ -305,12 +391,12 @@ const buyWithAuth = async ( .addSigner(helios.PubKeyHash.fromHex(authorizerPubKeyHash)); /// finalize tx - const txCompleteResult = await mayFailAsync(() => - tx.finalize(networkParams, changeAddress, unSelected) + const txCompleteResult = await mayFailTransaction( + () => tx.finalize(networkParams, changeAddress, unSelected), + refScriptDetail.unoptimizedCbor ).complete(); - if (!txCompleteResult.ok) - return Err(`Finalizing Tx error: ${txCompleteResult.error}`); - return Ok(txCompleteResult.data); + if (!txCompleteResult.ok) return Err(txCompleteResult.error); + return Ok(txCompleteResult.data.toCborHex()); }; export { buy, buyWithAuth }; diff --git a/src/commands/buy.ts b/src/commands/buy.ts index 251a38a..72d92d7 100644 --- a/src/commands/buy.ts +++ b/src/commands/buy.ts @@ -1,95 +1,115 @@ import { buy, BuyConfig, buyWithAuth, BuyWithAuthConfig } from "../buy"; import program from "../cli"; import { loadConfig } from "../config"; -import { deployedScripts } from "../deployed"; import * as helios from "@koralabs/helios"; +import { AssetNameLabel } from "@koralabs/kora-labs-common"; program .command("buy") .description("Buy Handle NFT on Marketplace") .argument("
", "Address to perform buying") + .argument("", "Ada Handle Name to buy on marketplace") .argument("", "Transaction Hash of UTxO where handle is") .argument("", "Transaction Index of UTxO where handle is") - .action(async (bech32Address: string, txHash: string, txIndex: string) => { - const configResult = loadConfig(); - if (!configResult.ok) return program.error(configResult.error); - const config = configResult.data; + .action( + async ( + bech32Address: string, + handleName: string, + txHash: string, + txIndex: string + ) => { + const configResult = loadConfig(); + if (!configResult.ok) return program.error(configResult.error); + const config = configResult.data; - const api = new helios.BlockfrostV0( - config.network, - config.blockfrostApiKey - ); - const utxos = await api.getUtxos(helios.Address.fromBech32(bech32Address)); - const handleUtxo = await api.getUtxo( - new helios.TxOutputId(`${txHash}#${txIndex}`) - ); + const api = new helios.BlockfrostV0( + config.network, + config.blockfrostApiKey + ); + const utxos = await api.getUtxos( + helios.Address.fromBech32(bech32Address) + ); + const handleUtxo = await api.getUtxo( + new helios.TxOutputId(`${txHash}#${txIndex}`) + ); - const refScriptDetail = Object.values(deployedScripts[config.network])[0]; - const refScriptUTxo = await api.getUtxo( - new helios.TxOutputId(refScriptDetail.refScriptUtxo!) - ); - const refScriptCborUtxo = Buffer.from(refScriptUTxo.toFullCbor()).toString( - "hex" - ); + const buyConfig: BuyConfig = { + changeBech32Address: bech32Address, + cborUtxos: utxos.map((utxo) => + Buffer.from(utxo.toFullCbor()).toString("hex") + ), + handleHex: `${AssetNameLabel.LBL_222}${Buffer.from( + handleName, + "utf8" + ).toString("hex")}`, + listingUtxo: { + address: handleUtxo.address.toBech32(), + datum: handleUtxo.output.datum?.data?.toCborHex() || "", + index: handleUtxo.outputId.utxoIdx, + tx_id: handleUtxo.outputId.txId.hex, + lovelace: Number(handleUtxo.value.lovelace), + }, + }; - const buyConfig: BuyConfig = { - changeBech32Address: bech32Address, - cborUtxos: utxos.map((utxo) => - Buffer.from(utxo.toFullCbor()).toString("hex") - ), - handleCborUtxo: Buffer.from(handleUtxo.toFullCbor()).toString("hex"), - refScriptDetail, - refScriptCborUtxo, - }; - - const txResult = await buy(buyConfig, config.network); - if (!txResult.ok) return program.error(txResult.error); - console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); - console.log(txResult.data.toCborHex()); - }); + const txResult = await buy(buyConfig, config.network); + if (!txResult.ok) return program.error(txResult.error); + console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); + console.log(txResult.data); + } + ); program .command("buy-with-auth") .description("Buy Handle NFT on Marketplace with Authorizer") .argument("
", "Address to perform buying") + .argument("", "Ada Handle Name to buy on marketplace") .argument("", "Transaction Hash of UTxO where handle is") .argument("", "Transaction Index of UTxO where handle is") - .action(async (bech32Address: string, txHash: string, txIndex: string) => { - const configResult = loadConfig(); - if (!configResult.ok) return program.error(configResult.error); - const config = configResult.data; - - const api = new helios.BlockfrostV0( - config.network, - config.blockfrostApiKey - ); - const utxos = await api.getUtxos(helios.Address.fromBech32(bech32Address)); - const handleUtxo = await api.getUtxo( - new helios.TxOutputId(`${txHash}#${txIndex}`) - ); + .action( + async ( + bech32Address: string, + handleName: string, + txHash: string, + txIndex: string + ) => { + const configResult = loadConfig(); + if (!configResult.ok) return program.error(configResult.error); + const config = configResult.data; - const refScriptDetail = Object.values(deployedScripts[config.network])[0]; - const refScriptUTxo = await api.getUtxo( - new helios.TxOutputId(refScriptDetail.refScriptUtxo!) - ); - const refScriptCborUtxo = Buffer.from(refScriptUTxo.toFullCbor()).toString( - "hex" - ); + const api = new helios.BlockfrostV0( + config.network, + config.blockfrostApiKey + ); + const utxos = await api.getUtxos( + helios.Address.fromBech32(bech32Address) + ); + const handleUtxo = await api.getUtxo( + new helios.TxOutputId(`${txHash}#${txIndex}`) + ); - const buyWithAuthConfig: BuyWithAuthConfig = { - changeBech32Address: bech32Address, - cborUtxos: utxos.map((utxo) => - Buffer.from(utxo.toFullCbor()).toString("hex") - ), - handleCborUtxo: Buffer.from(handleUtxo.toFullCbor()).toString("hex"), - authorizerPubKeyHash: config.paramters.authorizers[0], - refScriptDetail, - refScriptCborUtxo, - }; + const buyWithAuthConfig: BuyWithAuthConfig = { + changeBech32Address: bech32Address, + cborUtxos: utxos.map((utxo) => + Buffer.from(utxo.toFullCbor()).toString("hex") + ), + handleHex: `${AssetNameLabel.LBL_222}${Buffer.from( + handleName, + "utf8" + ).toString("hex")}`, + listingUtxo: { + address: handleUtxo.address.toBech32(), + datum: handleUtxo.output.datum?.toCborHex() || "", + index: handleUtxo.outputId.utxoIdx, + tx_id: handleUtxo.outputId.txId.hex, + lovelace: Number(handleUtxo.output.value.lovelace), + }, + authorizerPubKeyHash: config.paramters.authorizers[0], + }; - const txResult = await buyWithAuth(buyWithAuthConfig, config.network); - if (!txResult.ok) return program.error(txResult.error); - console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); - console.log(txResult.data.toCborHex()); - }); + const txResult = await buyWithAuth(buyWithAuthConfig, config.network); + if (!txResult.ok) return program.error(txResult.error); + console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); + console.log(txResult.data); + } + ); diff --git a/src/commands/list.ts b/src/commands/list.ts index 8979b5c..90854ba 100644 --- a/src/commands/list.ts +++ b/src/commands/list.ts @@ -1,10 +1,10 @@ import program from "../cli"; import { loadConfig } from "../config"; -import { deployedScripts } from "../deployed"; import { list, ListConfig } from "../list"; import { adaToLovelace } from "../utils"; import * as helios from "@koralabs/helios"; +import { AssetNameLabel } from "@koralabs/kora-labs-common"; const buyCommand = program .command("list") @@ -36,7 +36,10 @@ const buyCommand = program cborUtxos: utxos.map((utxo) => Buffer.from(utxo.toFullCbor()).toString("hex") ), - handleHex: Buffer.from(handleName, "utf8").toString("hex"), + handleHex: `${AssetNameLabel.LBL_222}${Buffer.from( + handleName, + "utf8" + ).toString("hex")}`, payouts: [ { address: bech32Address, @@ -47,13 +50,12 @@ const buyCommand = program amountLovelace: adaToLovelace(Number(priceString) * 0.1), }, ], - refScriptDetail: Object.values(deployedScripts[config.network])[0], }; const txResult = await list(listConfig, config.network); if (!txResult.ok) return program.error(txResult.error); console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); - console.log(txResult.data.toCborHex()); + console.log(txResult.data); } ); diff --git a/src/commands/update.ts b/src/commands/update.ts index e80afa9..3aef04b 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -1,15 +1,16 @@ import program from "../cli"; import { loadConfig } from "../config"; -import { deployedScripts } from "../deployed"; import { update, UpdateConfig } from "../update"; import { adaToLovelace } from "../utils"; import * as helios from "@koralabs/helios"; +import { AssetNameLabel } from "@koralabs/kora-labs-common"; const updateCommand = program .command("update") .description("Update Handle NFT on Marketplace") .argument("
", "Address to perform update") + .argument("", "Ada Handle Name to buy on marketplace") .argument("", "Transaction Hash of UTxO where handle is") .argument("", "Transaction Index of UTxO where handle is") .argument("", "New Price in ada") @@ -17,6 +18,7 @@ const updateCommand = program .action( async ( bech32Address: string, + handleName: string, txHash: string, txIndex: string, newPriceString: string, @@ -37,20 +39,22 @@ const updateCommand = program new helios.TxOutputId(`${txHash}#${txIndex}`) ); - const refScriptDetail = Object.values(deployedScripts[config.network])[0]; - const refScriptUTxo = await api.getUtxo( - new helios.TxOutputId(refScriptDetail.refScriptUtxo!) - ); - const refScriptCborUtxo = Buffer.from( - refScriptUTxo.toFullCbor() - ).toString("hex"); - const updateConfig: UpdateConfig = { changeBech32Address: bech32Address, cborUtxos: utxos.map((utxo) => Buffer.from(utxo.toFullCbor()).toString("hex") ), - handleCborUtxo: Buffer.from(handleUtxo.toFullCbor()).toString("hex"), + handleHex: `${AssetNameLabel.LBL_222}${Buffer.from( + handleName, + "utf8" + ).toString("hex")}`, + listingUtxo: { + address: handleUtxo.address.toBech32(), + datum: handleUtxo.output.datum?.data?.toCborHex() || "", + index: handleUtxo.outputId.utxoIdx, + tx_id: handleUtxo.outputId.txId.hex, + lovelace: Number(handleUtxo.value.lovelace), + }, newPayouts: [ { address: bech32Address, @@ -61,14 +65,12 @@ const updateCommand = program amountLovelace: adaToLovelace(Number(newPriceString) * 0.1), }, ], - refScriptDetail, - refScriptCborUtxo, }; const txResult = await update(updateConfig, config.network); if (!txResult.ok) return program.error(txResult.error); console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); - console.log(txResult.data.toCborHex()); + console.log(txResult.data); } ); diff --git a/src/commands/withdraw.ts b/src/commands/withdraw.ts index 68c90b7..092862f 100644 --- a/src/commands/withdraw.ts +++ b/src/commands/withdraw.ts @@ -1,52 +1,62 @@ import program from "../cli"; import { loadConfig } from "../config"; -import { deployedScripts } from "../deployed"; import { withdraw, WithdrawConfig } from "../withdraw"; import * as helios from "@koralabs/helios"; +import { AssetNameLabel } from "@koralabs/kora-labs-common"; const withdrawCommand = program .command("withdraw") .description("Withdraw Handle NFT from Marketplace") .argument("
", "Address to perform withdraw") + .argument("", "Ada Handle Name to buy on marketplace") .argument("", "Transaction Hash of UTxO where handle is") .argument("", "Transaction Index of UTxO where handle is") - .action(async (bech32Address: string, txHash: string, txIndex: string) => { - const configResult = loadConfig(); - if (!configResult.ok) return program.error(configResult.error); - const config = configResult.data; + .action( + async ( + bech32Address: string, + handleName: string, + txHash: string, + txIndex: string + ) => { + const configResult = loadConfig(); + if (!configResult.ok) return program.error(configResult.error); + const config = configResult.data; - const api = new helios.BlockfrostV0( - config.network, - config.blockfrostApiKey - ); - const utxos = await api.getUtxos(helios.Address.fromBech32(bech32Address)); - const handleUtxo = await api.getUtxo( - new helios.TxOutputId(`${txHash}#${txIndex}`) - ); + const api = new helios.BlockfrostV0( + config.network, + config.blockfrostApiKey + ); + const utxos = await api.getUtxos( + helios.Address.fromBech32(bech32Address) + ); + const handleUtxo = await api.getUtxo( + new helios.TxOutputId(`${txHash}#${txIndex}`) + ); - const refScriptDetail = Object.values(deployedScripts[config.network])[0]; - const refScriptUTxo = await api.getUtxo( - new helios.TxOutputId(refScriptDetail.refScriptUtxo!) - ); - const refScriptCborUtxo = Buffer.from(refScriptUTxo.toFullCbor()).toString( - "hex" - ); + const withdrawConfig: WithdrawConfig = { + changeBech32Address: bech32Address, + cborUtxos: utxos.map((utxo) => + Buffer.from(utxo.toFullCbor()).toString("hex") + ), + handleHex: `${AssetNameLabel.LBL_222}${Buffer.from( + handleName, + "utf8" + ).toString("hex")}`, + listingUtxo: { + address: handleUtxo.address.toBech32(), + datum: handleUtxo.output.datum?.data?.toCborHex() || "", + index: handleUtxo.outputId.utxoIdx, + tx_id: handleUtxo.outputId.txId.hex, + lovelace: Number(handleUtxo.value.lovelace), + }, + }; - const withdrawConfig: WithdrawConfig = { - changeBech32Address: bech32Address, - cborUtxos: utxos.map((utxo) => - Buffer.from(utxo.toFullCbor()).toString("hex") - ), - handleCborUtxo: Buffer.from(handleUtxo.toFullCbor()).toString("hex"), - refScriptDetail, - refScriptCborUtxo, - }; - - const txResult = await withdraw(withdrawConfig, config.network); - if (!txResult.ok) return program.error(txResult.error); - console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); - console.log(txResult.data.toCborHex()); - }); + const txResult = await withdraw(withdrawConfig, config.network); + if (!txResult.ok) return program.error(txResult.error); + console.log("\nTransaction CBOR Hex, copy and paste to wallet\n"); + console.log(txResult.data); + } + ); export default withdrawCommand; diff --git a/src/config.ts b/src/config.ts index c979eba..4c436cd 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,16 +1,12 @@ -import { get, getNetwork, loadEnv } from "./helpers"; +import { BLOCKFROST_API_KEY } from "./constants"; +import { getNetwork } from "./helpers"; import { Parameters } from "./types"; import * as helios from "@koralabs/helios"; -import { Err, Ok } from "ts-res"; - -loadEnv({ path: ".env.preprod.local" }); +import { Ok } from "ts-res"; const loadConfig = () => { - const blockfrostApiKey = get("BLOCKFROST_API_KEY", "string"); - if (!blockfrostApiKey.ok) return Err(blockfrostApiKey.error); - - const network = getNetwork(blockfrostApiKey.data); + const network = getNetwork(BLOCKFROST_API_KEY); /// set config helios.config.set({ @@ -30,7 +26,7 @@ const loadConfig = () => { }; return Ok({ - blockfrostApiKey: blockfrostApiKey.data, + blockfrostApiKey: BLOCKFROST_API_KEY, network, paramters, }); diff --git a/src/constants/index.ts b/src/constants/index.ts index 11676d6..57227d0 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,9 +1,24 @@ +import { config } from "dotenv"; +config({ path: `.env.${process.env.NODE_ENV || "development"}.local` }); + +export const { + NODE_ENV = "", + NETWORK = "", + BLOCKFROST_API_KEY = "", + KORA_USER_AGENT = "", + HANDLE_ME_API_KEY = "", +} = process.env; +export const NETWORK_HOST = + process.env.NETWORK?.toLocaleLowerCase() == "mainnet" + ? "" + : `${process.env.NETWORK?.toLowerCase()}.`; +export const HANDLE_API_ENDPOINT = + process.env.HANDLE_API_ENDPOINT || `https://${NETWORK_HOST}api.handle.me`; + /// tx -const MIN_FEE = 5_000_000n; /// 5 ada -const MIN_LOVELACE = 3_000_000n; /// at leat 3 ada for each utxo +export const MIN_FEE = 5_000_000n; /// 5 ada +export const MIN_LOVELACE = 3_000_000n; /// at leat 3 ada for each utxo /// ada handle -const HANDLE_POLICY_ID = +export const HANDLE_POLICY_ID = "f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a"; - -export { HANDLE_POLICY_ID, MIN_FEE, MIN_LOVELACE }; diff --git a/src/entrypoint.ts b/src/entrypoint.ts index 8062690..57cb2ab 100644 --- a/src/entrypoint.ts +++ b/src/entrypoint.ts @@ -1,5 +1,5 @@ import program from "./cli"; -import { getDirname, loadEnv } from "./helpers"; +import { getDirname } from "./helpers"; import fs from "fs/promises"; import path from "path"; @@ -23,7 +23,6 @@ const loadCommands = async (directory: string) => { }; const run = async () => { - loadEnv(); await loadCommands(commandsDir); try { diff --git a/src/helpers/api.ts b/src/helpers/api.ts new file mode 100644 index 0000000..3883097 --- /dev/null +++ b/src/helpers/api.ts @@ -0,0 +1,46 @@ +import { + HANDLE_API_ENDPOINT, + HANDLE_ME_API_KEY, + KORA_USER_AGENT, +} from "../constants"; + +import { IS_PRODUCTION } from "@koralabs/kora-labs-common"; +import { fetch } from "cross-fetch"; + +const fetchApi = async ( + endpoint: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + params: any = {} +): Promise => { + const { headers, ...rest } = params; + const baseUrl = HANDLE_API_ENDPOINT; + const url = `${baseUrl}/${endpoint}`; + const apiKey = IS_PRODUCTION ? "" : HANDLE_ME_API_KEY; + + const fetchHeaders = { + ...headers, + "User-Agent": KORA_USER_AGENT, + "api-key": apiKey, + }; + + return fetch(url, { + headers: fetchHeaders, + ...rest, + }); +}; + +const fetchApiJson = async ( + endpoint: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + params: any = {} +): Promise => { + params.headers = { + ...params.headers, + "Content-Type": "application/json", + Accept: "application/json", + }; + const response = await fetchApi(endpoint, params); + return response.json(); +}; + +export { fetchApi, fetchApiJson }; diff --git a/src/helpers/error/index.ts b/src/helpers/error/index.ts index f9cdf71..3d8e56f 100644 --- a/src/helpers/error/index.ts +++ b/src/helpers/error/index.ts @@ -2,4 +2,5 @@ import convertError from "./convert"; export * from "./handleable"; export * from "./handleableAsync"; +export * from "./tx"; export { convertError }; diff --git a/src/helpers/error/tx.ts b/src/helpers/error/tx.ts new file mode 100644 index 0000000..114313d --- /dev/null +++ b/src/helpers/error/tx.ts @@ -0,0 +1,85 @@ +import convertError from "./convert"; + +import * as helios from "@koralabs/helios"; +import { Err, Ok, Result } from "ts-res"; + +type Callback = () => Promise; +type ErrType = string | Error | void | undefined; +type HandleableResult = { + handle: (handler: (e: E) => void) => HandleableResult; + complete: () => Promise>; +}; + +const buildRefScriptUplcProgram = (cbor: string) => { + const getProgram = (programHex: string) => { + try { + // Try encoding the script as a UPLC contract if it works send that back! + return helios.UplcProgram.fromCbor(helios.hexToBytes(programHex)); + } catch (err) { + // Otherwise wrap the program in a UplcData bytes block and try again! + return helios.UplcProgram.fromCbor( + helios.Cbor.encodeBytes(helios.hexToBytes(programHex)) + ); + } + }; + + const refScript = getProgram(cbor); + return refScript; +}; + +const mayFailTransaction = ( + callback: Callback, + unoptimzedScriptCbor?: string +): HandleableResult => { + const createHandleable = ( + handler: (e: string) => void + ): HandleableResult => { + return { + handle: (handler) => createHandleable(handler), + complete: async (): Promise> => { + try { + return Ok(await callback()); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (error: any) { + if (error.context && unoptimzedScriptCbor) { + const { context } = error; + const args = [ + helios.UplcData.fromCbor(context.Redeemer), + helios.UplcData.fromCbor(context.ScriptContext), + ]; + + if ("Datum" in context) { + args.unshift(helios.UplcData.fromCbor(context.Datum)); + } + + try { + const uplcProgram = + buildRefScriptUplcProgram(unoptimzedScriptCbor); + const res = await uplcProgram.run( + args.map( + (a) => new helios.UplcDataValue(helios.Site.dummy(), a) + ) + ); + const errorMessage = res.toString(); + handler(errorMessage); + return Err(errorMessage); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (runProgramError: any) { + const errorMessage = `Error running program: ${runProgramError.message} with error ${error.message}`; + handler(errorMessage); + return Err(errorMessage); + } + } + + const errorMessage = convertError(error); + handler(errorMessage); + return Err(errorMessage); + } + }, + }; + }; + + return createHandleable(() => {}); +}; + +export { mayFailTransaction }; diff --git a/src/helpers/index.ts b/src/helpers/index.ts index eac96b2..6ed6c2e 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -1,3 +1,4 @@ +export * from "./api"; export * from "./blockfrost"; export * from "./common"; export * from "./config"; diff --git a/src/list.ts b/src/list.ts index f83d7b4..6537e33 100644 --- a/src/list.ts +++ b/src/list.ts @@ -1,11 +1,16 @@ import { HANDLE_POLICY_ID, MIN_LOVELACE } from "./constants"; import { buildDatum, decodeParametersDatum } from "./datum"; +import { deployedScripts } from "./deployed"; import { mayFail, mayFailAsync } from "./helpers"; import { Payout } from "./types"; -import { fetchNetworkParameters, getUplcProgram } from "./utils"; +import { + fetchLatestmarketplaceScriptDetail, + fetchNetworkParameters, + getUplcProgram, +} from "./utils"; import * as helios from "@koralabs/helios"; -import { Network, ScriptDetails } from "@koralabs/kora-labs-common"; +import { Network } from "@koralabs/kora-labs-common"; import { Err, Ok, Result } from "ts-res"; /** @@ -16,33 +21,35 @@ import { Err, Ok, Result } from "ts-res"; * @property {string[]} cborUtxos UTxOs (cbor format) of wallet * @property {string} handleHex Handle name's hex format (asset name label is also included) * @property {Payout[]} payouts Payouts which is requried to pay when buy this handle - * @property {ScriptDetails} refScriptDetail Deployed marketplace contract detail */ interface ListConfig { changeBech32Address: string; cborUtxos: string[]; handleHex: string; payouts: Payout[]; - refScriptDetail: ScriptDetails; } /** * List Handle to marketplace * @param {ListConfig} config * @param {Network} network - * @returns {Promise>} + * @returns {Promise>} */ const list = async ( config: ListConfig, network: Network -): Promise> => { - const { - changeBech32Address, - cborUtxos, - handleHex, - payouts, - refScriptDetail, - } = config; +): Promise> => { + const { changeBech32Address, cborUtxos, handleHex, payouts } = config; + + /// fetch marketplace reference script detail + const refScriptDetailResult = await mayFailAsync(() => + fetchLatestmarketplaceScriptDetail() + ).complete(); + + /// use deployed script if fetch is failed + const refScriptDetail = refScriptDetailResult.ok + ? refScriptDetailResult.data + : Object.values(deployedScripts[network])[0]; const { cbor, datumCbor, refScriptUtxo } = refScriptDetail; if (!cbor) return Err(`Deploy script cbor is empty`); if (!datumCbor) return Err(`Deploy script's datum cbor is empty`); @@ -112,7 +119,7 @@ const list = async ( if (!txCompleteResult.ok) return Err(`Finalizing Tx error: ${txCompleteResult.error}`); - return Ok(txCompleteResult.data); + return Ok(txCompleteResult.data.toCborHex()); }; export { list }; diff --git a/src/update.ts b/src/update.ts index 33b4bf4..2717511 100644 --- a/src/update.ts +++ b/src/update.ts @@ -1,11 +1,16 @@ -import { MIN_FEE } from "./constants"; +import { HANDLE_POLICY_ID, MIN_FEE } from "./constants"; import { buildDatum, decodeDatum, decodeParametersDatum } from "./datum"; -import { mayFail, mayFailAsync } from "./helpers"; +import { deployedScripts } from "./deployed"; +import { mayFail, mayFailAsync, mayFailTransaction } from "./helpers"; import { Payout } from "./types"; -import { fetchNetworkParameters, getUplcProgram } from "./utils"; +import { + fetchLatestmarketplaceScriptDetail, + fetchNetworkParameters, + getUplcProgram, +} from "./utils"; import * as helios from "@koralabs/helios"; -import { Network, ScriptDetails } from "@koralabs/kora-labs-common"; +import { IUTxO, Network } from "@koralabs/kora-labs-common"; import { WithdrawOrUpdate } from "redeemer"; import { Err, Ok, Result } from "ts-res"; @@ -15,18 +20,18 @@ import { Err, Ok, Result } from "ts-res"; * @typedef {object} UpdateConfig * @property {string} changeBech32Address Change address of wallet who is performing `list` * @property {string[]} cborUtxos UTxOs (cbor format) of wallet - * @property {string} handleCborUtxo UTxO (cbor format) of handle to buy + * @property {string | undefined | null} collateralCborUtxo Collateral UTxO. Can be null, then we will select one in function + * @property {string} handleHex Handle name's hex format (asset name label is also included) + * @property {IUTxO} listingUtxo UTxO where this handle is listed * @property {Payout[]} newPayouts New payouts which is requried to pay when buy this handle - * @property {ScriptDetails} refScriptDetail Deployed marketplace contract detail - * @property {string} refScriptCborUtxo UTxO (cbor format) where marketplace contract is deployed */ interface UpdateConfig { changeBech32Address: string; cborUtxos: string[]; - handleCborUtxo: string; /// handle (to update) is in this utxo + collateralCborUtxo?: string | null; + handleHex: string; + listingUtxo: IUTxO; newPayouts: Payout[]; - refScriptDetail: ScriptDetails; - refScriptCborUtxo: string; } /** @@ -38,15 +43,20 @@ interface UpdateConfig { const update = async ( config: UpdateConfig, network: Network -): Promise> => { - const { - changeBech32Address, - cborUtxos, - handleCborUtxo, - newPayouts, - refScriptDetail, - refScriptCborUtxo, - } = config; +): Promise> => { + const { changeBech32Address, cborUtxos, handleHex, listingUtxo, newPayouts } = + config; + + /// fetch marketplace reference script detail + const refScriptDetailResult = await mayFailAsync(() => + fetchLatestmarketplaceScriptDetail() + ).complete(); + + /// use deployed script if fetch is failed + const refScriptDetail = refScriptDetailResult.ok + ? refScriptDetailResult.data + : Object.values(deployedScripts[network])[0]; + const { cbor, datumCbor, refScriptUtxo } = refScriptDetail; if (!cbor) return Err(`Deploy script cbor is empty`); if (!datumCbor) return Err(`Deploy script's datum cbor is empty`); @@ -79,9 +89,24 @@ const update = async ( const utxos = cborUtxos.map((cborUtxo) => helios.TxInput.fromFullCbor([...Buffer.from(cborUtxo, "hex")]) ); - const handleUtxo = helios.TxInput.fromFullCbor([ - ...Buffer.from(handleCborUtxo, "hex"), - ]); + const handleUtxo = new helios.TxInput( + new helios.TxOutputId( + helios.TxId.fromHex(listingUtxo.tx_id), + listingUtxo.index + ), + new helios.TxOutput( + helios.Address.fromBech32(listingUtxo.address), + new helios.Value( + BigInt(listingUtxo.lovelace), + new helios.Assets([[HANDLE_POLICY_ID, [[handleHex, 1]]]]) + ), + listingUtxo.datum + ? helios.Datum.inline( + helios.UplcData.fromCbor(helios.hexToBytes(listingUtxo.datum)) + ) + : null + ) + ); const handleRawDatum = handleUtxo.output.datum; if (!handleRawDatum) return Err("Handle UTxO datum not found"); @@ -122,9 +147,26 @@ const update = async ( handleUpdateOutput.correctLovelace(networkParams); /// make ref input - const refInput = helios.TxInput.fromFullCbor([ - ...Buffer.from(refScriptCborUtxo, "hex"), - ]); + const refInput = new helios.TxInput( + new helios.TxOutputId(refScriptDetail.refScriptUtxo || ""), + new helios.TxOutput( + helios.Address.fromBech32(refScriptDetail.refScriptAddress || ""), + new helios.Value( + BigInt(1), + new helios.Assets([ + [HANDLE_POLICY_ID, [[refScriptDetail.handleHex, 1]]], + ]) + ), + refScriptDetail.datumCbor + ? helios.Datum.inline( + helios.UplcData.fromCbor( + helios.hexToBytes(refScriptDetail.datumCbor) + ) + ) + : null, + helios.UplcProgram.fromCbor(refScriptDetail.cbor || "") + ) + ); /// build tx const tx = new helios.Tx() @@ -135,12 +177,12 @@ const update = async ( .addOutput(handleUpdateOutput); /// updated handle output /// finalize tx - const txCompleteResult = await mayFailAsync(() => - tx.finalize(networkParams, changeAddress, unSelected) + const txCompleteResult = await mayFailTransaction( + () => tx.finalize(networkParams, changeAddress, unSelected), + refScriptDetail.unoptimizedCbor ).complete(); - if (!txCompleteResult.ok) - return Err(`Finalizing Tx error: ${txCompleteResult.error}`); - return Ok(txCompleteResult.data); + if (!txCompleteResult.ok) return Err(txCompleteResult.error); + return Ok(txCompleteResult.data.toCborHex()); }; export { update }; diff --git a/src/utils/contract.ts b/src/utils/contract.ts index ec67266..7d71506 100644 --- a/src/utils/contract.ts +++ b/src/utils/contract.ts @@ -1,8 +1,8 @@ -import { getDirname } from "../helpers"; +import { fetchApi, getDirname } from "../helpers"; import { Parameters } from "../types"; import * as helios from "@koralabs/helios"; -import { Network } from "@koralabs/kora-labs-common"; +import { Network, ScriptDetails } from "@koralabs/kora-labs-common"; import fs from "fs/promises"; import path from "path"; @@ -51,4 +51,23 @@ const getUplcProgramDetail = async ( }; }; -export { getHeliosProgram, getUplcProgram, getUplcProgramDetail }; +const fetchLatestmarketplaceScriptDetail = async (): Promise => { + const result = await fetchApi( + `scripts?latest=true&type=marketplace_contract` + ); + + if (!result.ok) { + const error = await result.json(); + throw new Error(error?.message || String(error)); + } + + const data = (await result.json()) as unknown as ScriptDetails; + return data; +}; + +export { + fetchLatestmarketplaceScriptDetail, + getHeliosProgram, + getUplcProgram, + getUplcProgramDetail, +}; diff --git a/src/withdraw.ts b/src/withdraw.ts index 1bd99e4..7adbbfd 100644 --- a/src/withdraw.ts +++ b/src/withdraw.ts @@ -1,10 +1,15 @@ -import { MIN_FEE } from "./constants"; +import { HANDLE_POLICY_ID, MIN_FEE } from "./constants"; import { decodeDatum, decodeParametersDatum } from "./datum"; -import { mayFail, mayFailAsync } from "./helpers"; -import { fetchNetworkParameters, getUplcProgram } from "./utils"; +import { deployedScripts } from "./deployed"; +import { mayFail, mayFailAsync, mayFailTransaction } from "./helpers"; +import { + fetchLatestmarketplaceScriptDetail, + fetchNetworkParameters, + getUplcProgram, +} from "./utils"; import * as helios from "@koralabs/helios"; -import { Network, ScriptDetails } from "@koralabs/kora-labs-common"; +import { IUTxO, Network } from "@koralabs/kora-labs-common"; import { WithdrawOrUpdate } from "redeemer"; import { Err, Ok, Result } from "ts-res"; @@ -14,16 +19,16 @@ import { Err, Ok, Result } from "ts-res"; * @typedef {object} WithdrawConfig * @property {string} changeBech32Address Change address of wallet who is performing `list` * @property {string[]} cborUtxos UTxOs (cbor format) of wallet - * @property {string} handleCborUtxo UTxO (cbor format) of handle to buy - * @property {ScriptDetails} refScriptDetail Deployed marketplace contract detail - * @property {string} refScriptCborUtxo UTxO (cbor format) where marketplace contract is deployed + * @property {string | undefined | null} collateralCborUtxo Collateral UTxO. Can be null, then we will select one in function + * @property {string} handleHex Handle name's hex format (asset name label is also included) + * @property {IUTxO} listingUtxo UTxO where this handle is listed */ interface WithdrawConfig { changeBech32Address: string; cborUtxos: string[]; - handleCborUtxo: string; /// handle (to withdraw) is in this utxo - refScriptDetail: ScriptDetails; - refScriptCborUtxo: string; + collateralCborUtxo?: string | null; + handleHex: string; + listingUtxo: IUTxO; } /** @@ -35,14 +40,19 @@ interface WithdrawConfig { const withdraw = async ( config: WithdrawConfig, network: Network -): Promise> => { - const { - changeBech32Address, - cborUtxos, - handleCborUtxo, - refScriptDetail, - refScriptCborUtxo, - } = config; +): Promise> => { + const { changeBech32Address, cborUtxos, handleHex, listingUtxo } = config; + + /// fetch marketplace reference script detail + const refScriptDetailResult = await mayFailAsync(() => + fetchLatestmarketplaceScriptDetail() + ).complete(); + + /// use deployed script if fetch is failed + const refScriptDetail = refScriptDetailResult.ok + ? refScriptDetailResult.data + : Object.values(deployedScripts[network])[0]; + const { cbor, datumCbor, refScriptUtxo } = refScriptDetail; if (!cbor) return Err(`Deploy script cbor is empty`); if (!datumCbor) return Err(`Deploy script's datum cbor is empty`); @@ -75,9 +85,24 @@ const withdraw = async ( const utxos = cborUtxos.map((cborUtxo) => helios.TxInput.fromFullCbor([...Buffer.from(cborUtxo, "hex")]) ); - const handleUtxo = helios.TxInput.fromFullCbor([ - ...Buffer.from(handleCborUtxo, "hex"), - ]); + const handleUtxo = new helios.TxInput( + new helios.TxOutputId( + helios.TxId.fromHex(listingUtxo.tx_id), + listingUtxo.index + ), + new helios.TxOutput( + helios.Address.fromBech32(listingUtxo.address), + new helios.Value( + BigInt(listingUtxo.lovelace), + new helios.Assets([[HANDLE_POLICY_ID, [[handleHex, 1]]]]) + ), + listingUtxo.datum + ? helios.Datum.inline( + helios.UplcData.fromCbor(helios.hexToBytes(listingUtxo.datum)) + ) + : null + ) + ); const handleRawDatum = handleUtxo.output.datum; if (!handleRawDatum) return Err("Handle UTxO datum not found"); @@ -91,7 +116,7 @@ const withdraw = async ( const ownerPubKeyHash = changeAddress.pubKeyHash; if (!ownerPubKeyHash) return Err(`Change Address doesn't have payment key`); if (datum.owner != ownerPubKeyHash.hex) - return Err(`You must be owner to update`); + return Err(`You must be owner to withdraw`); /// take fund const [selected, unSelected] = helios.CoinSelection.selectLargestFirst( @@ -111,9 +136,26 @@ const withdraw = async ( handleWithdrawOutput.correctLovelace(networkParams); /// make ref input - const refInput = helios.TxInput.fromFullCbor([ - ...Buffer.from(refScriptCborUtxo, "hex"), - ]); + const refInput = new helios.TxInput( + new helios.TxOutputId(refScriptDetail.refScriptUtxo || ""), + new helios.TxOutput( + helios.Address.fromBech32(refScriptDetail.refScriptAddress || ""), + new helios.Value( + BigInt(1), + new helios.Assets([ + [HANDLE_POLICY_ID, [[refScriptDetail.handleHex, 1]]], + ]) + ), + refScriptDetail.datumCbor + ? helios.Datum.inline( + helios.UplcData.fromCbor( + helios.hexToBytes(refScriptDetail.datumCbor) + ) + ) + : null, + helios.UplcProgram.fromCbor(refScriptDetail.cbor || "") + ) + ); /// build tx const tx = new helios.Tx() @@ -124,12 +166,12 @@ const withdraw = async ( .addOutput(handleWithdrawOutput); /// finalize tx - const txCompleteResult = await mayFailAsync(() => - tx.finalize(networkParams, changeAddress, unSelected) + const txCompleteResult = await mayFailTransaction( + () => tx.finalize(networkParams, changeAddress, unSelected), + refScriptDetail.unoptimizedCbor ).complete(); - if (!txCompleteResult.ok) - return Err(`Finalizing Tx error: ${txCompleteResult.error}`); - return Ok(txCompleteResult.data); + if (!txCompleteResult.ok) return Err(txCompleteResult.error); + return Ok(txCompleteResult.data.toCborHex()); }; export { withdraw }; diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..1f546dc --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + format: ["esm"], + clean: true, + dts: true, + entry: ["./src/index.ts"], +});