diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000..2e07606d52 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.wasm32-unknown-unknown] +rustflags = ['--cfg', 'getrandom_backend="wasm_js"'] diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 49d3e95847..2dfe11f43c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -243,7 +243,7 @@ jobs: uses: actions/download-artifact@v4 with: name: identity-wasm-bindings-build - path: bindings/wasm/ + path: bindings/wasm/identity_wasm - name: Start iota sandbox uses: './.github/actions/iota-rebase-sandbox/setup' @@ -260,14 +260,6 @@ jobs: run: npm ci working-directory: bindings/wasm/identity_wasm - - name: Install JS dependencies # This is problematic: @iota/iota-sdk seems to not get used from the identity_wasm package, that is why reinstall deps here - run: npm ci - working-directory: bindings/wasm/iota_interaction_ts - - - name: Setup link - run: npm link ../iota_interaction_ts - working-directory: bindings/wasm/identity_wasm - - name: Run Wasm examples run: npm run test:readme && npm run test:node working-directory: bindings/wasm/identity_wasm @@ -297,15 +289,7 @@ jobs: uses: actions/download-artifact@v4 with: name: identity-wasm-bindings-build - path: bindings/wasm/ - - - name: Install JS dependencies # This is problematic: @iota/iota-sdk seems to not get used from the identity_wasm package, that is why reinstall deps here - run: npm ci - working-directory: bindings/wasm/iota_interaction_ts - - - name: Setup link - run: npm link ../iota_interaction_ts - working-directory: bindings/wasm/identity_wasm + path: bindings/wasm/identity_wasm - name: Start iota sandbox uses: './.github/actions/iota-rebase-sandbox/setup' diff --git a/.github/workflows/shared-build-wasm.yml b/.github/workflows/shared-build-wasm.yml index a489b43feb..45673fb886 100644 --- a/.github/workflows/shared-build-wasm.yml +++ b/.github/workflows/shared-build-wasm.yml @@ -69,14 +69,6 @@ jobs: with: node-version: 20.x - - name: Install JS dependencies - run: npm ci - working-directory: bindings/wasm/iota_interaction_ts - - - name: Build IOTA interaction bindings - run: npm run build - working-directory: bindings/wasm/iota_interaction_ts - - name: Install JS dependencies run: npm ci working-directory: bindings/wasm/identity_wasm @@ -104,7 +96,5 @@ jobs: bindings/wasm/identity_wasm/web bindings/wasm/identity_wasm/examples/dist bindings/wasm/identity_wasm/docs - bindings/wasm/iota_interaction_ts/node - bindings/wasm/iota_interaction_ts/web if-no-files-found: error retention-days: 1 diff --git a/Cargo.toml b/Cargo.toml index e9870fa073..fe2c25a9a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,14 +23,15 @@ members = [ "identity_ecdsa_verifier", "identity_eddsa_verifier", "examples", - "identity_iota_interaction", - "bindings/wasm/iota_interaction_ts", ] exclude = ["bindings/wasm/identity_wasm", "bindings/grpc"] [workspace.dependencies] bls12_381_plus = { version = "0.8.17" } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction" } +iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction_ts" } +product_common = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common" } serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } serde_json = { version = "1.0", default-features = false } strum = { version = "0.25", default-features = false, features = ["std", "derive"] } @@ -40,6 +41,7 @@ zkryptium = { version = "0.2.2", default-features = false, features = ["bbsplus" [workspace.lints.clippy] result_large_err = "allow" +large_enum_variant = "allow" [profile.release.package.iota_interaction_ts] opt-level = 's' diff --git a/bindings/wasm/README.md b/bindings/wasm/README.md index 4b25076746..8cf5ee71f1 100644 --- a/bindings/wasm/README.md +++ b/bindings/wasm/README.md @@ -10,9 +10,9 @@ Here is an overview of the existing artifacts: * `identity_wasm`
Exports the IdentityClient to TypeScript using wasm-bindgen generated wasm bindings -* `iota_interaction_ts`
+* `iota_move_calls_ts`
Imports TypeScript IOTA Client SDK types using wasm-bindgen generated wasm bindings - and implements identity_iota_interaction traits (among others, IotaClient and MoveCall traits) for wasm32 platforms. + and implements identity_iota_move_calls traits for wasm32 platforms. ## Building an Artifact diff --git a/bindings/wasm/identity_wasm/Cargo.toml b/bindings/wasm/identity_wasm/Cargo.toml index 33a0174dbb..a0c88cbb92 100644 --- a/bindings/wasm/identity_wasm/Cargo.toml +++ b/bindings/wasm/identity_wasm/Cargo.toml @@ -25,9 +25,12 @@ identity_ecdsa_verifier = { path = "../../../identity_ecdsa_verifier", default-f identity_eddsa_verifier = { path = "../../../identity_eddsa_verifier", default-features = false, features = ["ed25519"] } # Remove iota-sdk dependency while working on issue #1445 iota-sdk = { version = "1.1.5", default-features = false, features = ["serde", "std"] } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", default-features = false } +iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction_ts" } js-sys = { version = "0.3.61" } json-proof-token = "0.3.4" proc_typescript = { version = "0.1.0", path = "./proc_typescript" } +product-core = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common", features = ["core-client", "transaction"] } secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", default-features = false, tag = "v0.3.0" } serde = { version = "1.0", features = ["derive"] } serde-wasm-bindgen = "0.6.5" @@ -39,6 +42,8 @@ tsify = "0.4.5" wasm-bindgen = { version = "0.2.100", features = ["serde-serialize"] } wasm-bindgen-futures = { version = "0.4", default-features = false } +# iota_interaction_ts = { path = "../../../../product-core/bindings/wasm/iota_interaction_ts", optional = true } + [dependencies.identity_iota] path = "../../../identity_iota" default-features = false @@ -53,11 +58,6 @@ features = [ "jpt-bbs-plus", ] -# dummy-client dependencies -[dependencies.iota_interaction_ts] -path = "../iota_interaction_ts" -optional = true - [target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies] getrandom_0_2 = { package = "getrandom", version = "0.2", default-features = false, features = ["js"] } getrandom = { version = "0.3", default-features = false, features = ["wasm_js"] } @@ -81,6 +81,5 @@ empty_docs = "allow" unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] } [features] -default = ["dummy-client"] -dummy-client = ["dep:iota_interaction_ts"] -keytool = ["dep:iota_interaction_ts", "iota_interaction_ts/keytool", "identity_iota/keytool"] +default = [] +keytool = ["iota_interaction_ts/keytool", "identity_iota/keytool"] diff --git a/bindings/wasm/identity_wasm/cypress/app/package-lock.json b/bindings/wasm/identity_wasm/cypress/app/package-lock.json index 67ac79ebe6..89fa46f70e 100644 --- a/bindings/wasm/identity_wasm/cypress/app/package-lock.json +++ b/bindings/wasm/identity_wasm/cypress/app/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "@iota/identity-wasm": "file:../..", - "@iota/iota-sdk": "^0.6.0" + "@iota/iota-sdk": "^1.0.0" }, "devDependencies": { "typescript": "~5.7.2", @@ -18,10 +18,10 @@ }, "../..": { "name": "@iota/identity-wasm", - "version": "1.6.0-alpha.3", + "version": "1.6.0-alpha.5", "license": "Apache-2.0", "dependencies": { - "@iota/iota-interaction-ts": "^0.3.0", + "@iota/iota-interaction-ts": "^0.4.2", "@noble/ed25519": "^1.7.3", "@noble/hashes": "^1.4.0", "@types/node-fetch": "^2.6.2", @@ -55,473 +55,6535 @@ "node": ">=20" }, "peerDependencies": { - "@iota/iota-sdk": "^0.6.0" + "@iota/iota-sdk": "^1.0.0" } }, - "../../../../identity.rs/bindings/wasm/identity_wasm": { - "version": "1.6.0-alpha.2", - "extraneous": true, + "../../node_modules/@0no-co/graphql.web": { + "version": "1.1.2", + "license": "MIT", + "peer": true, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" + }, + "peerDependenciesMeta": { + "graphql": { + "optional": true + } + } + }, + "../../node_modules/@0no-co/graphqlsp": { + "version": "1.12.16", + "license": "MIT", + "peer": true, + "dependencies": { + "@gql.tada/internal": "^1.0.0", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" + }, + "peerDependencies": { + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "typescript": "^5.0.0" + } + }, + "../../node_modules/@babel/parser": { + "version": "7.21.1", + "dev": true, + "license": "MIT", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "../../node_modules/@colors/colors": { + "version": "1.5.0", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "../../node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "../../node_modules/@cypress/request": { + "version": "3.0.8", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@iota/iota-interaction-ts": "^0.3.0", - "@noble/ed25519": "^1.7.3", + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~4.0.0", + "http-signature": "~1.4.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "performance-now": "^2.1.0", + "qs": "6.14.0", + "safe-buffer": "^5.1.2", + "tough-cookie": "^5.0.0", + "tunnel-agent": "^0.6.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "../../node_modules/@cypress/request/node_modules/form-data": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "../../node_modules/@cypress/xvfb": { + "version": "1.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "lodash.once": "^4.1.1" + } + }, + "../../node_modules/@cypress/xvfb/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "../../node_modules/@gerrit0/mini-shiki": { + "version": "1.27.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^1.27.2", + "@shikijs/types": "^1.27.2", + "@shikijs/vscode-textmate": "^10.0.1" + } + }, + "../../node_modules/@gql.tada/cli-utils": { + "version": "1.6.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@0no-co/graphqlsp": "^1.12.13", + "@gql.tada/internal": "1.0.8", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" + }, + "peerDependencies": { + "@0no-co/graphqlsp": "^1.12.13", + "@gql.tada/svelte-support": "1.0.1", + "@gql.tada/vue-support": "1.0.1", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "@gql.tada/svelte-support": { + "optional": true + }, + "@gql.tada/vue-support": { + "optional": true + } + } + }, + "../../node_modules/@gql.tada/internal": { + "version": "1.0.8", + "license": "MIT", + "peer": true, + "dependencies": { + "@0no-co/graphql.web": "^1.0.5" + }, + "peerDependencies": { + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "typescript": "^5.0.0" + } + }, + "../../node_modules/@graphql-typed-document-node/core": { + "version": "3.2.0", + "license": "MIT", + "peer": true, + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "../../node_modules/@hapi/hoek": { + "version": "9.3.0", + "dev": true, + "license": "BSD-3-Clause" + }, + "../../node_modules/@hapi/topo": { + "version": "5.1.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "../../node_modules/@iota/bcs": { + "version": "1.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "bs58": "^6.0.0" + } + }, + "../../node_modules/@iota/iota-interaction-ts": { + "version": "0.4.2", + "license": "Apache-2.0", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@iota/iota-sdk": "^1.0.0" + } + }, + "../../node_modules/@iota/iota-sdk": { + "version": "1.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@graphql-typed-document-node/core": "^3.2.0", + "@iota/bcs": "1.0.0", + "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", - "@types/node-fetch": "^2.6.2", - "base64-arraybuffer": "^1.0.2", - "jose": "^5.9.6", - "node-fetch": "^2.6.7" + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", + "@suchipi/femver": "^1.0.0", + "bech32": "^2.0.0", + "gql.tada": "^1.8.2", + "graphql": "^16.9.0", + "tweetnacl": "^1.0.3", + "valibot": "^0.36.0" }, - "devDependencies": { - "@digitalcredentials/did-method-key": "^2.0.3", - "@types/jsonwebtoken": "^9.0.7", - "@types/mocha": "^9.1.0", - "@types/node": "^22.0.0", - "big-integer": "^1.6.51", - "copy-webpack-plugin": "^7.0.0", - "cypress": "^14.2.0", - "cypress-parallel": "^0.14.0", - "dprint": "^0.33.0", - "fs-extra": "^10.1.0", - "jsdoc-to-markdown": "^7.1.1", - "mocha": "^9.2.0", - "rimraf": "^6.0.1", - "ts-mocha": "^9.0.2", - "ts-node": "^10.9.2", - "tsconfig-paths": "^4.1.0", - "txm": "^8.1.0", - "typedoc": "^0.27.6", - "typedoc-plugin-markdown": "^4.4.1", - "typescript": "^5.7.3", - "wasm-opt": "^1.3.0" + "engines": { + "node": ">=20" + } + }, + "../../node_modules/@iota/iota-sdk/node_modules/tweetnacl": { + "version": "1.0.3", + "license": "Unlicense", + "peer": true + }, + "../../node_modules/@isaacs/cliui": { + "version": "8.0.2", + "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", + "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", + "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", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "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", + "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", + "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.8", + "dev": true, + "license": "MIT", + "peer": true, + "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/gen-mapping/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "../../node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "../../node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "../../node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "../../node_modules/@jridgewell/source-map/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "../../node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "../../node_modules/@noble/curves": { + "version": "1.9.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "../../node_modules/@noble/ed25519": { + "version": "1.7.3", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "../../node_modules/@noble/hashes": { + "version": "1.8.0", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "../../node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/@scure/base": { + "version": "1.2.5", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "../../node_modules/@scure/bip32": { + "version": "1.7.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "~1.9.0", + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "../../node_modules/@scure/bip39": { + "version": "1.6.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "../../node_modules/@shikijs/engine-oniguruma": { + "version": "1.27.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.27.2", + "@shikijs/vscode-textmate": "^10.0.1" + } + }, + "../../node_modules/@shikijs/types": { + "version": "1.27.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.1", + "@types/hast": "^3.0.4" + } + }, + "../../node_modules/@shikijs/vscode-textmate": { + "version": "10.0.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@sideway/address": { + "version": "4.1.5", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "../../node_modules/@sideway/formula": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause" + }, + "../../node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "dev": true, + "license": "BSD-3-Clause" + }, + "../../node_modules/@suchipi/femver": { + "version": "1.0.0", + "license": "MIT", + "peer": true + }, + "../../node_modules/@tsconfig/node10": { + "version": "1.0.9", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@tsconfig/node12": { + "version": "1.0.11", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@tsconfig/node14": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@tsconfig/node16": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/debug": { + "version": "4.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "../../node_modules/@types/eslint": { + "version": "9.6.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "../../node_modules/@types/eslint-scope": { + "version": "3.7.7", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "../../node_modules/@types/estree": { + "version": "1.0.6", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/@types/hast": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "../../node_modules/@types/json-schema": { + "version": "7.0.11", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/json5": { + "version": "0.0.29", + "dev": true, + "license": "MIT", + "optional": true + }, + "../../node_modules/@types/jsonwebtoken": { + "version": "9.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "../../node_modules/@types/linkify-it": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/markdown-it": { + "version": "12.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "../../node_modules/@types/mdast": { + "version": "3.0.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "../../node_modules/@types/mdurl": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/mocha": { + "version": "9.1.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/ms": { + "version": "0.7.31", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/node": { + "version": "22.10.5", + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "../../node_modules/@types/node-fetch": { + "version": "2.6.2", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "../../node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/sizzle": { + "version": "2.3.8", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/unist": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "../../node_modules/@types/yauzl": { + "version": "2.10.3", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "../../node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "dev": true, + "license": "ISC" + }, + "../../node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + } + }, + "../../node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" + } + }, + "../../node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" + } + }, + "../../node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "../../node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "../../node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" + } + }, + "../../node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "../../node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" + } + }, + "../../node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "../../node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" + } + }, + "../../node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "../../node_modules/@xtuc/long": { + "version": "4.2.2", + "dev": true, + "license": "Apache-2.0", + "peer": true + }, + "../../node_modules/acorn": { + "version": "8.14.0", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "../../node_modules/acorn-walk": { + "version": "8.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "../../node_modules/aggregate-error": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/ajv": { + "version": "6.12.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "../../node_modules/ajv-formats": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "../../node_modules/ajv-formats/node_modules/ajv": { + "version": "8.17.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "../../node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/ajv-keywords": { + "version": "3.5.2", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "../../node_modules/ansi-colors": { + "version": "4.1.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/ansi-escape-sequences": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "../../node_modules/ansi-escape-sequences/node_modules/array-back": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../../node_modules/anymatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/arch": { + "version": "2.2.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "../../node_modules/arg": { + "version": "4.1.3", + "dev": true, + "license": "MIT" + }, + "../../node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "../../node_modules/array-back": { + "version": "6.2.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, + "../../node_modules/array-union": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/arrify": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/asn1": { + "version": "0.2.6", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "../../node_modules/assert-plus": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "../../node_modules/astral-regex": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/async": { + "version": "3.2.4", + "dev": true, + "license": "MIT" + }, + "../../node_modules/asynckit": { + "version": "0.4.0", + "license": "MIT" + }, + "../../node_modules/at-least-node": { + "version": "1.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, + "../../node_modules/aws-sign2": { + "version": "0.7.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "../../node_modules/aws4": { + "version": "1.13.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/axios": { + "version": "1.8.4", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "../../node_modules/axios/node_modules/form-data": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "../../node_modules/axios/node_modules/proxy-from-env": { + "version": "1.1.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/bail": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../../node_modules/balanced-match": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/base-x": { + "version": "5.0.1", + "license": "MIT", + "peer": true + }, + "../../node_modules/base64-arraybuffer": { + "version": "1.0.2", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "../../node_modules/base64-js": { + "version": "1.5.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "../../node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "../../node_modules/bech32": { + "version": "2.0.0", + "license": "MIT", + "peer": true + }, + "../../node_modules/big-integer": { + "version": "1.6.51", + "dev": true, + "license": "Unlicense", + "engines": { + "node": ">=0.6" + } + }, + "../../node_modules/big.js": { + "version": "5.2.2", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "../../node_modules/binary-extensions": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/blob-util": { + "version": "2.0.2", + "dev": true, + "license": "Apache-2.0" + }, + "../../node_modules/bluebird": { + "version": "3.7.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "../../node_modules/braces": { + "version": "3.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/browser-stdout": { + "version": "1.3.1", + "dev": true, + "license": "ISC" + }, + "../../node_modules/browserslist": { + "version": "4.24.4", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "../../node_modules/bs58": { + "version": "6.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "base-x": "^5.0.0" + } + }, + "../../node_modules/buffer": { + "version": "5.7.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "../../node_modules/buffer-crc32": { + "version": "0.2.13", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "../../node_modules/buffer-from": { + "version": "1.1.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/cache-point": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^4.0.1", + "fs-then-native": "^2.0.0", + "mkdirp2": "^1.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/cache-point/node_modules/array-back": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/cachedir": { + "version": "2.4.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/call-bound": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/caniuse-lite": { + "version": "1.0.30001692", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0", + "peer": true + }, + "../../node_modules/caseless": { + "version": "0.12.0", + "dev": true, + "license": "Apache-2.0" + }, + "../../node_modules/catharsis": { + "version": "0.9.0", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.15" + }, + "engines": { + "node": ">= 10" + } + }, + "../../node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../../node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/character-entities": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../../node_modules/check-more-types": { + "version": "2.24.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "../../node_modules/chokidar": { + "version": "3.5.3", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "../../node_modules/chownr": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "../../node_modules/chrome-trace-event": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0" + } + }, + "../../node_modules/ci-info": { + "version": "4.2.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/clean-stack": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/cli-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/cli-table3": { + "version": "0.6.5", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "../../node_modules/cli-truncate": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/cliui": { + "version": "7.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "../../node_modules/collect-all": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "stream-connect": "^1.0.2", + "stream-via": "^1.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "../../node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "../../node_modules/colorette": { + "version": "2.0.20", + "dev": true, + "license": "MIT" + }, + "../../node_modules/combined-stream": { + "version": "1.0.8", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "../../node_modules/command-line-args": { + "version": "5.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/command-line-args/node_modules/array-back": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/command-line-args/node_modules/typical": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/command-line-tool": { + "version": "0.8.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escape-sequences": "^4.0.0", + "array-back": "^2.0.0", + "command-line-args": "^5.0.0", + "command-line-usage": "^4.1.0", + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/command-line-tool/node_modules/array-back": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, + "../../node_modules/command-line-usage": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escape-sequences": "^4.0.0", + "array-back": "^2.0.0", + "table-layout": "^0.4.2", + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/command-line-usage/node_modules/array-back": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, + "../../node_modules/commander": { + "version": "6.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "../../node_modules/common-sequence": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/common-tags": { + "version": "1.8.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/concat-map": { + "version": "0.0.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/config-master": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "walk-back": "^2.0.1" + } + }, + "../../node_modules/config-master/node_modules/walk-back": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/copy-webpack-plugin": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.2.4", + "glob-parent": "^5.1.1", + "globby": "^11.0.1", + "loader-utils": "^2.0.0", + "normalize-path": "^3.0.0", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "../../node_modules/core-util-is": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/create-require": { + "version": "1.1.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/cross-spawn": { + "version": "7.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/cypress": { + "version": "14.2.0", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@cypress/request": "^3.0.7", + "@cypress/xvfb": "^1.2.4", + "@types/sinonjs__fake-timers": "8.1.1", + "@types/sizzle": "^2.3.2", + "arch": "^2.2.0", + "blob-util": "^2.0.2", + "bluebird": "^3.7.2", + "buffer": "^5.7.1", + "cachedir": "^2.3.0", + "chalk": "^4.1.0", + "check-more-types": "^2.24.0", + "ci-info": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-table3": "~0.6.5", + "commander": "^6.2.1", + "common-tags": "^1.8.0", + "dayjs": "^1.10.4", + "debug": "^4.3.4", + "enquirer": "^2.3.6", + "eventemitter2": "6.4.7", + "execa": "4.1.0", + "executable": "^4.1.1", + "extract-zip": "2.0.1", + "figures": "^3.2.0", + "fs-extra": "^9.1.0", + "getos": "^3.2.1", + "is-installed-globally": "~0.4.0", + "lazy-ass": "^1.6.0", + "listr2": "^3.8.3", + "lodash": "^4.17.21", + "log-symbols": "^4.0.0", + "minimist": "^1.2.8", + "ospath": "^1.2.2", + "pretty-bytes": "^5.6.0", + "process": "^0.11.10", + "proxy-from-env": "1.0.0", + "request-progress": "^3.0.0", + "semver": "^7.5.3", + "supports-color": "^8.1.1", + "tmp": "~0.2.3", + "tree-kill": "1.2.2", + "untildify": "^4.0.0", + "yauzl": "^2.10.0" + }, + "bin": { + "cypress": "bin/cypress" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + } + }, + "../../node_modules/cypress/node_modules/fs-extra": { + "version": "9.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/dashdash": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "../../node_modules/dayjs": { + "version": "1.11.11", + "dev": true, + "license": "MIT" + }, + "../../node_modules/debug": { + "version": "4.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "../../node_modules/decamelize": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/decode-named-character-reference": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../../node_modules/deep-extend": { + "version": "0.6.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/delayed-stream": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "../../node_modules/dequal": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/diff": { + "version": "5.0.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "../../node_modules/diff-match-patch": { + "version": "1.0.5", + "dev": true, + "license": "Apache-2.0" + }, + "../../node_modules/dir-glob": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/dmd": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "cache-point": "^2.0.0", + "common-sequence": "^2.0.2", + "file-set": "^4.0.2", + "handlebars": "^4.7.7", + "marked": "^4.0.12", + "object-get": "^2.1.1", + "reduce-flatten": "^3.0.1", + "reduce-unique": "^2.0.1", + "reduce-without": "^1.0.1", + "test-value": "^3.0.0", + "walk-back": "^5.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "../../node_modules/dprint": { + "version": "0.33.0", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "yauzl": "=2.10.0" + }, + "bin": { + "dprint": "bin.js" + } + }, + "../../node_modules/dunder-proto": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/duplexer": { + "version": "0.1.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/eastasianwidth": { + "version": "0.2.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/ecc-jsbn": { + "version": "0.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "../../node_modules/electron-to-chromium": { + "version": "1.5.80", + "dev": true, + "license": "ISC", + "peer": true + }, + "../../node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/emojis-list": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "../../node_modules/end-of-stream": { + "version": "1.4.4", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "../../node_modules/enhanced-resolve": { + "version": "5.18.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "../../node_modules/enquirer": { + "version": "2.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "../../node_modules/entities": { + "version": "2.1.0", + "dev": true, + "license": "BSD-2-Clause", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "../../node_modules/es-define-property": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/es-errors": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/es-module-lexer": { + "version": "1.6.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/es-object-atoms": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/es-set-tostringtag": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/escalade": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/escape-string-regexp": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "../../node_modules/eslint-scope": { + "version": "5.1.1", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "../../node_modules/esrecurse": { + "version": "4.3.0", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "../../node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "../../node_modules/estraverse": { + "version": "4.3.0", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "../../node_modules/event-stream": { + "version": "3.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", + "pause-stream": "0.0.11", + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" + } + }, + "../../node_modules/eventemitter2": { + "version": "6.4.7", + "dev": true, + "license": "MIT" + }, + "../../node_modules/events": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.x" + } + }, + "../../node_modules/execa": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "../../node_modules/executable": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "../../node_modules/extend": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/extract-zip": { + "version": "2.0.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "../../node_modules/extsprintf": { + "version": "1.3.0", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "../../node_modules/fast-deep-equal": { + "version": "3.1.3", + "dev": true, + "license": "MIT" + }, + "../../node_modules/fast-glob": { + "version": "3.2.12", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "../../node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/fast-uri": { + "version": "3.0.5", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause", + "peer": true + }, + "../../node_modules/fastq": { + "version": "1.13.0", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "../../node_modules/fd-slicer": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "../../node_modules/figures": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/file-set": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^5.0.0", + "glob": "^7.1.6" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/file-set/node_modules/array-back": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "../../node_modules/fill-range": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/find-replace": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/find-replace/node_modules/array-back": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/find-up": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/flat": { + "version": "5.0.2", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "../../node_modules/follow-redirects": { + "version": "1.15.9", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "../../node_modules/foreground-child": { + "version": "3.3.1", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/forever-agent": { + "version": "0.6.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "../../node_modules/form-data": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "../../node_modules/from": { + "version": "0.1.7", + "dev": true, + "license": "MIT" + }, + "../../node_modules/fs-extra": { + "version": "10.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../../node_modules/fs-minipass": { + "version": "2.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/fs-then-native": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/fs.realpath": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "../../node_modules/function-bind": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/get-caller-file": { + "version": "2.0.5", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "../../node_modules/get-intrinsic": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/get-proto": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/get-stream": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/getos": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "async": "^3.2.0" + } + }, + "../../node_modules/getpass": { + "version": "0.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "../../node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/glob-parent": { + "version": "5.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "../../node_modules/glob-to-regexp": { + "version": "0.4.1", + "dev": true, + "license": "BSD-2-Clause", + "peer": true + }, + "../../node_modules/global-dirs": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/globby": { + "version": "11.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/gopd": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/gql.tada": { + "version": "1.8.10", + "license": "MIT", + "peer": true, + "dependencies": { + "@0no-co/graphql.web": "^1.0.5", + "@0no-co/graphqlsp": "^1.12.13", + "@gql.tada/cli-utils": "1.6.3", + "@gql.tada/internal": "1.0.8" + }, + "bin": { + "gql-tada": "bin/cli.js", + "gql.tada": "bin/cli.js" + }, + "peerDependencies": { + "typescript": "^5.0.0" + } + }, + "../../node_modules/graceful-fs": { + "version": "4.2.11", + "dev": true, + "license": "ISC" + }, + "../../node_modules/graphql": { + "version": "16.11.0", + "license": "MIT", + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, + "../../node_modules/growl": { + "version": "1.10.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.x" + } + }, + "../../node_modules/handlebars": { + "version": "4.7.7", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "../../node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/has-symbols": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/has-tostringtag": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/hasown": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/he": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "../../node_modules/http-signature": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^2.0.2", + "sshpk": "^1.18.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "../../node_modules/human-signals": { + "version": "1.1.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8.12.0" + } + }, + "../../node_modules/ieee754": { + "version": "1.2.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "../../node_modules/ignore": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "../../node_modules/indent-string": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/inflight": { + "version": "1.0.6", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "../../node_modules/inherits": { + "version": "2.0.4", + "dev": true, + "license": "ISC" + }, + "../../node_modules/ini": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "../../node_modules/is-binary-path": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/is-buffer": { + "version": "2.0.5", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../../node_modules/is-extglob": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/is-glob": { + "version": "4.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/is-installed-globally": { + "version": "0.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/is-number": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "../../node_modules/is-path-inside": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/is-plain-obj": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/is-stream": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/is-typedarray": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/is-unicode-supported": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "../../node_modules/isstream": { + "version": "0.1.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/jackspeak": { + "version": "4.1.0", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/jest-worker": { + "version": "27.5.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "../../node_modules/joi": { + "version": "17.13.3", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.3.0", + "@hapi/topo": "^5.1.0", + "@sideway/address": "^4.1.5", + "@sideway/formula": "^3.0.1", + "@sideway/pinpoint": "^2.0.0" + } + }, + "../../node_modules/jose": { + "version": "5.9.6", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "../../node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "../../node_modules/js2xmlparser": { + "version": "4.0.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "xmlcreate": "^2.0.4" + } + }, + "../../node_modules/jsbn": { + "version": "0.1.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/jsdoc": { + "version": "3.6.11", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/parser": "^7.9.4", + "@types/markdown-it": "^12.2.3", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.2", + "klaw": "^3.0.0", + "markdown-it": "^12.3.2", + "markdown-it-anchor": "^8.4.1", + "marked": "^4.0.10", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.2" + }, + "bin": { + "jsdoc": "jsdoc.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "../../node_modules/jsdoc-api": { + "version": "7.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "cache-point": "^2.0.0", + "collect-all": "^1.0.4", + "file-set": "^4.0.2", + "fs-then-native": "^2.0.0", + "jsdoc": "^3.6.10", + "object-to-spawn-args": "^2.0.1", + "temp-path": "^1.0.0", + "walk-back": "^5.1.0" + }, + "engines": { + "node": ">=12.17" + } + }, + "../../node_modules/jsdoc-parse": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "lodash.omit": "^4.5.0", + "lodash.pick": "^4.4.0", + "reduce-extract": "^1.0.0", + "sort-array": "^4.1.4", + "test-value": "^3.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../../node_modules/jsdoc-to-markdown": { + "version": "7.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "command-line-tool": "^0.8.0", + "config-master": "^3.1.0", + "dmd": "^6.1.0", + "jsdoc-api": "^7.1.1", + "jsdoc-parse": "^6.1.0", + "walk-back": "^5.1.0" + }, + "bin": { + "jsdoc2md": "bin/cli.js" + }, + "engines": { + "node": ">=12.17" + } + }, + "../../node_modules/jsdoc/node_modules/escape-string-regexp": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/json-schema": { + "version": "0.4.0", + "dev": true, + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "../../node_modules/json-schema-traverse": { + "version": "0.4.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/json-stringify-safe": { + "version": "5.0.1", + "dev": true, + "license": "ISC" + }, + "../../node_modules/json5": { + "version": "2.2.3", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "../../node_modules/jsonfile": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "../../node_modules/jsprim": { + "version": "2.0.2", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "../../node_modules/klaw": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.9" + } + }, + "../../node_modules/kleur": { + "version": "4.1.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/lazy-ass": { + "version": "1.6.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "> 0.8" + } + }, + "../../node_modules/linkify-it": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "../../node_modules/listr2": { + "version": "3.14.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^2.1.0", + "colorette": "^2.0.16", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rfdc": "^1.3.0", + "rxjs": "^7.5.1", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + }, + "peerDependenciesMeta": { + "enquirer": { + "optional": true + } + } + }, + "../../node_modules/loader-runner": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.11.5" + } + }, + "../../node_modules/loader-utils": { + "version": "2.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "../../node_modules/locate-path": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/lodash": { + "version": "4.17.21", + "dev": true, + "license": "MIT" + }, + "../../node_modules/lodash.camelcase": { + "version": "4.3.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/lodash.omit": { + "version": "4.5.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/lodash.once": { + "version": "4.1.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/lodash.padend": { + "version": "4.6.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/lodash.pick": { + "version": "4.4.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/log-symbols": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/log-update": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "../../node_modules/log-update/node_modules/wrap-ansi": { + "version": "6.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/lunr": { + "version": "2.3.9", + "dev": true, + "license": "MIT" + }, + "../../node_modules/make-error": { + "version": "1.3.6", + "dev": true, + "license": "ISC" + }, + "../../node_modules/map-stream": { + "version": "0.1.0", + "dev": true + }, + "../../node_modules/markdown-it": { + "version": "12.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "../../node_modules/markdown-it-anchor": { + "version": "8.6.5", + "dev": true, + "license": "Unlicense", + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, + "../../node_modules/marked": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "../../node_modules/math-intrinsics": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "../../node_modules/mdast-util-from-markdown": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "mdast-util-to-string": "^3.1.0", + "micromark": "^3.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-decode-string": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "unist-util-stringify-position": "^3.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../../node_modules/mdast-util-to-string": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../../node_modules/mdurl": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/merge-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/merge2": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/micromark": { + "version": "3.0.10", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "micromark-core-commonmark": "^1.0.1", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "../../node_modules/micromark-core-commonmark": { + "version": "1.0.6", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-factory-destination": "^1.0.0", + "micromark-factory-label": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-factory-title": "^1.0.0", + "micromark-factory-whitespace": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-html-tag-name": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "../../node_modules/micromark-factory-destination": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "../../node_modules/micromark-factory-label": { + "version": "1.0.2", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "../../node_modules/micromark-factory-space": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "../../node_modules/micromark-factory-title": { + "version": "1.0.2", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "../../node_modules/micromark-factory-whitespace": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "../../node_modules/micromark-util-character": { + "version": "1.1.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "../../node_modules/micromark-util-chunked": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "../../node_modules/micromark-util-classify-character": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "../../node_modules/micromark-util-combine-extensions": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "../../node_modules/micromark-util-decode-numeric-character-reference": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "../../node_modules/micromark-util-decode-string": { + "version": "1.0.2", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "../../node_modules/micromark-util-encode": { + "version": "1.0.1", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "../../node_modules/micromark-util-html-tag-name": { + "version": "1.1.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "../../node_modules/micromark-util-normalize-identifier": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "../../node_modules/micromark-util-resolve-all": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^1.0.0" + } + }, + "../../node_modules/micromark-util-sanitize-uri": { + "version": "1.0.0", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "../../node_modules/micromark-util-subtokenize": { + "version": "1.0.2", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "../../node_modules/micromark-util-symbol": { + "version": "1.0.1", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "../../node_modules/micromark-util-types": { + "version": "1.0.2", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "../../node_modules/micromatch": { + "version": "4.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "../../node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "../../node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "../../node_modules/mimic-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../../node_modules/minimist": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/minipass": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/minizlib": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "../../node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/mkdirp": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/mkdirp2": { + "version": "1.0.5", + "dev": true, + "license": "MIT" + }, + "../../node_modules/mocha": { + "version": "9.2.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "../../node_modules/mocha/node_modules/ansi-colors": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/mocha/node_modules/debug": { + "version": "4.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "../../node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../../node_modules/mocha/node_modules/minimatch": { + "version": "4.2.1", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/mocha/node_modules/serialize-javascript": { + "version": "6.0.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "../../node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/mri": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../../node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "../../node_modules/nanoid": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "../../node_modules/neo-async": { + "version": "2.6.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/node-fetch": { + "version": "2.7.0", + "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/node-releases": { + "version": "2.0.19", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/normalize-path": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/npm-run-path": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/object-get": { + "version": "2.1.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/object-inspect": { + "version": "1.13.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/object-to-spawn-args": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "../../node_modules/once": { + "version": "1.4.0", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "../../node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/ospath": { + "version": "1.2.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/p-limit": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/p-locate": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/p-map": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/package-json-from-dist": { + "version": "1.0.1", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "../../node_modules/path-exists": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/path-is-absolute": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/path-scurry": { + "version": "2.0.0", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.0.2", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "../../node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "../../node_modules/path-type": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/pause-stream": { + "version": "0.0.11", + "dev": true, + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" + } + }, + "../../node_modules/pend": { + "version": "1.2.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/performance-now": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/picocolors": { + "version": "1.1.1", + "dev": true, + "license": "ISC", + "peer": true + }, + "../../node_modules/picomatch": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "../../node_modules/pify": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/pretty-bytes": { + "version": "5.6.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/process": { + "version": "0.11.10", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "../../node_modules/proxy-from-env": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/ps-tree": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "event-stream": "=3.3.4" + }, + "bin": { + "ps-tree": "bin/ps-tree.js" + }, + "engines": { + "node": ">= 0.10" + } + }, + "../../node_modules/pump": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "../../node_modules/punycode": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/punycode.js": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/qs": { + "version": "6.14.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/queue-microtask": { + "version": "1.2.3", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "../../node_modules/randombytes": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "../../node_modules/readdirp": { + "version": "3.6.0", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "../../node_modules/reduce-extract": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "test-value": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/reduce-extract/node_modules/array-back": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "../../node_modules/reduce-extract/node_modules/test-value": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^1.0.2", + "typical": "^2.4.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/reduce-flatten": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/reduce-unique": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/reduce-without": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "test-value": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/reduce-without/node_modules/array-back": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "../../node_modules/reduce-without/node_modules/test-value": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^1.0.3", + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/remark-parse": { + "version": "10.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../../node_modules/request-progress": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "throttleit": "^1.0.0" + } + }, + "../../node_modules/require-directory": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/require-from-string": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/requizzle": { + "version": "0.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "../../node_modules/restore-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/reusify": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "../../node_modules/rfdc": { + "version": "1.4.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/rimraf": { + "version": "6.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/rimraf/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "../../node_modules/rimraf/node_modules/glob": { + "version": "11.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/rimraf/node_modules/minimatch": { + "version": "10.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../../node_modules/rimraf/node_modules/minipass": { + "version": "7.1.2", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "../../node_modules/run-parallel": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "../../node_modules/rxjs": { + "version": "7.8.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "../../node_modules/sade": { + "version": "1.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "../../node_modules/safe-buffer": { + "version": "5.2.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "../../node_modules/safer-buffer": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/schema-utils": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "../../node_modules/semver": { + "version": "7.5.4", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/serialize-javascript": { + "version": "5.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "../../node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/side-channel": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/side-channel-list": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/side-channel-map": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/side-channel-weakmap": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../../node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC" + }, + "../../node_modules/slash": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../../node_modules/slice-ansi": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/sort-array": { + "version": "4.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^5.0.0", + "typical": "^6.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/sort-array/node_modules/array-back": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "../../node_modules/sort-array/node_modules/typical": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "../../node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/source-map-support": { + "version": "0.5.21", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "../../node_modules/split": { + "version": "0.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "../../node_modules/sshpk": { + "version": "1.18.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/start-server-and-test": { + "version": "2.0.11", + "dev": true, + "license": "MIT", + "dependencies": { + "arg": "^5.0.2", + "bluebird": "3.7.2", + "check-more-types": "2.24.0", + "debug": "4.4.0", + "execa": "5.1.1", + "lazy-ass": "1.6.0", + "ps-tree": "1.2.0", + "wait-on": "8.0.3" + }, + "bin": { + "server-test": "src/bin/start.js", + "start-server-and-test": "src/bin/start.js", + "start-test": "src/bin/start.js" + }, + "engines": { + "node": ">=16" + } + }, + "../../node_modules/start-server-and-test/node_modules/arg": { + "version": "5.0.2", + "dev": true, + "license": "MIT" + }, + "../../node_modules/start-server-and-test/node_modules/execa": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "../../node_modules/start-server-and-test/node_modules/get-stream": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/start-server-and-test/node_modules/human-signals": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "../../node_modules/stream-combiner": { + "version": "0.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1" + } + }, + "../../node_modules/stream-connect": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/stream-connect/node_modules/array-back": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "typical": "^2.6.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "../../node_modules/stream-via": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/string-width": { + "version": "4.2.3", + "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-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "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/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../../node_modules/strip-bom": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../../node_modules/strip-final-newline": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../../node_modules/strip-json-comments": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "../../node_modules/table-layout": { + "version": "0.4.5", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^2.0.0", + "deep-extend": "~0.6.0", + "lodash.padend": "^4.6.1", + "typical": "^2.6.1", + "wordwrapjs": "^3.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/table-layout/node_modules/array-back": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, + "../../node_modules/taffydb": { + "version": "2.6.2", + "dev": true + }, + "../../node_modules/tapable": { + "version": "2.2.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../../node_modules/tar": { + "version": "6.2.1", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/temp-path": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/terser": { + "version": "5.37.0", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "../../node_modules/terser-webpack-plugin": { + "version": "5.3.11", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "jest-worker": "^27.4.5", + "schema-utils": "^4.3.0", + "serialize-javascript": "^6.0.2", + "terser": "^5.31.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "../../node_modules/terser-webpack-plugin/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "../../node_modules/terser-webpack-plugin/node_modules/ajv": { + "version": "8.17.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "../../node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "../../node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "../../node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { + "version": "6.0.2", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "../../node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "dev": true, + "license": "MIT", + "peer": true + }, + "../../node_modules/test-value": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^2.0.0", + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../../node_modules/test-value/node_modules/array-back": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "typical": "^2.6.1" + }, + "engines": { + "node": ">=4" + } + }, + "../../node_modules/throttleit": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/through": { + "version": "2.3.8", + "dev": true, + "license": "MIT" + }, + "../../node_modules/tldts": { + "version": "6.1.84", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.84" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "../../node_modules/tldts-core": { + "version": "6.1.84", + "dev": true, + "license": "MIT" + }, + "../../node_modules/tmp": { + "version": "0.2.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, + "../../node_modules/to-regex-range": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "../../node_modules/tough-cookie": { + "version": "5.1.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "../../node_modules/tr46": { + "version": "0.0.3", + "license": "MIT" + }, + "../../node_modules/tree-kill": { + "version": "1.2.2", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "../../node_modules/trough": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../../node_modules/ts-mocha": { + "version": "9.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ts-node": "7.0.1" + }, + "bin": { + "ts-mocha": "bin/ts-mocha" + }, + "engines": { + "node": ">= 6.X.X" + }, + "optionalDependencies": { + "tsconfig-paths": "^3.5.0" + }, + "peerDependencies": { + "mocha": "^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X" + } + }, + "../../node_modules/ts-mocha/node_modules/diff": { + "version": "3.5.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "../../node_modules/ts-mocha/node_modules/json5": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "../../node_modules/ts-mocha/node_modules/mkdirp": { + "version": "0.5.6", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "../../node_modules/ts-mocha/node_modules/ts-node": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "arrify": "^1.0.0", + "buffer-from": "^1.1.0", + "diff": "^3.1.0", + "make-error": "^1.1.1", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "source-map-support": "^0.5.6", + "yn": "^2.0.0" + }, + "bin": { + "ts-node": "dist/bin.js" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "../../node_modules/ts-mocha/node_modules/tsconfig-paths": { + "version": "3.14.1", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "../../node_modules/ts-mocha/node_modules/yn": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../../node_modules/ts-node": { + "version": "10.9.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "../../node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "../../node_modules/tsconfig-paths": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "json5": "^2.2.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "../../node_modules/tslib": { + "version": "2.4.0", + "dev": true, + "license": "0BSD" + }, + "../../node_modules/tunnel-agent": { + "version": "0.6.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "../../node_modules/tweetnacl": { + "version": "0.14.5", + "dev": true, + "license": "Unlicense" + }, + "../../node_modules/txm": { + "version": "8.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "async": "^3.2.1", + "diff-match-patch": "^1.0.5", + "kleur": "^4.1.4", + "remark-parse": "^10.0.1", + "supports-color": "^9.1.0", + "unified": "^10.1.1" + }, + "bin": { + "txm": "src/cli.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../../node_modules/txm/node_modules/supports-color": { + "version": "9.2.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "../../node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/typedoc": { + "version": "0.27.6", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@gerrit0/mini-shiki": "^1.24.0", + "lunr": "^2.3.9", + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "yaml": "^2.6.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" + } + }, + "../../node_modules/typedoc-plugin-markdown": { + "version": "4.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typedoc": "0.27.x" + } + }, + "../../node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "../../node_modules/typedoc/node_modules/entities": { + "version": "4.5.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "../../node_modules/typedoc/node_modules/linkify-it": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "../../node_modules/typedoc/node_modules/markdown-it": { + "version": "14.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "../../node_modules/typedoc/node_modules/mdurl": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.5", + "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/typedoc/node_modules/uc.micro": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "../../node_modules/typescript": { + "version": "5.7.3", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "../../node_modules/typical": { + "version": "2.6.1", + "dev": true, + "license": "MIT" + }, + "../../node_modules/uc.micro": { + "version": "1.0.6", + "dev": true, + "license": "MIT" + }, + "../../node_modules/uglify-js": { + "version": "3.17.1", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" }, "engines": { - "node": ">=20" - }, - "peerDependencies": { - "@iota/iota-sdk": "^0.5.0" + "node": ">=0.8.0" } }, - "node_modules/@0no-co/graphql.web": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@0no-co/graphql.web/-/graphql.web-1.1.2.tgz", - "integrity": "sha512-N2NGsU5FLBhT8NZ+3l2YrzZSHITjNXNuDhC4iDiikv0IujaJ0Xc6xIxQZ/Ek3Cb+rgPjnLHYyJm11tInuJn+cw==", - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" + "../../node_modules/underscore": { + "version": "1.13.4", + "dev": true, + "license": "MIT" + }, + "../../node_modules/undici-types": { + "version": "6.20.0", + "license": "MIT" + }, + "../../node_modules/unified": { + "version": "10.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, - "peerDependenciesMeta": { - "graphql": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@0no-co/graphqlsp": { - "version": "1.12.16", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.16.tgz", - "integrity": "sha512-B5pyYVH93Etv7xjT6IfB7QtMBdaaC07yjbhN6v8H7KgFStMkPvi+oWYBTibMFRMY89qwc9H8YixXg8SXDVgYWw==", + "../../node_modules/unist-util-stringify-position": { + "version": "3.0.2", + "dev": true, + "license": "MIT", "dependencies": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" + "@types/unist": "^2.0.0" }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", - "integrity": "sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==", - "cpu": [ - "ppc64" - ], + "../../node_modules/universalify": { + "version": "2.0.0", "dev": true, - "optional": true, - "os": [ - "aix" - ], + "license": "MIT", "engines": { - "node": ">=18" + "node": ">= 10.0.0" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.1.tgz", - "integrity": "sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==", - "cpu": [ - "arm" - ], + "../../node_modules/untildify": { + "version": "4.0.0", "dev": true, - "optional": true, - "os": [ - "android" - ], + "license": "MIT", "engines": { - "node": ">=18" + "node": ">=8" } }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.1.tgz", - "integrity": "sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==", - "cpu": [ - "arm64" - ], + "../../node_modules/update-browserslist-db": { + "version": "1.1.2", "dev": true, - "optional": true, - "os": [ - "android" + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } ], - "engines": { - "node": ">=18" + "license": "MIT", + "peer": true, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" } }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.1.tgz", - "integrity": "sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==", - "cpu": [ - "x64" - ], + "../../node_modules/uri-js": { + "version": "4.4.1", "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" } }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.1.tgz", - "integrity": "sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==", - "cpu": [ - "arm64" - ], + "../../node_modules/uuid": { + "version": "8.3.2", "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.1.tgz", - "integrity": "sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==", - "cpu": [ - "x64" - ], + "../../node_modules/uvu": { + "version": "0.5.6", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0", + "diff": "^5.0.0", + "kleur": "^4.0.3", + "sade": "^1.7.3" + }, + "bin": { + "uvu": "bin.js" + }, "engines": { - "node": ">=18" + "node": ">=8" } }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.1.tgz", - "integrity": "sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==", - "cpu": [ - "arm64" - ], + "../../node_modules/v8-compile-cache-lib": { + "version": "3.0.1", "dev": true, - "optional": true, - "os": [ - "freebsd" + "license": "MIT" + }, + "../../node_modules/valibot": { + "version": "0.36.0", + "license": "MIT", + "peer": true + }, + "../../node_modules/verror": { + "version": "1.10.0", + "dev": true, + "engines": [ + "node >=0.6.0" ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "../../node_modules/vfile": { + "version": "5.3.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../../node_modules/vfile-message": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../../node_modules/wait-on": { + "version": "8.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "axios": "^1.8.2", + "joi": "^17.13.3", + "lodash": "^4.17.21", + "minimist": "^1.2.8", + "rxjs": "^7.8.2" + }, + "bin": { + "wait-on": "bin/wait-on" + }, "engines": { - "node": ">=18" + "node": ">=12.0.0" } }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.1.tgz", - "integrity": "sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==", - "cpu": [ - "x64" - ], + "../../node_modules/walk-back": { + "version": "5.1.0", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "license": "MIT", "engines": { - "node": ">=18" + "node": ">=12.17" } }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.1.tgz", - "integrity": "sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==", - "cpu": [ - "arm" - ], + "../../node_modules/wasm-opt": { + "version": "1.4.0", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.9", + "tar": "^6.1.13" + }, + "bin": { + "wasm-opt": "bin/wasm-opt.js" + } + }, + "../../node_modules/watchpack": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, "engines": { - "node": ">=18" + "node": ">=10.13.0" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.1.tgz", - "integrity": "sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==", - "cpu": [ - "arm64" - ], + "../../node_modules/webidl-conversions": { + "version": "3.0.1", + "license": "BSD-2-Clause" + }, + "../../node_modules/webpack": { + "version": "5.97.1", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "MIT", + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, "engines": { - "node": ">=18" + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } } }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.1.tgz", - "integrity": "sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==", - "cpu": [ - "ia32" - ], + "../../node_modules/webpack-sources": { + "version": "3.2.3", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "MIT", + "peer": true, "engines": { - "node": ">=18" + "node": ">=10.13.0" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.1.tgz", - "integrity": "sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==", - "cpu": [ - "loong64" - ], + "../../node_modules/whatwg-url": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "../../node_modules/which": { + "version": "2.0.2", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, "engines": { - "node": ">=18" + "node": ">= 8" } }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.1.tgz", - "integrity": "sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==", - "cpu": [ - "mips64el" - ], + "../../node_modules/wordwrap": { + "version": "1.0.0", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "MIT" + }, + "../../node_modules/wordwrapjs": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "reduce-flatten": "^1.0.1", + "typical": "^2.6.1" + }, "engines": { - "node": ">=18" + "node": ">=4.0.0" } }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.1.tgz", - "integrity": "sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==", - "cpu": [ - "ppc64" - ], + "../../node_modules/wordwrapjs/node_modules/reduce-flatten": { + "version": "1.0.1", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "MIT", "engines": { - "node": ">=18" + "node": ">=0.10.0" } }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.1.tgz", - "integrity": "sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==", - "cpu": [ - "riscv64" - ], + "../../node_modules/workerpool": { + "version": "6.2.0", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "Apache-2.0" + }, + "../../node_modules/wrap-ansi": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.1.tgz", - "integrity": "sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==", - "cpu": [ - "s390x" - ], + "../../node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.1.tgz", - "integrity": "sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==", - "cpu": [ - "x64" - ], + "../../node_modules/wrappy": { + "version": "1.0.2", + "dev": true, + "license": "ISC" + }, + "../../node_modules/xmlcreate": { + "version": "2.0.4", + "dev": true, + "license": "Apache-2.0" + }, + "../../node_modules/y18n": { + "version": "5.0.8", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "license": "ISC", "engines": { - "node": ">=18" + "node": ">=10" } }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.1.tgz", - "integrity": "sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==", - "cpu": [ - "arm64" - ], + "../../node_modules/yallist": { + "version": "4.0.0", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], + "license": "ISC" + }, + "../../node_modules/yaml": { + "version": "2.7.0", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, "engines": { - "node": ">=18" + "node": ">= 14" } }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.1.tgz", - "integrity": "sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==", - "cpu": [ - "x64" - ], + "../../node_modules/yargs-parser": { + "version": "20.2.4", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], + "license": "ISC", "engines": { - "node": ">=18" + "node": ">=10" } }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.1.tgz", - "integrity": "sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==", - "cpu": [ - "arm64" - ], + "../../node_modules/yargs-unparser": { + "version": "2.0.0", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, "engines": { - "node": ">=18" + "node": ">=10" } }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.1.tgz", - "integrity": "sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==", - "cpu": [ - "x64" - ], + "../../node_modules/yargs-unparser/node_modules/is-plain-obj": { + "version": "2.1.0", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], + "license": "MIT", "engines": { - "node": ">=18" + "node": ">=8" } }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.1.tgz", - "integrity": "sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==", - "cpu": [ - "x64" - ], + "../../node_modules/yauzl": { + "version": "2.10.0", "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" } }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.1.tgz", - "integrity": "sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==", - "cpu": [ - "arm64" - ], + "../../node_modules/yn": { + "version": "3.1.1", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "license": "MIT", "engines": { - "node": ">=18" + "node": ">=6" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.1.tgz", - "integrity": "sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==", - "cpu": [ - "ia32" - ], + "../../node_modules/yocto-queue": { + "version": "0.1.0", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "license": "MIT", "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@0no-co/graphql.web": { + "version": "1.1.2", + "license": "MIT", + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" + }, + "peerDependenciesMeta": { + "graphql": { + "optional": true + } + } + }, + "node_modules/@0no-co/graphqlsp": { + "version": "1.12.16", + "license": "MIT", + "dependencies": { + "@gql.tada/internal": "^1.0.0", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" + }, + "peerDependencies": { + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "typescript": "^5.0.0" } }, - "node_modules/@esbuild/win32-x64": { + "node_modules/@esbuild/linux-x64": { "version": "0.25.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.1.tgz", - "integrity": "sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ - "win32" + "linux" ], "engines": { "node": ">=18" @@ -529,8 +6591,7 @@ }, "node_modules/@gql.tada/cli-utils": { "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.6.3.tgz", - "integrity": "sha512-jFFSY8OxYeBxdKi58UzeMXG1tdm4FVjXa8WHIi66Gzu9JWtCE6mqom3a8xkmSw+mVaybFW5EN2WXf1WztJVNyQ==", + "license": "MIT", "dependencies": { "@0no-co/graphqlsp": "^1.12.13", "@gql.tada/internal": "1.0.8", @@ -554,8 +6615,7 @@ }, "node_modules/@gql.tada/internal": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.8.tgz", - "integrity": "sha512-XYdxJhtHC5WtZfdDqtKjcQ4d7R1s0d1rnlSs3OcBEUbYiPoJJfZU7tWsVXuv047Z6msvmr4ompJ7eLSK5Km57g==", + "license": "MIT", "dependencies": { "@0no-co/graphql.web": "^1.0.5" }, @@ -566,16 +6626,14 @@ }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "license": "MIT", "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "node_modules/@iota/bcs": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@iota/bcs/-/bcs-0.2.1.tgz", - "integrity": "sha512-T+iv5gZhUZP7BiDY7+Ir4MA2rYmyGNZA2b+nxjv219Fp8klFt+l38OWA+1RgJXrCmzuZ+M4hbMAeHhHziURX6Q==", + "version": "1.0.0", + "license": "Apache-2.0", "dependencies": { "bs58": "^6.0.0" } @@ -585,13 +6643,11 @@ "link": true }, "node_modules/@iota/iota-sdk": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@iota/iota-sdk/-/iota-sdk-0.6.0.tgz", - "integrity": "sha512-NEYiE7bdWw2DA3vLV7dO2EnoLDljN9NPhYrjfDGefTbIS9XpqX0JZTHMi//Q/K0aO4NwSHR5gu7n/ywoOTzTKg==", + "version": "1.0.1", "license": "Apache-2.0", "dependencies": { "@graphql-typed-document-node/core": "^3.2.0", - "@iota/bcs": "0.2.1", + "@iota/bcs": "1.0.0", "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@scure/bip32": "^1.4.0", @@ -609,8 +6665,7 @@ }, "node_modules/@noble/curves": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", + "license": "MIT", "dependencies": { "@noble/hashes": "1.7.1" }, @@ -623,8 +6678,7 @@ }, "node_modules/@noble/hashes": { "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", - "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==", + "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -632,196 +6686,13 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.35.0.tgz", - "integrity": "sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.35.0.tgz", - "integrity": "sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.35.0.tgz", - "integrity": "sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.35.0.tgz", - "integrity": "sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.35.0.tgz", - "integrity": "sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.35.0.tgz", - "integrity": "sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.35.0.tgz", - "integrity": "sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.35.0.tgz", - "integrity": "sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.35.0.tgz", - "integrity": "sha512-uagpnH2M2g2b5iLsCTZ35CL1FgyuzzJQ8L9VtlJ+FckBXroTwNOaD0z0/UF+k5K3aNQjbm8LIVpxykUOQt1m/A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.35.0.tgz", - "integrity": "sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.35.0.tgz", - "integrity": "sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.35.0.tgz", - "integrity": "sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.35.0.tgz", - "integrity": "sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.35.0.tgz", - "integrity": "sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.35.0.tgz", - "integrity": "sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -829,68 +6700,26 @@ }, "node_modules/@rollup/rollup-linux-x64-musl": { "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.35.0.tgz", - "integrity": "sha512-QysqXzYiDvQWfUiTm8XmJNO2zm9yC9P/2Gkrwg2dH9cxotQzunBHYr6jk4SujCTqnfGxduOmQcI7c2ryuW8XVg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.35.0.tgz", - "integrity": "sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.35.0.tgz", - "integrity": "sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.35.0.tgz", - "integrity": "sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@scure/base": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz", - "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==", + "license": "MIT", "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip32": { "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", - "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", + "license": "MIT", "dependencies": { "@noble/curves": "~1.8.1", "@noble/hashes": "~1.7.1", @@ -902,8 +6731,7 @@ }, "node_modules/@scure/bip39": { "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", - "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", + "license": "MIT", "dependencies": { "@noble/hashes": "~1.7.1", "@scure/base": "~1.2.4" @@ -914,20 +6742,17 @@ }, "node_modules/@suchipi/femver": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", - "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==" + "license": "MIT" }, "node_modules/@types/estree": { "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 + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { "version": "22.13.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", - "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "dev": true, + "license": "MIT", "optional": true, "peer": true, "dependencies": { @@ -936,28 +6761,24 @@ }, "node_modules/base-x": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz", - "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==" + "license": "MIT" }, "node_modules/bech32": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + "license": "MIT" }, "node_modules/bs58": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", - "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", + "license": "MIT", "dependencies": { "base-x": "^5.0.0" } }, "node_modules/esbuild": { "version": "0.25.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", - "integrity": "sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -992,24 +6813,9 @@ "@esbuild/win32-x64": "0.25.1" } }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/gql.tada": { "version": "1.8.10", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.8.10.tgz", - "integrity": "sha512-FrvSxgz838FYVPgZHGOSgbpOjhR+yq44rCzww3oOPJYi0OvBJjAgCiP6LEokZIYND2fUTXzQAyLgcvgw1yNP5A==", + "license": "MIT", "dependencies": { "@0no-co/graphql.web": "^1.0.5", "@0no-co/graphqlsp": "^1.12.13", @@ -1026,16 +6832,13 @@ }, "node_modules/graphql": { "version": "16.10.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", - "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", + "license": "MIT", "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } }, "node_modules/nanoid": { "version": "3.3.9", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.9.tgz", - "integrity": "sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg==", "dev": true, "funding": [ { @@ -1043,6 +6846,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1052,14 +6856,11 @@ }, "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 + "dev": true, + "license": "ISC" }, "node_modules/postcss": { "version": "8.5.3", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", - "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "dev": true, "funding": [ { @@ -1075,6 +6876,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", @@ -1086,9 +6888,8 @@ }, "node_modules/rollup": { "version": "4.35.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.35.0.tgz", - "integrity": "sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -1124,22 +6925,19 @@ }, "node_modules/source-map-js": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/tweetnacl": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "license": "Unlicense" }, "node_modules/typescript": { "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1150,22 +6948,19 @@ }, "node_modules/undici-types": { "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, + "license": "MIT", "optional": true, "peer": true }, "node_modules/valibot": { "version": "0.36.0", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.36.0.tgz", - "integrity": "sha512-CjF1XN4sUce8sBK9TixrDqFM7RwNkuXdJu174/AwmQUB62QbCQADg5lLe8ldBalFgtj1uKj+pKwDJiNo4Mn+eQ==" + "license": "MIT" }, "node_modules/vite": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.1.tgz", - "integrity": "sha512-n2GnqDb6XPhlt9B8olZPrgMD/es/Nd1RdChF6CBD/fHW6pUyUTt2sQW2fPRX5GiD9XEa6+8A6A4f2vT6pSsE7Q==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.25.0", "postcss": "^8.5.3", @@ -1231,9 +7026,6 @@ "optional": true } } - }, - "web": { - "extraneous": true } } } diff --git a/bindings/wasm/identity_wasm/cypress/app/package.json b/bindings/wasm/identity_wasm/cypress/app/package.json index 67fd8c09d9..8e411f5974 100644 --- a/bindings/wasm/identity_wasm/cypress/app/package.json +++ b/bindings/wasm/identity_wasm/cypress/app/package.json @@ -14,6 +14,6 @@ }, "dependencies": { "@iota/identity-wasm": "file:../..", - "@iota/iota-sdk": "^0.6.0" + "@iota/iota-sdk": "^1.0.0" } } diff --git a/bindings/wasm/identity_wasm/lib/tsconfig.json b/bindings/wasm/identity_wasm/lib/tsconfig.json index 49e2616ec2..f5aa88b5be 100644 --- a/bindings/wasm/identity_wasm/lib/tsconfig.json +++ b/bindings/wasm/identity_wasm/lib/tsconfig.json @@ -17,4 +17,4 @@ "outDir": "../node", "declarationDir": "../node" } -} +} \ No newline at end of file diff --git a/bindings/wasm/identity_wasm/lib/tsconfig.web.json b/bindings/wasm/identity_wasm/lib/tsconfig.web.json index edbccd05a8..8721c20c0a 100644 --- a/bindings/wasm/identity_wasm/lib/tsconfig.web.json +++ b/bindings/wasm/identity_wasm/lib/tsconfig.web.json @@ -18,4 +18,4 @@ "declarationDir": "../web", "module": "ES2022" } -} +} \ No newline at end of file diff --git a/bindings/wasm/identity_wasm/package-lock.json b/bindings/wasm/identity_wasm/package-lock.json index fcd8a45a1c..722c0ae07c 100644 --- a/bindings/wasm/identity_wasm/package-lock.json +++ b/bindings/wasm/identity_wasm/package-lock.json @@ -1,7 +1,7 @@ { "name": "@iota/identity-wasm", "version": "1.6.0-alpha.5", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -9,7 +9,7 @@ "version": "1.6.0-alpha.5", "license": "Apache-2.0", "dependencies": { - "@iota/iota-interaction-ts": "^0.3.3", + "@iota/iota-interaction-ts": "^0.4.2", "@noble/ed25519": "^1.7.3", "@noble/hashes": "^1.4.0", "@types/node-fetch": "^2.6.2", @@ -43,38 +43,11 @@ "node": ">=20" }, "peerDependencies": { - "@iota/iota-sdk": "^0.6.0" + "@iota/iota-sdk": "^1.0.0" } }, - "../iota_interaction_ts": { - "name": "@iota/iota-interaction-ts", - "version": "0.3.3", - "license": "Apache-2.0", - "devDependencies": { - "@types/node": "^22.0.0", - "dprint": "^0.33.0", - "rimraf": "^6.0.1", - "tsconfig-paths": "^4.1.0", - "typescript": "^5.7.3", - "wasm-opt": "^1.4.0" - }, - "engines": { - "node": ">=20" - }, - "peerDependencies": { - "@iota/iota-sdk": "^0.6.0" - } - }, - "../iota_interaction_ts/node": { - "name": "@iota/iota-interaction-ts", - "version": "1.4.0", - "extraneous": true, - "license": "Apache-2.0" - }, "node_modules/@0no-co/graphql.web": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@0no-co/graphql.web/-/graphql.web-1.1.2.tgz", - "integrity": "sha512-N2NGsU5FLBhT8NZ+3l2YrzZSHITjNXNuDhC4iDiikv0IujaJ0Xc6xIxQZ/Ek3Cb+rgPjnLHYyJm11tInuJn+cw==", "license": "MIT", "peer": true, "peerDependencies": { @@ -88,8 +61,6 @@ }, "node_modules/@0no-co/graphqlsp": { "version": "1.12.16", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.16.tgz", - "integrity": "sha512-B5pyYVH93Etv7xjT6IfB7QtMBdaaC07yjbhN6v8H7KgFStMkPvi+oWYBTibMFRMY89qwc9H8YixXg8SXDVgYWw==", "license": "MIT", "peer": true, "dependencies": { @@ -103,9 +74,8 @@ }, "node_modules/@babel/parser": { "version": "7.21.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.1.tgz", - "integrity": "sha512-JzhBFpkuhBNYUY7qs+wTzNmyCWUHEaAFpQQD2YfU1rPL38/L43Wvid0fFkiOCnHvsGncRZgEPyGnltABLcVDTg==", "dev": true, + "license": "MIT", "bin": { "parser": "bin/babel-parser.js" }, @@ -115,9 +85,8 @@ }, "node_modules/@colors/colors": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.1.90" @@ -125,9 +94,8 @@ }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -137,9 +105,8 @@ }, "node_modules/@cypress/request": { "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.8.tgz", - "integrity": "sha512-h0NFgh1mJmm1nr4jCwkGHwKneVYKghUyWe6TMNrk0B9zsjAJxpg8C4/+BAcmLgCPa1vj1V8rNUaILl+zYRUWBQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -166,9 +133,8 @@ }, "node_modules/@cypress/request/node_modules/form-data": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -181,9 +147,8 @@ }, "node_modules/@cypress/xvfb": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", - "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.1.0", "lodash.once": "^4.1.1" @@ -191,17 +156,14 @@ }, "node_modules/@cypress/xvfb/node_modules/debug": { "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/@gerrit0/mini-shiki": { "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.27.2.tgz", - "integrity": "sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==", "dev": true, "license": "MIT", "dependencies": { @@ -212,8 +174,6 @@ }, "node_modules/@gql.tada/cli-utils": { "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.6.3.tgz", - "integrity": "sha512-jFFSY8OxYeBxdKi58UzeMXG1tdm4FVjXa8WHIi66Gzu9JWtCE6mqom3a8xkmSw+mVaybFW5EN2WXf1WztJVNyQ==", "license": "MIT", "peer": true, "dependencies": { @@ -239,8 +199,6 @@ }, "node_modules/@gql.tada/internal": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.8.tgz", - "integrity": "sha512-XYdxJhtHC5WtZfdDqtKjcQ4d7R1s0d1rnlSs3OcBEUbYiPoJJfZU7tWsVXuv047Z6msvmr4ompJ7eLSK5Km57g==", "license": "MIT", "peer": true, "dependencies": { @@ -253,8 +211,6 @@ }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", "license": "MIT", "peer": true, "peerDependencies": { @@ -263,23 +219,19 @@ }, "node_modules/@hapi/hoek": { "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@hapi/topo": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.0.0" } }, "node_modules/@iota/bcs": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@iota/bcs/-/bcs-0.2.1.tgz", - "integrity": "sha512-T+iv5gZhUZP7BiDY7+Ir4MA2rYmyGNZA2b+nxjv219Fp8klFt+l38OWA+1RgJXrCmzuZ+M4hbMAeHhHziURX6Q==", + "version": "1.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { @@ -287,18 +239,22 @@ } }, "node_modules/@iota/iota-interaction-ts": { - "resolved": "../iota_interaction_ts", - "link": true + "version": "0.4.2", + "license": "Apache-2.0", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@iota/iota-sdk": "^1.0.0" + } }, "node_modules/@iota/iota-sdk": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@iota/iota-sdk/-/iota-sdk-0.6.0.tgz", - "integrity": "sha512-NEYiE7bdWw2DA3vLV7dO2EnoLDljN9NPhYrjfDGefTbIS9XpqX0JZTHMi//Q/K0aO4NwSHR5gu7n/ywoOTzTKg==", + "version": "1.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { "@graphql-typed-document-node/core": "^3.2.0", - "@iota/bcs": "0.2.1", + "@iota/bcs": "1.0.0", "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@scure/bip32": "^1.4.0", @@ -316,16 +272,13 @@ }, "node_modules/@iota/iota-sdk/node_modules/tweetnacl": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", "license": "Unlicense", "peer": 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", @@ -340,9 +293,8 @@ }, "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" }, @@ -352,9 +304,8 @@ }, "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" }, @@ -364,15 +315,13 @@ }, "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 + "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", @@ -387,9 +336,8 @@ }, "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" }, @@ -402,9 +350,8 @@ }, "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", @@ -419,8 +366,6 @@ }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", - "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "peer": true, @@ -435,8 +380,6 @@ }, "node_modules/@jridgewell/gen-mapping/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", "peer": true, @@ -447,17 +390,14 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "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", "peer": true, @@ -467,8 +407,6 @@ }, "node_modules/@jridgewell/source-map": { "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "license": "MIT", "peer": true, @@ -479,8 +417,6 @@ }, "node_modules/@jridgewell/source-map/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", "peer": true, @@ -491,28 +427,24 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@noble/curves": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", + "version": "1.9.0", "license": "MIT", "peer": true, "dependencies": { - "@noble/hashes": "1.7.1" + "@noble/hashes": "1.8.0" }, "engines": { "node": "^14.21.3 || >=16" @@ -523,19 +455,16 @@ }, "node_modules/@noble/ed25519": { "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.7.3.tgz", - "integrity": "sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==", "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } - ] + ], + "license": "MIT" }, "node_modules/@noble/hashes": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", - "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==", + "version": "1.8.0", "license": "MIT", "engines": { "node": "^14.21.3 || >=16" @@ -546,9 +475,8 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -559,18 +487,16 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -580,9 +506,7 @@ } }, "node_modules/@scure/base": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz", - "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==", + "version": "1.2.5", "license": "MIT", "peer": true, "funding": { @@ -590,29 +514,25 @@ } }, "node_modules/@scure/bip32": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", - "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", + "version": "1.7.0", "license": "MIT", "peer": true, "dependencies": { - "@noble/curves": "~1.8.1", - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.2" + "@noble/curves": "~1.9.0", + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip39": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", - "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", + "version": "1.6.0", "license": "MIT", "peer": true, "dependencies": { - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.4" + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -620,8 +540,6 @@ }, "node_modules/@shikijs/engine-oniguruma": { "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.27.2.tgz", - "integrity": "sha512-FZYKD1KN7srvpkz4lbGLOYWlyDU4Rd+2RtuKfABTkafAPOFr+J6umfIwY/TzOQqfNtWjL7SAwPAO0dcOraRLaQ==", "dev": true, "license": "MIT", "dependencies": { @@ -631,8 +549,6 @@ }, "node_modules/@shikijs/types": { "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.27.2.tgz", - "integrity": "sha512-DM9OWUyjmdYdnKDpaGB/GEn9XkToyK1tqxuqbmc5PV+5K8WjjwfygL3+cIvbkSw2v1ySwHDgqATq/+98pJ4Kyg==", "dev": true, "license": "MIT", "dependencies": { @@ -642,76 +558,62 @@ }, "node_modules/@shikijs/vscode-textmate": { "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz", - "integrity": "sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==", "dev": true, "license": "MIT" }, "node_modules/@sideway/address": { "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", - "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.0.0" } }, "node_modules/@sideway/formula": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@sideway/pinpoint": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@suchipi/femver": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", - "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==", "license": "MIT", "peer": true }, "node_modules/@tsconfig/node10": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/debug": { "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", "dev": true, + "license": "MIT", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/eslint": { "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", "dev": true, "license": "MIT", "peer": true, @@ -722,8 +624,6 @@ }, "node_modules/@types/eslint-scope": { "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", "dev": true, "license": "MIT", "peer": true, @@ -734,16 +634,12 @@ }, "node_modules/@types/estree": { "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, "license": "MIT", "peer": true }, "node_modules/@types/hast": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dev": true, "license": "MIT", "dependencies": { @@ -752,21 +648,17 @@ }, "node_modules/@types/json-schema": { "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/@types/jsonwebtoken": { "version": "9.0.7", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.7.tgz", - "integrity": "sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==", "dev": true, "license": "MIT", "dependencies": { @@ -775,15 +667,13 @@ }, "node_modules/@types/linkify-it": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/markdown-it": { "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/linkify-it": "*", "@types/mdurl": "*" @@ -791,35 +681,29 @@ }, "node_modules/@types/mdast": { "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz", - "integrity": "sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/mdurl": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/mocha": { "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", - "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/ms": { "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { "version": "22.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", - "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", "license": "MIT", "dependencies": { "undici-types": "~6.20.0" @@ -827,8 +711,7 @@ }, "node_modules/@types/node-fetch": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", + "license": "MIT", "dependencies": { "@types/node": "*", "form-data": "^3.0.0" @@ -836,27 +719,23 @@ }, "node_modules/@types/sinonjs__fake-timers": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", - "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/sizzle": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", - "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/unist": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", - "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/yauzl": { "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", - "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/node": "*" @@ -864,14 +743,11 @@ }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", - "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", "dev": true, "license": "MIT", "peer": true, @@ -882,32 +758,24 @@ }, "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", - "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", "dev": true, "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", - "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", "dev": true, "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-buffer": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", - "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", "dev": true, "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", - "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", "dev": true, "license": "MIT", "peer": true, @@ -919,16 +787,12 @@ }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", - "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", "dev": true, "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-wasm-section": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", - "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", "dev": true, "license": "MIT", "peer": true, @@ -941,8 +805,6 @@ }, "node_modules/@webassemblyjs/ieee754": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", - "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", "dev": true, "license": "MIT", "peer": true, @@ -952,8 +814,6 @@ }, "node_modules/@webassemblyjs/leb128": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", - "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", "dev": true, "license": "Apache-2.0", "peer": true, @@ -963,16 +823,12 @@ }, "node_modules/@webassemblyjs/utf8": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", - "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", "dev": true, "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/wasm-edit": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", - "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", "dev": true, "license": "MIT", "peer": true, @@ -989,8 +845,6 @@ }, "node_modules/@webassemblyjs/wasm-gen": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", - "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", "dev": true, "license": "MIT", "peer": true, @@ -1004,8 +858,6 @@ }, "node_modules/@webassemblyjs/wasm-opt": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", - "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", "dev": true, "license": "MIT", "peer": true, @@ -1018,8 +870,6 @@ }, "node_modules/@webassemblyjs/wasm-parser": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", - "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", "dev": true, "license": "MIT", "peer": true, @@ -1034,8 +884,6 @@ }, "node_modules/@webassemblyjs/wast-printer": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", - "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", "dev": true, "license": "MIT", "peer": true, @@ -1046,24 +894,18 @@ }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", "dev": true, "license": "BSD-3-Clause", "peer": true }, "node_modules/@xtuc/long": { "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true, "license": "Apache-2.0", "peer": true }, "node_modules/acorn": { "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", "bin": { @@ -1075,18 +917,16 @@ }, "node_modules/acorn-walk": { "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/aggregate-error": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, + "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -1097,9 +937,8 @@ }, "node_modules/ajv": { "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1113,8 +952,6 @@ }, "node_modules/ajv-formats": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "dev": true, "license": "MIT", "peer": true, @@ -1132,8 +969,6 @@ }, "node_modules/ajv-formats/node_modules/ajv": { "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", "peer": true, @@ -1150,35 +985,30 @@ }, "node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT", "peer": true }, "node_modules/ajv-keywords": { "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, + "license": "MIT", "peerDependencies": { "ajv": "^6.9.1" } }, "node_modules/ansi-colors": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/ansi-escape-sequences": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz", - "integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^3.0.1" }, @@ -1188,18 +1018,16 @@ }, "node_modules/ansi-escape-sequences/node_modules/array-back": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/ansi-escapes": { "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -1212,18 +1040,16 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -1236,9 +1062,8 @@ }, "node_modules/anymatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, + "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -1249,8 +1074,6 @@ }, "node_modules/arch": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", - "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", "dev": true, "funding": [ { @@ -1265,114 +1088,101 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/arg": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/argparse": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/array-back": { "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=12.17" } }, "node_modules/array-union": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/arrify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/asn1": { "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": "~2.1.0" } }, "node_modules/assert-plus": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8" } }, "node_modules/astral-regex": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/async": { "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/asynckit": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 4.0.0" } }, "node_modules/aws-sign2": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/aws4": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/axios": { "version": "1.8.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", - "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", "dev": true, + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -1381,9 +1191,8 @@ }, "node_modules/axios/node_modules/form-data": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -1396,15 +1205,13 @@ }, "node_modules/axios/node_modules/proxy-from-env": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bail": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -1412,29 +1219,23 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/base-x": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz", - "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==", "license": "MIT", "peer": true }, "node_modules/base64-arraybuffer": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "license": "MIT", "engines": { "node": ">= 0.6.0" } }, "node_modules/base64-js": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true, "funding": [ { @@ -1449,68 +1250,60 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "tweetnacl": "^0.14.3" } }, "node_modules/bech32": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", "license": "MIT", "peer": true }, "node_modules/big-integer": { "version": "1.6.51", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", - "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "dev": true, + "license": "Unlicense", "engines": { "node": ">=0.6" } }, "node_modules/big.js": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, "node_modules/binary-extensions": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/blob-util": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", - "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/bluebird": { "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1518,9 +1311,8 @@ }, "node_modules/braces": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.0.1" }, @@ -1530,14 +1322,11 @@ }, "node_modules/browser-stdout": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/browserslist": { "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "dev": true, "funding": [ { @@ -1570,8 +1359,6 @@ }, "node_modules/bs58": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", - "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", "license": "MIT", "peer": true, "dependencies": { @@ -1580,8 +1367,6 @@ }, "node_modules/buffer": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { @@ -1597,6 +1382,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -1604,24 +1390,21 @@ }, "node_modules/buffer-crc32": { "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, "node_modules/buffer-from": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cache-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-2.0.0.tgz", - "integrity": "sha512-4gkeHlFpSKgm3vm2gJN5sPqfmijYRFYCQ6tv5cLw0xVmT6r1z1vd4FNnpuOREco3cBs1G709sZ72LdgddKvL5w==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^4.0.1", "fs-then-native": "^2.0.0", @@ -1633,27 +1416,24 @@ }, "node_modules/cache-point/node_modules/array-back": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/cachedir": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", - "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -1664,9 +1444,8 @@ }, "node_modules/call-bound": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" @@ -1680,9 +1459,8 @@ }, "node_modules/camelcase": { "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1692,8 +1470,6 @@ }, "node_modules/caniuse-lite": { "version": "1.0.30001692", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz", - "integrity": "sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==", "dev": true, "funding": [ { @@ -1714,15 +1490,13 @@ }, "node_modules/caseless": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/catharsis": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", - "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", "dev": true, + "license": "MIT", "dependencies": { "lodash": "^4.17.15" }, @@ -1732,9 +1506,8 @@ }, "node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1748,9 +1521,8 @@ }, "node_modules/chalk/node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1760,9 +1532,8 @@ }, "node_modules/character-entities": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", - "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -1770,17 +1541,14 @@ }, "node_modules/check-more-types": { "version": "2.24.0", - "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", - "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/chokidar": { "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "funding": [ { @@ -1788,6 +1556,7 @@ "url": "https://paulmillr.com/funding/" } ], + "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -1806,8 +1575,6 @@ }, "node_modules/chownr": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true, "license": "ISC", "engines": { @@ -1816,8 +1583,6 @@ }, "node_modules/chrome-trace-event": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", - "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, "license": "MIT", "peer": true, @@ -1827,8 +1592,6 @@ }, "node_modules/ci-info": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.2.0.tgz", - "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==", "dev": true, "funding": [ { @@ -1836,24 +1599,23 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/clean-stack": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/cli-cursor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, + "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" }, @@ -1863,9 +1625,8 @@ }, "node_modules/cli-table3": { "version": "0.6.5", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", - "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", "dev": true, + "license": "MIT", "dependencies": { "string-width": "^4.2.0" }, @@ -1878,9 +1639,8 @@ }, "node_modules/cli-truncate": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, + "license": "MIT", "dependencies": { "slice-ansi": "^3.0.0", "string-width": "^4.2.0" @@ -1894,9 +1654,8 @@ }, "node_modules/cliui": { "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -1905,9 +1664,8 @@ }, "node_modules/collect-all": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/collect-all/-/collect-all-1.0.4.tgz", - "integrity": "sha512-RKZhRwJtJEP5FWul+gkSMEnaK6H3AGPTTWOiRimCcs+rc/OmQE3Yhy1Q7A7KsdkG3ZXVdZq68Y6ONSdvkeEcKA==", "dev": true, + "license": "MIT", "dependencies": { "stream-connect": "^1.0.2", "stream-via": "^1.0.4" @@ -1918,9 +1676,8 @@ }, "node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -1930,20 +1687,17 @@ }, "node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/colorette": { "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -1953,9 +1707,8 @@ }, "node_modules/command-line-args": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^3.1.0", "find-replace": "^3.0.0", @@ -1968,27 +1721,24 @@ }, "node_modules/command-line-args/node_modules/array-back": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/command-line-args/node_modules/typical": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/command-line-tool": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/command-line-tool/-/command-line-tool-0.8.0.tgz", - "integrity": "sha512-Xw18HVx/QzQV3Sc5k1vy3kgtOeGmsKIqwtFFoyjI4bbcpSgnw2CWVULvtakyw4s6fhyAdI6soQQhXc2OzJy62g==", "dev": true, + "license": "MIT", "dependencies": { "ansi-escape-sequences": "^4.0.0", "array-back": "^2.0.0", @@ -2002,9 +1752,8 @@ }, "node_modules/command-line-tool/node_modules/array-back": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, + "license": "MIT", "dependencies": { "typical": "^2.6.1" }, @@ -2014,9 +1763,8 @@ }, "node_modules/command-line-usage": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-4.1.0.tgz", - "integrity": "sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g==", "dev": true, + "license": "MIT", "dependencies": { "ansi-escape-sequences": "^4.0.0", "array-back": "^2.0.0", @@ -2029,9 +1777,8 @@ }, "node_modules/command-line-usage/node_modules/array-back": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, + "license": "MIT", "dependencies": { "typical": "^2.6.1" }, @@ -2041,60 +1788,53 @@ }, "node_modules/commander": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/common-sequence": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-2.0.2.tgz", - "integrity": "sha512-jAg09gkdkrDO9EWTdXfv80WWH3yeZl5oT69fGfedBNS9pXUKYInVJ1bJ+/ht2+Moeei48TmSbQDYMc8EOx9G0g==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/common-tags": { "version": "1.8.2", - "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", - "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0.0" } }, "node_modules/concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/config-master": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", - "integrity": "sha512-n7LBL1zBzYdTpF1mx5DNcZnZn05CWIdsdvtPL4MosvqbBUK3Rq6VWEtGUuF3Y0s9/CIhMejezqlSkP6TnCJ/9g==", "dev": true, + "license": "MIT", "dependencies": { "walk-back": "^2.0.1" } }, "node_modules/config-master/node_modules/walk-back": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-2.0.1.tgz", - "integrity": "sha512-Nb6GvBR8UWX1D+Le+xUq0+Q1kFmRBIWVrfLnQAOmcpEzA9oAxwJ9gIr36t9TWYfzvWRvuMtjHiVsJYEkXWaTAQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/copy-webpack-plugin": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-7.0.0.tgz", - "integrity": "sha512-SLjQNa5iE3BoCP76ESU9qYo9ZkEWtXoZxDurHoqPchAFRblJ9g96xTeC560UXBMre1Nx6ixIIUfiY3VcjpJw3g==", "dev": true, + "license": "MIT", "dependencies": { "fast-glob": "^3.2.4", "glob-parent": "^5.1.1", @@ -2118,21 +1858,18 @@ }, "node_modules/core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/create-require": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2144,10 +1881,9 @@ }, "node_modules/cypress": { "version": "14.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-14.2.0.tgz", - "integrity": "sha512-u7fuc9JEpSYLOdu8mzZDZ/JWsHUzR5pc8i1TeSqMz/bafXp+6IweMAeyphsEJ6/13qbB6nwTEY1m+GUAp6GqCQ==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "@cypress/request": "^3.0.7", "@cypress/xvfb": "^1.2.4", @@ -2202,9 +1938,8 @@ }, "node_modules/cypress/node_modules/fs-extra": { "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -2217,9 +1952,8 @@ }, "node_modules/dashdash": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" }, @@ -2229,15 +1963,13 @@ }, "node_modules/dayjs": { "version": "1.11.11", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", - "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/debug": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -2252,9 +1984,8 @@ }, "node_modules/decamelize": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -2264,9 +1995,8 @@ }, "node_modules/decode-named-character-reference": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", - "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", "dev": true, + "license": "MIT", "dependencies": { "character-entities": "^2.0.0" }, @@ -2277,50 +2007,44 @@ }, "node_modules/deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0.0" } }, "node_modules/delayed-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/dequal": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/diff": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, "node_modules/diff-match-patch": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.5.tgz", - "integrity": "sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/dir-glob": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -2330,9 +2054,8 @@ }, "node_modules/dmd": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/dmd/-/dmd-6.1.0.tgz", - "integrity": "sha512-0zQIJ873gay1scCTFZvHPWM9mVJBnaylB2NQDI8O9u8O32m00Jb6uxDKexZm8hjTRM7RiWe0FJ32pExHoXdwoQ==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^6.2.2", "cache-point": "^2.0.0", @@ -2353,10 +2076,9 @@ }, "node_modules/dprint": { "version": "0.33.0", - "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.33.0.tgz", - "integrity": "sha512-VploASP7wL1HAYe5xWZKRwp8gW5zTdcG3Tb60DASv6QLnGKsl+OS+bY7wsXFrS4UcIbUNujXdsNG5FxBfRJIQg==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "yauzl": "=2.10.0" }, @@ -2366,9 +2088,8 @@ }, "node_modules/dunder-proto": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -2380,21 +2101,18 @@ }, "node_modules/duplexer": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true + "dev": true, + "license": "MIT" }, "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 + "dev": true, + "license": "MIT" }, "node_modules/ecc-jsbn": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, + "license": "MIT", "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -2402,40 +2120,33 @@ }, "node_modules/electron-to-chromium": { "version": "1.5.80", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.80.tgz", - "integrity": "sha512-LTrKpW0AqIuHwmlVNV+cjFYTnXtM9K37OGhpe0ZI10ScPSxqVSryZHIY3WnCS5NSYbBODRTZyhRMS2h5FAEqAw==", "dev": true, "license": "ISC", "peer": true }, "node_modules/emoji-regex": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/emojis-list": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/end-of-stream": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, + "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/enhanced-resolve": { "version": "5.18.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", - "integrity": "sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==", "dev": true, "license": "MIT", "peer": true, @@ -2449,9 +2160,8 @@ }, "node_modules/enquirer": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -2462,44 +2172,38 @@ }, "node_modules/entities": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", "dev": true, + "license": "BSD-2-Clause", "funding": { "url": "https://github.com/fb55/entities?sponsor=1" } }, "node_modules/es-define-property": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-errors": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-module-lexer": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", - "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", "dev": true, "license": "MIT", "peer": true }, "node_modules/es-object-atoms": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -2509,9 +2213,8 @@ }, "node_modules/es-set-tostringtag": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", @@ -2524,8 +2227,6 @@ }, "node_modules/escalade": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { @@ -2534,17 +2235,14 @@ }, "node_modules/escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/eslint-scope": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "license": "BSD-2-Clause", "peer": true, @@ -2558,8 +2256,6 @@ }, "node_modules/esrecurse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", "peer": true, @@ -2572,8 +2268,6 @@ }, "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", "peer": true, @@ -2583,8 +2277,6 @@ }, "node_modules/estraverse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, "license": "BSD-2-Clause", "peer": true, @@ -2594,9 +2286,8 @@ }, "node_modules/event-stream": { "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==", "dev": true, + "license": "MIT", "dependencies": { "duplexer": "~0.1.1", "from": "~0", @@ -2609,14 +2300,11 @@ }, "node_modules/eventemitter2": { "version": "6.4.7", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", - "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, "license": "MIT", "peer": true, @@ -2626,9 +2314,8 @@ }, "node_modules/execa": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.0", "get-stream": "^5.0.0", @@ -2649,9 +2336,8 @@ }, "node_modules/executable": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", - "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", "dev": true, + "license": "MIT", "dependencies": { "pify": "^2.2.0" }, @@ -2661,15 +2347,13 @@ }, "node_modules/extend": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/extract-zip": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -2687,24 +2371,21 @@ }, "node_modules/extsprintf": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true, "engines": [ "node >=0.6.0" - ] + ], + "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2718,14 +2399,11 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-uri": { "version": "3.0.5", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.5.tgz", - "integrity": "sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q==", "dev": true, "funding": [ { @@ -2742,27 +2420,24 @@ }, "node_modules/fastq": { "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/fd-slicer": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, + "license": "MIT", "dependencies": { "pend": "~1.2.0" } }, "node_modules/figures": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -2775,9 +2450,8 @@ }, "node_modules/file-set": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/file-set/-/file-set-4.0.2.tgz", - "integrity": "sha512-fuxEgzk4L8waGXaAkd8cMr73Pm0FxOVkn8hztzUW7BAHhOGH90viQNXbiOsnecCWmfInqU6YmAMwxRMdKETceQ==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^5.0.0", "glob": "^7.1.6" @@ -2788,18 +2462,16 @@ }, "node_modules/file-set/node_modules/array-back": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/fill-range": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2809,9 +2481,8 @@ }, "node_modules/find-replace": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^3.0.1" }, @@ -2821,18 +2492,16 @@ }, "node_modules/find-replace/node_modules/array-back": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/find-up": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -2846,17 +2515,14 @@ }, "node_modules/flat": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, + "license": "BSD-3-Clause", "bin": { "flat": "cli.js" } }, "node_modules/follow-redirects": { "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -2864,6 +2530,7 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -2875,9 +2542,8 @@ }, "node_modules/foreground-child": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, + "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" @@ -2891,9 +2557,8 @@ }, "node_modules/foreground-child/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" }, @@ -2903,17 +2568,15 @@ }, "node_modules/forever-agent": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/form-data": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -2925,15 +2588,13 @@ }, "node_modules/from": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==", - "dev": true + "dev": true, + "license": "MIT" }, "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==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2945,8 +2606,6 @@ }, "node_modules/fs-minipass": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, "license": "ISC", "dependencies": { @@ -2958,8 +2617,6 @@ }, "node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "license": "ISC", "dependencies": { @@ -2971,56 +2628,37 @@ }, "node_modules/fs-then-native": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fs-then-native/-/fs-then-native-2.0.0.tgz", - "integrity": "sha512-X712jAOaWXkemQCAmWeg5rOT2i+KOpWz1Z/txk/cW0qlOu2oQ9H61vc5w3X/iyuUEfq/OyaFJ78/cZAQD1/bgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0.0" } }, "node_modules/fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } + "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", @@ -3042,9 +2680,8 @@ }, "node_modules/get-proto": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" @@ -3055,9 +2692,8 @@ }, "node_modules/get-stream": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, + "license": "MIT", "dependencies": { "pump": "^3.0.0" }, @@ -3070,27 +2706,24 @@ }, "node_modules/getos": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", - "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", "dev": true, + "license": "MIT", "dependencies": { "async": "^3.2.0" } }, "node_modules/getpass": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" } }, "node_modules/glob": { "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3108,9 +2741,8 @@ }, "node_modules/glob-parent": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -3120,17 +2752,14 @@ }, "node_modules/glob-to-regexp": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true, "license": "BSD-2-Clause", "peer": true }, "node_modules/global-dirs": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, + "license": "MIT", "dependencies": { "ini": "2.0.0" }, @@ -3143,9 +2772,8 @@ }, "node_modules/globby": { "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -3163,9 +2791,8 @@ }, "node_modules/gopd": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3175,8 +2802,6 @@ }, "node_modules/gql.tada": { "version": "1.8.10", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.8.10.tgz", - "integrity": "sha512-FrvSxgz838FYVPgZHGOSgbpOjhR+yq44rCzww3oOPJYi0OvBJjAgCiP6LEokZIYND2fUTXzQAyLgcvgw1yNP5A==", "license": "MIT", "peer": true, "dependencies": { @@ -3195,15 +2820,11 @@ }, "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, "license": "ISC" }, "node_modules/graphql": { - "version": "16.10.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", - "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", + "version": "16.11.0", "license": "MIT", "peer": true, "engines": { @@ -3212,18 +2833,16 @@ }, "node_modules/growl": { "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.x" } }, "node_modules/handlebars": { "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.0", @@ -3242,18 +2861,16 @@ }, "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/has-symbols": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3263,9 +2880,8 @@ }, "node_modules/has-tostringtag": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, + "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -3278,9 +2894,8 @@ }, "node_modules/hasown": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -3290,18 +2905,16 @@ }, "node_modules/he": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, + "license": "MIT", "bin": { "he": "bin/he" } }, "node_modules/http-signature": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", - "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^2.0.2", @@ -3313,17 +2926,14 @@ }, "node_modules/human-signals": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=8.12.0" } }, "node_modules/ieee754": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true, "funding": [ { @@ -3338,31 +2948,29 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/ignore": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/indent-string": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -3370,24 +2978,21 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/ini": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/is-binary-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, + "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -3397,8 +3002,6 @@ }, "node_modules/is-buffer": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "dev": true, "funding": [ { @@ -3414,33 +3017,31 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-glob": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -3450,9 +3051,8 @@ }, "node_modules/is-installed-globally": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, + "license": "MIT", "dependencies": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -3466,27 +3066,24 @@ }, "node_modules/is-number": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/is-path-inside": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-plain-obj": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -3496,9 +3093,8 @@ }, "node_modules/is-stream": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -3508,15 +3104,13 @@ }, "node_modules/is-typedarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-unicode-supported": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -3526,21 +3120,18 @@ }, "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/isstream": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jackspeak": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.0.tgz", - "integrity": "sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -3553,8 +3144,6 @@ }, "node_modules/jest-worker": { "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, "license": "MIT", "peer": true, @@ -3569,9 +3158,8 @@ }, "node_modules/joi": { "version": "17.13.3", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", - "integrity": "sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.3.0", "@hapi/topo": "^5.1.0", @@ -3582,8 +3170,6 @@ }, "node_modules/jose": { "version": "5.9.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.6.tgz", - "integrity": "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" @@ -3591,9 +3177,8 @@ }, "node_modules/js-yaml": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -3603,24 +3188,21 @@ }, "node_modules/js2xmlparser": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", - "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "xmlcreate": "^2.0.4" } }, "node_modules/jsbn": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jsdoc": { "version": "3.6.11", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz", - "integrity": "sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@babel/parser": "^7.9.4", "@types/markdown-it": "^12.2.3", @@ -3647,9 +3229,8 @@ }, "node_modules/jsdoc-api": { "version": "7.1.1", - "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-7.1.1.tgz", - "integrity": "sha512-0pkuPCzVXiqsDAsVrNFXCkHzlyNepBIDVtwwehry4RJAnZmXtlAz7rh8F9FRz53u3NeynGbex+bpYWwi8lE66A==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^6.2.2", "cache-point": "^2.0.0", @@ -3667,9 +3248,8 @@ }, "node_modules/jsdoc-parse": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.1.0.tgz", - "integrity": "sha512-n/hDGQJa69IBun1yZAjqzV4gVR41+flZ3bIlm9fKvNe2Xjsd1/+zCo2+R9ls8LxtePgIWbpA1jU7xkB2lRdLLg==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^6.2.2", "lodash.omit": "^4.5.0", @@ -3684,9 +3264,8 @@ }, "node_modules/jsdoc-to-markdown": { "version": "7.1.1", - "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-7.1.1.tgz", - "integrity": "sha512-CI86d63xAVNO+ENumWwmJ034lYe5iGU5GwjtTA11EuphP9tpnoi4hrKgR/J8uME0D+o4KUpVfwX1fjZhc8dEtg==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^6.2.2", "command-line-tool": "^0.8.0", @@ -3705,44 +3284,37 @@ }, "node_modules/jsdoc/node_modules/escape-string-regexp": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true, "license": "MIT", "peer": true }, "node_modules/json-schema": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true + "dev": true, + "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/json5": { "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -3752,9 +3324,8 @@ }, "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, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -3764,12 +3335,11 @@ }, "node_modules/jsprim": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", - "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", "dev": true, "engines": [ "node >=0.6.0" ], + "license": "MIT", "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -3779,45 +3349,40 @@ }, "node_modules/klaw": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.9" } }, "node_modules/kleur": { "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/lazy-ass": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", - "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", "dev": true, + "license": "MIT", "engines": { "node": "> 0.8" } }, "node_modules/linkify-it": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", "dev": true, + "license": "MIT", "dependencies": { "uc.micro": "^1.0.1" } }, "node_modules/listr2": { "version": "3.14.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", - "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", "dev": true, + "license": "MIT", "dependencies": { "cli-truncate": "^2.1.0", "colorette": "^2.0.16", @@ -3842,8 +3407,6 @@ }, "node_modules/loader-runner": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true, "license": "MIT", "peer": true, @@ -3853,9 +3416,8 @@ }, "node_modules/loader-utils": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, + "license": "MIT", "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -3867,9 +3429,8 @@ }, "node_modules/locate-path": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -3882,45 +3443,38 @@ }, "node_modules/lodash": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.camelcase": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.omit": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", - "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.padend": { "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", - "integrity": "sha512-sOQs2aqGpbl27tmCS1QNZA09Uqp01ZzWfDUoD+xzTii0E7dSQfRKcRetFwa+uXaxaqL+TKm7CgD2JdKP7aZBSw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.pick": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -3934,9 +3488,8 @@ }, "node_modules/log-update": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", - "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", "dev": true, + "license": "MIT", "dependencies": { "ansi-escapes": "^4.3.0", "cli-cursor": "^3.1.0", @@ -3952,9 +3505,8 @@ }, "node_modules/log-update/node_modules/slice-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -3969,9 +3521,8 @@ }, "node_modules/log-update/node_modules/wrap-ansi": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -3983,9 +3534,8 @@ }, "node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -3995,28 +3545,22 @@ }, "node_modules/lunr": { "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true, "license": "MIT" }, "node_modules/make-error": { "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/map-stream": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==", "dev": true }, "node_modules/markdown-it": { "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1", "entities": "~2.1.0", @@ -4030,9 +3574,8 @@ }, "node_modules/markdown-it-anchor": { "version": "8.6.5", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.5.tgz", - "integrity": "sha512-PI1qEHHkTNWT+X6Ip9w+paonfIQ+QZP9sCeMYi47oqhH+EsW8CrJ8J7CzV19QVOj6il8ATGbK2nTECj22ZHGvQ==", "dev": true, + "license": "Unlicense", "peerDependencies": { "@types/markdown-it": "*", "markdown-it": "*" @@ -4040,8 +3583,6 @@ }, "node_modules/marked": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", "dev": true, "license": "MIT", "bin": { @@ -4053,18 +3594,16 @@ }, "node_modules/math-intrinsics": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/mdast-util-from-markdown": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz", - "integrity": "sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", @@ -4086,9 +3625,8 @@ }, "node_modules/mdast-util-to-string": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz", - "integrity": "sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==", "dev": true, + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -4096,29 +3634,24 @@ }, "node_modules/mdurl": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/merge-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/micromark": { "version": "3.0.10", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.0.10.tgz", - "integrity": "sha512-ryTDy6UUunOXy2HPjelppgJ2sNfcPz1pLlMdA6Rz9jPzhLikWXv/irpWV/I2jd68Uhmny7hHxAlAhk4+vWggpg==", "dev": true, "funding": [ { @@ -4130,6 +3663,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", @@ -4152,8 +3686,6 @@ }, "node_modules/micromark-core-commonmark": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz", - "integrity": "sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA==", "dev": true, "funding": [ { @@ -4165,6 +3697,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-factory-destination": "^1.0.0", @@ -4186,8 +3719,6 @@ }, "node_modules/micromark-factory-destination": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz", - "integrity": "sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw==", "dev": true, "funding": [ { @@ -4199,6 +3730,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", @@ -4207,8 +3739,6 @@ }, "node_modules/micromark-factory-label": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.0.2.tgz", - "integrity": "sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg==", "dev": true, "funding": [ { @@ -4220,6 +3750,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", @@ -4229,8 +3760,6 @@ }, "node_modules/micromark-factory-space": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz", - "integrity": "sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew==", "dev": true, "funding": [ { @@ -4242,6 +3771,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-types": "^1.0.0" @@ -4249,8 +3779,6 @@ }, "node_modules/micromark-factory-title": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz", - "integrity": "sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A==", "dev": true, "funding": [ { @@ -4262,6 +3790,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-factory-space": "^1.0.0", "micromark-util-character": "^1.0.0", @@ -4272,8 +3801,6 @@ }, "node_modules/micromark-factory-whitespace": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.0.0.tgz", - "integrity": "sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A==", "dev": true, "funding": [ { @@ -4285,6 +3812,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-factory-space": "^1.0.0", "micromark-util-character": "^1.0.0", @@ -4294,8 +3822,6 @@ }, "node_modules/micromark-util-character": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.1.0.tgz", - "integrity": "sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg==", "dev": true, "funding": [ { @@ -4307,6 +3833,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" @@ -4314,8 +3841,6 @@ }, "node_modules/micromark-util-chunked": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.0.0.tgz", - "integrity": "sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g==", "dev": true, "funding": [ { @@ -4327,14 +3852,13 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-symbol": "^1.0.0" } }, "node_modules/micromark-util-classify-character": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.0.0.tgz", - "integrity": "sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA==", "dev": true, "funding": [ { @@ -4346,6 +3870,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", @@ -4354,8 +3879,6 @@ }, "node_modules/micromark-util-combine-extensions": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz", - "integrity": "sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA==", "dev": true, "funding": [ { @@ -4367,6 +3890,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-chunked": "^1.0.0", "micromark-util-types": "^1.0.0" @@ -4374,8 +3898,6 @@ }, "node_modules/micromark-util-decode-numeric-character-reference": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz", - "integrity": "sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w==", "dev": true, "funding": [ { @@ -4387,14 +3909,13 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-symbol": "^1.0.0" } }, "node_modules/micromark-util-decode-string": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.0.2.tgz", - "integrity": "sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q==", "dev": true, "funding": [ { @@ -4406,6 +3927,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^1.0.0", @@ -4415,8 +3937,6 @@ }, "node_modules/micromark-util-encode": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.0.1.tgz", - "integrity": "sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA==", "dev": true, "funding": [ { @@ -4427,12 +3947,11 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ] + ], + "license": "MIT" }, "node_modules/micromark-util-html-tag-name": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.1.0.tgz", - "integrity": "sha512-BKlClMmYROy9UiV03SwNmckkjn8QHVaWkqoAqzivabvdGcwNGMMMH/5szAnywmsTBUzDsU57/mFi0sp4BQO6dA==", "dev": true, "funding": [ { @@ -4443,12 +3962,11 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ] + ], + "license": "MIT" }, "node_modules/micromark-util-normalize-identifier": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.0.0.tgz", - "integrity": "sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg==", "dev": true, "funding": [ { @@ -4460,14 +3978,13 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-symbol": "^1.0.0" } }, "node_modules/micromark-util-resolve-all": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz", - "integrity": "sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw==", "dev": true, "funding": [ { @@ -4479,14 +3996,13 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-types": "^1.0.0" } }, "node_modules/micromark-util-sanitize-uri": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.0.0.tgz", - "integrity": "sha512-cCxvBKlmac4rxCGx6ejlIviRaMKZc0fWm5HdCHEeDWRSkn44l6NdYVRyU+0nT1XC72EQJMZV8IPHF+jTr56lAg==", "dev": true, "funding": [ { @@ -4498,6 +4014,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-encode": "^1.0.0", @@ -4506,8 +4023,6 @@ }, "node_modules/micromark-util-subtokenize": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.0.2.tgz", - "integrity": "sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA==", "dev": true, "funding": [ { @@ -4519,6 +4034,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "micromark-util-chunked": "^1.0.0", "micromark-util-symbol": "^1.0.0", @@ -4528,8 +4044,6 @@ }, "node_modules/micromark-util-symbol": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.0.1.tgz", - "integrity": "sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ==", "dev": true, "funding": [ { @@ -4540,12 +4054,11 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ] + ], + "license": "MIT" }, "node_modules/micromark-util-types": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.0.2.tgz", - "integrity": "sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w==", "dev": true, "funding": [ { @@ -4556,13 +4069,13 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ] + ], + "license": "MIT" }, "node_modules/micromatch": { "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -4573,16 +4086,14 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -4592,18 +4103,16 @@ }, "node_modules/mimic-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4613,17 +4122,14 @@ }, "node_modules/minimist": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/minipass": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, "license": "ISC", "engines": { @@ -4632,8 +4138,6 @@ }, "node_modules/minizlib": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dev": true, "license": "MIT", "dependencies": { @@ -4646,8 +4150,6 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "license": "ISC", "dependencies": { @@ -4659,9 +4161,8 @@ }, "node_modules/mkdirp": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, + "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" }, @@ -4671,15 +4172,13 @@ }, "node_modules/mkdirp2": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mkdirp2/-/mkdirp2-1.0.5.tgz", - "integrity": "sha512-xOE9xbICroUDmG1ye2h4bZ8WBie9EGmACaco8K8cx6RlkJJrxGIqjGqztAI+NMhexXBcdGbSEzI6N3EJPevxZw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/mocha": { "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, + "license": "MIT", "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", @@ -4720,18 +4219,16 @@ }, "node_modules/mocha/node_modules/ansi-colors": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/mocha/node_modules/debug": { "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -4746,15 +4243,13 @@ }, "node_modules/mocha/node_modules/debug/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 + "dev": true, + "license": "MIT" }, "node_modules/mocha/node_modules/escape-string-regexp": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -4764,9 +4259,8 @@ }, "node_modules/mocha/node_modules/glob": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4784,9 +4278,8 @@ }, "node_modules/mocha/node_modules/glob/node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4796,9 +4289,8 @@ }, "node_modules/mocha/node_modules/minimatch": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4808,18 +4300,16 @@ }, "node_modules/mocha/node_modules/serialize-javascript": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/mocha/node_modules/yargs": { "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -4835,24 +4325,21 @@ }, "node_modules/mri": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nanoid": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true, + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -4862,14 +4349,11 @@ }, "node_modules/neo-async": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true + "dev": true, + "license": "MIT" }, "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" @@ -4888,26 +4372,22 @@ }, "node_modules/node-releases": { "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT", "peer": true }, "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/npm-run-path": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -4917,15 +4397,13 @@ }, "node_modules/object-get": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-get/-/object-get-2.1.1.tgz", - "integrity": "sha512-7n4IpLMzGGcLEMiQKsNR7vCe+N5E9LORFrtNUVy4sO3dj9a3HedZCxEL2T7QuLhcHN1NBuBsMOKaOsAYI9IIvg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/object-inspect": { "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -4935,27 +4413,24 @@ }, "node_modules/object-to-spawn-args": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", - "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0.0" } }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, + "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -4968,15 +4443,13 @@ }, "node_modules/ospath": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", - "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -4989,9 +4462,8 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -5004,9 +4476,8 @@ }, "node_modules/p-map": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" }, @@ -5019,42 +4490,37 @@ }, "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 + "dev": true, + "license": "BlueOak-1.0.0" }, "node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/path-scurry": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" @@ -5068,65 +4534,59 @@ }, "node_modules/path-scurry/node_modules/lru-cache": { "version": "11.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", - "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", "dev": true, + "license": "ISC", "engines": { "node": "20 || >=22" } }, "node_modules/path-scurry/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/path-type": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/pause-stream": { "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", "dev": true, + "license": [ + "MIT", + "Apache2" + ], "dependencies": { "through": "~2.3" } }, "node_modules/pend": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/performance-now": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true + "dev": true, + "license": "MIT" }, "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", "peer": true }, "node_modules/picomatch": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -5136,18 +4596,16 @@ }, "node_modules/pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/pretty-bytes": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", - "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" }, @@ -5157,24 +4615,21 @@ }, "node_modules/process": { "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6.0" } }, "node_modules/proxy-from-env": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", - "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ps-tree": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", - "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", "dev": true, + "license": "MIT", "dependencies": { "event-stream": "=3.3.4" }, @@ -5187,9 +4642,8 @@ }, "node_modules/pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -5197,17 +4651,14 @@ }, "node_modules/punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/punycode.js": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", "dev": true, "license": "MIT", "engines": { @@ -5216,9 +4667,8 @@ }, "node_modules/qs": { "version": "6.14.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", - "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.1.0" }, @@ -5231,8 +4681,6 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -5247,22 +4695,21 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/randombytes": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } }, "node_modules/readdirp": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -5272,9 +4719,8 @@ }, "node_modules/reduce-extract": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/reduce-extract/-/reduce-extract-1.0.0.tgz", - "integrity": "sha512-QF8vjWx3wnRSL5uFMyCjDeDc5EBMiryoT9tz94VvgjKfzecHAVnqmXAwQDcr7X4JmLc2cjkjFGCVzhMqDjgR9g==", "dev": true, + "license": "MIT", "dependencies": { "test-value": "^1.0.1" }, @@ -5284,9 +4730,8 @@ }, "node_modules/reduce-extract/node_modules/array-back": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", "dev": true, + "license": "MIT", "dependencies": { "typical": "^2.6.0" }, @@ -5296,9 +4741,8 @@ }, "node_modules/reduce-extract/node_modules/test-value": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-1.1.0.tgz", - "integrity": "sha512-wrsbRo7qP+2Je8x8DsK8ovCGyxe3sYfQwOraIY/09A2gFXU9DYKiTF14W4ki/01AEh56kMzAmlj9CaHGDDUBJA==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^1.0.2", "typical": "^2.4.2" @@ -5309,27 +4753,24 @@ }, "node_modules/reduce-flatten": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.1.tgz", - "integrity": "sha512-bYo+97BmUUOzg09XwfkwALt4PQH1M5L0wzKerBt6WLm3Fhdd43mMS89HiT1B9pJIqko/6lWx3OnV4J9f2Kqp5Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/reduce-unique": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/reduce-unique/-/reduce-unique-2.0.1.tgz", - "integrity": "sha512-x4jH/8L1eyZGR785WY+ePtyMNhycl1N2XOLxhCbzZFaqF4AXjLzqSxa2UHgJ2ZVR/HHyPOvl1L7xRnW8ye5MdA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/reduce-without": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-without/-/reduce-without-1.0.1.tgz", - "integrity": "sha512-zQv5y/cf85sxvdrKPlfcRzlDn/OqKFThNimYmsS3flmkioKvkUGn2Qg9cJVoQiEvdxFGLE0MQER/9fZ9sUqdxg==", "dev": true, + "license": "MIT", "dependencies": { "test-value": "^2.0.0" }, @@ -5339,9 +4780,8 @@ }, "node_modules/reduce-without/node_modules/array-back": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", "dev": true, + "license": "MIT", "dependencies": { "typical": "^2.6.0" }, @@ -5351,9 +4791,8 @@ }, "node_modules/reduce-without/node_modules/test-value": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^1.0.3", "typical": "^2.6.0" @@ -5364,9 +4803,8 @@ }, "node_modules/remark-parse": { "version": "10.0.1", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.1.tgz", - "integrity": "sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw==", "dev": true, + "license": "MIT", "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-from-markdown": "^1.0.0", @@ -5379,26 +4817,22 @@ }, "node_modules/request-progress": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", - "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", "dev": true, + "license": "MIT", "dependencies": { "throttleit": "^1.0.0" } }, "node_modules/require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/require-from-string": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", "peer": true, @@ -5408,18 +4842,16 @@ }, "node_modules/requizzle": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", - "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", "dev": true, + "license": "MIT", "dependencies": { "lodash": "^4.17.14" } }, "node_modules/restore-cursor": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, + "license": "MIT", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -5430,9 +4862,8 @@ }, "node_modules/reusify": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -5440,15 +4871,13 @@ }, "node_modules/rfdc": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", - "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/rimraf": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^11.0.0", "package-json-from-dist": "^1.0.0" @@ -5465,18 +4894,16 @@ }, "node_modules/rimraf/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/rimraf/node_modules/glob": { "version": "11.0.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz", - "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^4.0.1", @@ -5497,9 +4924,8 @@ }, "node_modules/rimraf/node_modules/minimatch": { "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -5512,17 +4938,14 @@ }, "node_modules/rimraf/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/run-parallel": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { @@ -5538,24 +4961,23 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/rxjs": { "version": "7.8.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", - "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/sade": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", "dev": true, + "license": "MIT", "dependencies": { "mri": "^1.1.0" }, @@ -5565,8 +4987,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, "funding": [ { @@ -5581,18 +5001,16 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/schema-utils": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "license": "MIT", "dependencies": { @@ -5610,9 +5028,8 @@ }, "node_modules/semver": { "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5625,18 +5042,16 @@ }, "node_modules/serialize-javascript": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -5646,18 +5061,16 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/side-channel": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", @@ -5674,9 +5087,8 @@ }, "node_modules/side-channel-list": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" @@ -5690,9 +5102,8 @@ }, "node_modules/side-channel-map": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -5708,9 +5119,8 @@ }, "node_modules/side-channel-weakmap": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -5727,24 +5137,21 @@ }, "node_modules/signal-exit": { "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/slice-ansi": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -5756,9 +5163,8 @@ }, "node_modules/sort-array": { "version": "4.1.5", - "resolved": "https://registry.npmjs.org/sort-array/-/sort-array-4.1.5.tgz", - "integrity": "sha512-Ya4peoS1fgFN42RN1REk2FgdNOeLIEMKFGJvs7VTP3OklF8+kl2SkpVliZ4tk/PurWsrWRsdNdU+tgyOBkB9sA==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^5.0.0", "typical": "^6.0.1" @@ -5769,36 +5175,32 @@ }, "node_modules/sort-array/node_modules/array-back": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/sort-array/node_modules/typical": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-6.0.1.tgz", - "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -5806,9 +5208,8 @@ }, "node_modules/split": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==", "dev": true, + "license": "MIT", "dependencies": { "through": "2" }, @@ -5818,9 +5219,8 @@ }, "node_modules/sshpk": { "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, + "license": "MIT", "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -5843,9 +5243,8 @@ }, "node_modules/start-server-and-test": { "version": "2.0.11", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.11.tgz", - "integrity": "sha512-TN39gLzPhHAflxyOkE/oMfQGj+pj3JgF6qVicFH/JrXt7xXktidKXwqfRga+ve7lVA8+RgPZVc25VrEPRScaDw==", "dev": true, + "license": "MIT", "dependencies": { "arg": "^5.0.2", "bluebird": "3.7.2", @@ -5867,15 +5266,13 @@ }, "node_modules/start-server-and-test/node_modules/arg": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/start-server-and-test/node_modules/execa": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -5896,9 +5293,8 @@ }, "node_modules/start-server-and-test/node_modules/get-stream": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -5908,27 +5304,24 @@ }, "node_modules/start-server-and-test/node_modules/human-signals": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=10.17.0" } }, "node_modules/stream-combiner": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==", "dev": true, + "license": "MIT", "dependencies": { "duplexer": "~0.1.1" } }, "node_modules/stream-connect": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-connect/-/stream-connect-1.0.2.tgz", - "integrity": "sha512-68Kl+79cE0RGKemKkhxTSg8+6AGrqBt+cbZAXevg2iJ6Y3zX4JhA/sZeGzLpxW9cXhmqAcE7KnJCisUmIUfnFQ==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^1.0.2" }, @@ -5938,9 +5331,8 @@ }, "node_modules/stream-connect/node_modules/array-back": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", "dev": true, + "license": "MIT", "dependencies": { "typical": "^2.6.0" }, @@ -5950,18 +5342,16 @@ }, "node_modules/stream-via": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", - "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/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", @@ -5974,9 +5364,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", @@ -5988,9 +5377,8 @@ }, "node_modules/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" }, @@ -6001,9 +5389,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" }, @@ -6013,27 +5400,24 @@ }, "node_modules/strip-bom": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/strip-final-newline": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/strip-json-comments": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -6043,9 +5427,8 @@ }, "node_modules/supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -6058,9 +5441,8 @@ }, "node_modules/table-layout": { "version": "0.4.5", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.5.tgz", - "integrity": "sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^2.0.0", "deep-extend": "~0.6.0", @@ -6074,9 +5456,8 @@ }, "node_modules/table-layout/node_modules/array-back": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, + "license": "MIT", "dependencies": { "typical": "^2.6.1" }, @@ -6086,14 +5467,10 @@ }, "node_modules/taffydb": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==", "dev": true }, "node_modules/tapable": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, "license": "MIT", "peer": true, @@ -6103,8 +5480,6 @@ }, "node_modules/tar": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "license": "ISC", "dependencies": { @@ -6121,14 +5496,11 @@ }, "node_modules/temp-path": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-path/-/temp-path-1.0.0.tgz", - "integrity": "sha512-TvmyH7kC6ZVTYkqCODjJIbgvu0FKiwQpZ4D1aknE7xpcDf/qEOB8KZEK5ef2pfbVoiBhNWs3yx4y+ESMtNYmlg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/terser": { "version": "5.37.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", - "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", "dev": true, "license": "BSD-2-Clause", "peer": true, @@ -6147,8 +5519,6 @@ }, "node_modules/terser-webpack-plugin": { "version": "5.3.11", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz", - "integrity": "sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ==", "dev": true, "license": "MIT", "peer": true, @@ -6183,8 +5553,6 @@ }, "node_modules/terser-webpack-plugin/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", "peer": true, @@ -6195,8 +5563,6 @@ }, "node_modules/terser-webpack-plugin/node_modules/ajv": { "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", "peer": true, @@ -6213,8 +5579,6 @@ }, "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", "dev": true, "license": "MIT", "peer": true, @@ -6227,16 +5591,12 @@ }, "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT", "peer": true }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", "dev": true, "license": "MIT", "peer": true, @@ -6256,8 +5616,6 @@ }, "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "license": "BSD-3-Clause", "peer": true, @@ -6267,17 +5625,14 @@ }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT", "peer": true }, "node_modules/test-value": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-3.0.0.tgz", - "integrity": "sha512-sVACdAWcZkSU9x7AOmJo5TqE+GyNJknHaHsMrR6ZnhjVlVN9Yx6FjHrsKZ3BjIpPCT68zYesPWkakrNupwfOTQ==", "dev": true, + "license": "MIT", "dependencies": { "array-back": "^2.0.0", "typical": "^2.6.1" @@ -6288,9 +5643,8 @@ }, "node_modules/test-value/node_modules/array-back": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, + "license": "MIT", "dependencies": { "typical": "^2.6.1" }, @@ -6300,24 +5654,21 @@ }, "node_modules/throttleit": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", - "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tldts": { "version": "6.1.84", - "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.84.tgz", - "integrity": "sha512-aRGIbCIF3teodtUFAYSdQONVmDRy21REM3o6JnqWn5ZkQBJJ4gHxhw6OfwQ+WkSAi3ASamrS4N4nyazWx6uTYg==", "dev": true, + "license": "MIT", "dependencies": { "tldts-core": "^6.1.84" }, @@ -6327,24 +5678,21 @@ }, "node_modules/tldts-core": { "version": "6.1.84", - "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.84.tgz", - "integrity": "sha512-NaQa1W76W2aCGjXybvnMYzGSM4x8fvG2AN/pla7qxcg0ZHbooOPhA8kctmOZUDfZyhDL27OGNbwAeig8P4p1vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tmp": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.14" } }, "node_modules/to-regex-range": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -6354,9 +5702,8 @@ }, "node_modules/tough-cookie": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", - "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "tldts": "^6.1.32" }, @@ -6366,23 +5713,20 @@ }, "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", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, + "license": "MIT", "bin": { "tree-kill": "cli.js" } }, "node_modules/trough": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", - "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -6390,9 +5734,8 @@ }, "node_modules/ts-mocha": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/ts-mocha/-/ts-mocha-9.0.2.tgz", - "integrity": "sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw==", "dev": true, + "license": "MIT", "dependencies": { "ts-node": "7.0.1" }, @@ -6411,18 +5754,16 @@ }, "node_modules/ts-mocha/node_modules/diff": { "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, "node_modules/ts-mocha/node_modules/json5": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "minimist": "^1.2.0" @@ -6433,9 +5774,8 @@ }, "node_modules/ts-mocha/node_modules/mkdirp": { "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.6" }, @@ -6445,9 +5785,8 @@ }, "node_modules/ts-mocha/node_modules/ts-node": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", - "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", "dev": true, + "license": "MIT", "dependencies": { "arrify": "^1.0.0", "buffer-from": "^1.1.0", @@ -6467,9 +5806,8 @@ }, "node_modules/ts-mocha/node_modules/tsconfig-paths": { "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/json5": "^0.0.29", @@ -6480,17 +5818,14 @@ }, "node_modules/ts-mocha/node_modules/yn": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/ts-node": { "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6533,18 +5868,16 @@ }, "node_modules/ts-node/node_modules/diff": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, "node_modules/tsconfig-paths": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz", - "integrity": "sha512-AHx4Euop/dXFC+Vx589alFba8QItjF+8hf8LtmuiCwHyI4rHXQtOOENaM8kvYf5fR0dRChy3wzWIZ9WbB7FWow==", "dev": true, + "license": "MIT", "dependencies": { "json5": "^2.2.1", "minimist": "^1.2.6", @@ -6556,15 +5889,13 @@ }, "node_modules/tslib": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true + "dev": true, + "license": "0BSD" }, "node_modules/tunnel-agent": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" }, @@ -6574,15 +5905,13 @@ }, "node_modules/tweetnacl": { "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true + "dev": true, + "license": "Unlicense" }, "node_modules/txm": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/txm/-/txm-8.1.0.tgz", - "integrity": "sha512-mVDmoN13jYX3igNcnS+TEJJmMIRLjn0wch/wOI23z5IkCKiw9xinv1WkugB55j57W8MfuEk/psVVO4BWMfZxfA==", "dev": true, + "license": "ISC", "dependencies": { "async": "^3.2.1", "diff-match-patch": "^1.0.5", @@ -6600,9 +5929,8 @@ }, "node_modules/txm/node_modules/supports-color": { "version": "9.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.3.tgz", - "integrity": "sha512-aszYUX/DVK/ed5rFLb/dDinVJrQjG/vmU433wtqVSD800rYsJNWxh2R3USV90aLSU+UsyQkbNeffVLzc6B6foA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -6612,9 +5940,8 @@ }, "node_modules/type-fest": { "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -6624,8 +5951,6 @@ }, "node_modules/typedoc": { "version": "0.27.6", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.6.tgz", - "integrity": "sha512-oBFRoh2Px6jFx366db0lLlihcalq/JzyCVp7Vaq1yphL/tbgx2e+bkpkCgJPunaPvPwoTOXSwasfklWHm7GfAw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -6647,8 +5972,6 @@ }, "node_modules/typedoc-plugin-markdown": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.4.1.tgz", - "integrity": "sha512-fx23nSCvewI9IR8lzIYtzDphETcgTDuxKcmHKGD4lo36oexC+B1k4NaCOY58Snqb4OlE8OXDAGVcQXYYuLRCNw==", "dev": true, "license": "MIT", "engines": { @@ -6660,8 +5983,6 @@ }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { @@ -6670,8 +5991,6 @@ }, "node_modules/typedoc/node_modules/entities": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -6683,8 +6002,6 @@ }, "node_modules/typedoc/node_modules/linkify-it": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6693,8 +6010,6 @@ }, "node_modules/typedoc/node_modules/markdown-it": { "version": "14.1.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", - "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", "dev": true, "license": "MIT", "dependencies": { @@ -6711,15 +6026,11 @@ }, "node_modules/typedoc/node_modules/mdurl": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", "dev": true, "license": "MIT" }, "node_modules/typedoc/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": { @@ -6734,15 +6045,12 @@ }, "node_modules/typedoc/node_modules/uc.micro": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", "dev": true, "license": "MIT" }, "node_modules/typescript": { "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6753,21 +6061,18 @@ }, "node_modules/typical": { "version": "2.6.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/uc.micro": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/uglify-js": { "version": "3.17.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.1.tgz", - "integrity": "sha512-+juFBsLLw7AqMaqJ0GFvlsGZwdQfI2ooKQB39PSBgMnMakcFosi9O8jCwE+2/2nMNcc0z63r9mwjoDG8zr+q0Q==", "dev": true, + "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -6778,21 +6083,17 @@ }, "node_modules/underscore": { "version": "1.13.4", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz", - "integrity": "sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/undici-types": { "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "license": "MIT" }, "node_modules/unified": { "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -6809,9 +6110,8 @@ }, "node_modules/unist-util-stringify-position": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.2.tgz", - "integrity": "sha512-7A6eiDCs9UtjcwZOcCpM4aPII3bAAGv13E96IkawkOAW0OhH+yRxtY0lzo8KiHpzEMfH7Q+FizUmwp8Iqy5EWg==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.0" }, @@ -6822,26 +6122,22 @@ }, "node_modules/universalify": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, "node_modules/untildify": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/update-browserslist-db": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", - "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", "dev": true, "funding": [ { @@ -6872,27 +6168,24 @@ }, "node_modules/uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/uuid": { "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/uvu": { "version": "0.5.6", - "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", - "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", "dev": true, + "license": "MIT", "dependencies": { "dequal": "^2.0.0", "diff": "^5.0.0", @@ -6908,25 +6201,21 @@ }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/valibot": { "version": "0.36.0", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.36.0.tgz", - "integrity": "sha512-CjF1XN4sUce8sBK9TixrDqFM7RwNkuXdJu174/AwmQUB62QbCQADg5lLe8ldBalFgtj1uKj+pKwDJiNo4Mn+eQ==", "license": "MIT", "peer": true }, "node_modules/verror": { "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "dev": true, "engines": [ "node >=0.6.0" ], + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -6935,9 +6224,8 @@ }, "node_modules/vfile": { "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.5.tgz", - "integrity": "sha512-U1ho2ga33eZ8y8pkbQLH54uKqGhFJ6GYIHnnG5AhRpAh3OWjkrRHKa/KogbmQn8We+c0KVV3rTOgR9V/WowbXQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -6951,9 +6239,8 @@ }, "node_modules/vfile-message": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz", - "integrity": "sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -6965,9 +6252,8 @@ }, "node_modules/wait-on": { "version": "8.0.3", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-8.0.3.tgz", - "integrity": "sha512-nQFqAFzZDeRxsu7S3C7LbuxslHhk+gnJZHyethuGKAn2IVleIbTB9I3vJSQiSR+DifUqmdzfPMoMPJfLqMF2vw==", "dev": true, + "license": "MIT", "dependencies": { "axios": "^1.8.2", "joi": "^17.13.3", @@ -6984,17 +6270,14 @@ }, "node_modules/walk-back": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-5.1.0.tgz", - "integrity": "sha512-Uhxps5yZcVNbLEAnb+xaEEMdgTXl9qAQDzKYejG2AZ7qPwRQ81lozY9ECDbjLPNWm7YsO1IK5rsP1KoQzXAcGA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12.17" } }, "node_modules/wasm-opt": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/wasm-opt/-/wasm-opt-1.4.0.tgz", - "integrity": "sha512-wIsxxp0/FOSphokH4VOONy1zPkVREQfALN+/JTvJPK8gFSKbsmrcfECu2hT7OowqPfb4WEMSMceHgNL0ipFRyw==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -7008,8 +6291,6 @@ }, "node_modules/watchpack": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", - "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "license": "MIT", "peer": true, @@ -7023,13 +6304,10 @@ }, "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/webpack": { "version": "5.97.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", - "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", "dev": true, "license": "MIT", "peer": true, @@ -7076,8 +6354,6 @@ }, "node_modules/webpack-sources": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true, "license": "MIT", "peer": true, @@ -7087,8 +6363,7 @@ }, "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" @@ -7096,9 +6371,8 @@ }, "node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -7111,15 +6385,13 @@ }, "node_modules/wordwrap": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/wordwrapjs": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-3.0.0.tgz", - "integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==", "dev": true, + "license": "MIT", "dependencies": { "reduce-flatten": "^1.0.1", "typical": "^2.6.1" @@ -7130,24 +6402,21 @@ }, "node_modules/wordwrapjs/node_modules/reduce-flatten": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-1.0.1.tgz", - "integrity": "sha512-j5WfFJfc9CoXv/WbwVLHq74i/hdTUpy+iNC534LxczMRP67vJeK3V9JOdnL0N1cIRbn9mYhE2yVjvvKXDxvNXQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/workerpool": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/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", @@ -7163,9 +6432,8 @@ "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", @@ -7180,35 +6448,29 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/xmlcreate": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", - "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/y18n": { "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yaml": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "dev": true, "license": "ISC", "bin": { @@ -7220,18 +6482,16 @@ }, "node_modules/yargs-parser": { "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yargs-unparser": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, + "license": "MIT", "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", @@ -7244,18 +6504,16 @@ }, "node_modules/yargs-unparser/node_modules/is-plain-obj": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/yauzl": { "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, + "license": "MIT", "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" @@ -7263,18 +6521,16 @@ }, "node_modules/yn": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/yocto-queue": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -7282,5228 +6538,5 @@ "url": "https://github.com/sponsors/sindresorhus" } } - }, - "dependencies": { - "@0no-co/graphql.web": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@0no-co/graphql.web/-/graphql.web-1.1.2.tgz", - "integrity": "sha512-N2NGsU5FLBhT8NZ+3l2YrzZSHITjNXNuDhC4iDiikv0IujaJ0Xc6xIxQZ/Ek3Cb+rgPjnLHYyJm11tInuJn+cw==", - "peer": true, - "requires": {} - }, - "@0no-co/graphqlsp": { - "version": "1.12.16", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.16.tgz", - "integrity": "sha512-B5pyYVH93Etv7xjT6IfB7QtMBdaaC07yjbhN6v8H7KgFStMkPvi+oWYBTibMFRMY89qwc9H8YixXg8SXDVgYWw==", - "peer": true, - "requires": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - } - }, - "@babel/parser": { - "version": "7.21.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.1.tgz", - "integrity": "sha512-JzhBFpkuhBNYUY7qs+wTzNmyCWUHEaAFpQQD2YfU1rPL38/L43Wvid0fFkiOCnHvsGncRZgEPyGnltABLcVDTg==", - "dev": true - }, - "@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "optional": true - }, - "@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "0.3.9" - } - }, - "@cypress/request": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.8.tgz", - "integrity": "sha512-h0NFgh1mJmm1nr4jCwkGHwKneVYKghUyWe6TMNrk0B9zsjAJxpg8C4/+BAcmLgCPa1vj1V8rNUaILl+zYRUWBQ==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~4.0.0", - "http-signature": "~1.4.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "performance-now": "^2.1.0", - "qs": "6.14.0", - "safe-buffer": "^5.1.2", - "tough-cookie": "^5.0.0", - "tunnel-agent": "^0.6.0", - "uuid": "^8.3.2" - }, - "dependencies": { - "form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "mime-types": "^2.1.12" - } - } - } - }, - "@cypress/xvfb": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", - "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "lodash.once": "^4.1.1" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, - "@gerrit0/mini-shiki": { - "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.27.2.tgz", - "integrity": "sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==", - "dev": true, - "requires": { - "@shikijs/engine-oniguruma": "^1.27.2", - "@shikijs/types": "^1.27.2", - "@shikijs/vscode-textmate": "^10.0.1" - } - }, - "@gql.tada/cli-utils": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.6.3.tgz", - "integrity": "sha512-jFFSY8OxYeBxdKi58UzeMXG1tdm4FVjXa8WHIi66Gzu9JWtCE6mqom3a8xkmSw+mVaybFW5EN2WXf1WztJVNyQ==", - "peer": true, - "requires": { - "@0no-co/graphqlsp": "^1.12.13", - "@gql.tada/internal": "1.0.8", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - } - }, - "@gql.tada/internal": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.8.tgz", - "integrity": "sha512-XYdxJhtHC5WtZfdDqtKjcQ4d7R1s0d1rnlSs3OcBEUbYiPoJJfZU7tWsVXuv047Z6msvmr4ompJ7eLSK5Km57g==", - "peer": true, - "requires": { - "@0no-co/graphql.web": "^1.0.5" - } - }, - "@graphql-typed-document-node/core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "peer": true, - "requires": {} - }, - "@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", - "dev": true - }, - "@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "dev": true, - "requires": { - "@hapi/hoek": "^9.0.0" - } - }, - "@iota/bcs": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@iota/bcs/-/bcs-0.2.1.tgz", - "integrity": "sha512-T+iv5gZhUZP7BiDY7+Ir4MA2rYmyGNZA2b+nxjv219Fp8klFt+l38OWA+1RgJXrCmzuZ+M4hbMAeHhHziURX6Q==", - "peer": true, - "requires": { - "bs58": "^6.0.0" - } - }, - "@iota/iota-interaction-ts": { - "version": "file:../iota_interaction_ts", - "requires": { - "@types/node": "^22.0.0", - "dprint": "^0.33.0", - "rimraf": "^6.0.1", - "tsconfig-paths": "^4.1.0", - "typescript": "^5.7.3", - "wasm-opt": "^1.4.0" - } - }, - "@iota/iota-sdk": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@iota/iota-sdk/-/iota-sdk-0.6.0.tgz", - "integrity": "sha512-NEYiE7bdWw2DA3vLV7dO2EnoLDljN9NPhYrjfDGefTbIS9XpqX0JZTHMi//Q/K0aO4NwSHR5gu7n/ywoOTzTKg==", - "peer": true, - "requires": { - "@graphql-typed-document-node/core": "^3.2.0", - "@iota/bcs": "0.2.1", - "@noble/curves": "^1.4.2", - "@noble/hashes": "^1.4.0", - "@scure/bip32": "^1.4.0", - "@scure/bip39": "^1.3.0", - "@suchipi/femver": "^1.0.0", - "bech32": "^2.0.0", - "gql.tada": "^1.8.2", - "graphql": "^16.9.0", - "tweetnacl": "^1.0.3", - "valibot": "^0.36.0" - }, - "dependencies": { - "tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "peer": true - } - } - }, - "@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, - "requires": { - "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" - }, - "dependencies": { - "ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true - }, - "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 - }, - "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 - }, - "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, - "requires": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - } - }, - "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, - "requires": { - "ansi-regex": "^6.0.1" - } - }, - "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, - "requires": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - } - } - } - }, - "@jridgewell/gen-mapping": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", - "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", - "dev": true, - "peer": true, - "requires": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "dependencies": { - "@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, - "peer": true, - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - } - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true - }, - "@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, - "peer": true - }, - "@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, - "peer": true, - "requires": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - }, - "dependencies": { - "@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, - "peer": true, - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - } - } - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "@noble/curves": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", - "peer": true, - "requires": { - "@noble/hashes": "1.7.1" - } - }, - "@noble/ed25519": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.7.3.tgz", - "integrity": "sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==" - }, - "@noble/hashes": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", - "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==" - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@scure/base": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz", - "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==", - "peer": true - }, - "@scure/bip32": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", - "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", - "peer": true, - "requires": { - "@noble/curves": "~1.8.1", - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.2" - } - }, - "@scure/bip39": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", - "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", - "peer": true, - "requires": { - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.4" - } - }, - "@shikijs/engine-oniguruma": { - "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.27.2.tgz", - "integrity": "sha512-FZYKD1KN7srvpkz4lbGLOYWlyDU4Rd+2RtuKfABTkafAPOFr+J6umfIwY/TzOQqfNtWjL7SAwPAO0dcOraRLaQ==", - "dev": true, - "requires": { - "@shikijs/types": "1.27.2", - "@shikijs/vscode-textmate": "^10.0.1" - } - }, - "@shikijs/types": { - "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.27.2.tgz", - "integrity": "sha512-DM9OWUyjmdYdnKDpaGB/GEn9XkToyK1tqxuqbmc5PV+5K8WjjwfygL3+cIvbkSw2v1ySwHDgqATq/+98pJ4Kyg==", - "dev": true, - "requires": { - "@shikijs/vscode-textmate": "^10.0.1", - "@types/hast": "^3.0.4" - } - }, - "@shikijs/vscode-textmate": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz", - "integrity": "sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==", - "dev": true - }, - "@sideway/address": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", - "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", - "dev": true, - "requires": { - "@hapi/hoek": "^9.0.0" - } - }, - "@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", - "dev": true - }, - "@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", - "dev": true - }, - "@suchipi/femver": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", - "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==", - "peer": true - }, - "@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true - }, - "@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true - }, - "@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true - }, - "@tsconfig/node16": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", - "dev": true - }, - "@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "dev": true, - "requires": { - "@types/ms": "*" - } - }, - "@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dev": true, - "peer": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "peer": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "@types/estree": { - "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, - "peer": true - }, - "@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "requires": { - "@types/unist": "*" - } - }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true, - "optional": true - }, - "@types/jsonwebtoken": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.7.tgz", - "integrity": "sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/linkify-it": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", - "dev": true - }, - "@types/markdown-it": { - "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", - "dev": true, - "requires": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - } - }, - "@types/mdast": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz", - "integrity": "sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==", - "dev": true, - "requires": { - "@types/unist": "*" - } - }, - "@types/mdurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", - "dev": true - }, - "@types/mocha": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", - "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", - "dev": true - }, - "@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", - "dev": true - }, - "@types/node": { - "version": "22.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", - "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", - "requires": { - "undici-types": "~6.20.0" - } - }, - "@types/node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "@types/sinonjs__fake-timers": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", - "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true - }, - "@types/sizzle": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", - "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true - }, - "@types/unist": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", - "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", - "dev": true - }, - "@types/yauzl": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", - "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", - "dev": true, - "optional": true, - "requires": { - "@types/node": "*" - } - }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, - "@webassemblyjs/ast": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", - "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/helper-numbers": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", - "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", - "dev": true, - "peer": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", - "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", - "dev": true, - "peer": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", - "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", - "dev": true, - "peer": true - }, - "@webassemblyjs/helper-numbers": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", - "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.13.2", - "@webassemblyjs/helper-api-error": "1.13.2", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", - "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", - "dev": true, - "peer": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", - "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/wasm-gen": "1.14.1" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", - "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", - "dev": true, - "peer": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", - "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", - "dev": true, - "peer": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", - "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", - "dev": true, - "peer": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", - "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/helper-wasm-section": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-opt": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1", - "@webassemblyjs/wast-printer": "1.14.1" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", - "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", - "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", - "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-api-error": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", - "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", - "dev": true, - "peer": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@xtuc/long": "4.2.2" - } - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true, - "peer": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true, - "peer": true - }, - "acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "dev": true - }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^8.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - } - } - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} - }, - "ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true - }, - "ansi-escape-sequences": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz", - "integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==", - "dev": true, - "requires": { - "array-back": "^3.0.1" - }, - "dependencies": { - "array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true - } - } - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "requires": { - "type-fest": "^0.21.3" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "arch": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", - "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", - "dev": true - }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", - "dev": true - }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, - "async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true - }, - "aws4": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", - "dev": true - }, - "axios": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", - "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", - "dev": true, - "requires": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - }, - "dependencies": { - "form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "mime-types": "^2.1.12" - } - }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - } - } - }, - "bail": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", - "dev": true - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "base-x": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz", - "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==", - "peer": true - }, - "base64-arraybuffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==" - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bech32": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", - "peer": true - }, - "big-integer": { - "version": "1.6.51", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", - "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", - "dev": true - }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "blob-util": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", - "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "browserslist": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", - "dev": true, - "peer": true, - "requires": { - "caniuse-lite": "^1.0.30001688", - "electron-to-chromium": "^1.5.73", - "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.1" - } - }, - "bs58": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", - "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", - "peer": true, - "requires": { - "base-x": "^5.0.0" - } - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "cache-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-2.0.0.tgz", - "integrity": "sha512-4gkeHlFpSKgm3vm2gJN5sPqfmijYRFYCQ6tv5cLw0xVmT6r1z1vd4FNnpuOREco3cBs1G709sZ72LdgddKvL5w==", - "dev": true, - "requires": { - "array-back": "^4.0.1", - "fs-then-native": "^2.0.0", - "mkdirp2": "^1.0.4" - }, - "dependencies": { - "array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "dev": true - } - } - }, - "cachedir": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", - "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", - "dev": true - }, - "call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "requires": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - } - }, - "call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, - "requires": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - } - }, - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true - }, - "caniuse-lite": { - "version": "1.0.30001692", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz", - "integrity": "sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==", - "dev": true, - "peer": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true - }, - "catharsis": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", - "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", - "dev": true, - "requires": { - "lodash": "^4.17.15" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "character-entities": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", - "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", - "dev": true - }, - "check-more-types": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", - "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", - "dev": true - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", - "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", - "dev": true, - "peer": true - }, - "ci-info": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.2.0.tgz", - "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==", - "dev": true - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-table3": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", - "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", - "dev": true, - "requires": { - "@colors/colors": "1.5.0", - "string-width": "^4.2.0" - } - }, - "cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "requires": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "collect-all": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/collect-all/-/collect-all-1.0.4.tgz", - "integrity": "sha512-RKZhRwJtJEP5FWul+gkSMEnaK6H3AGPTTWOiRimCcs+rc/OmQE3Yhy1Q7A7KsdkG3ZXVdZq68Y6ONSdvkeEcKA==", - "dev": true, - "requires": { - "stream-connect": "^1.0.2", - "stream-via": "^1.0.4" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "dev": true, - "requires": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, - "dependencies": { - "array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true - }, - "typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "dev": true - } - } - }, - "command-line-tool": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/command-line-tool/-/command-line-tool-0.8.0.tgz", - "integrity": "sha512-Xw18HVx/QzQV3Sc5k1vy3kgtOeGmsKIqwtFFoyjI4bbcpSgnw2CWVULvtakyw4s6fhyAdI6soQQhXc2OzJy62g==", - "dev": true, - "requires": { - "ansi-escape-sequences": "^4.0.0", - "array-back": "^2.0.0", - "command-line-args": "^5.0.0", - "command-line-usage": "^4.1.0", - "typical": "^2.6.1" - }, - "dependencies": { - "array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "requires": { - "typical": "^2.6.1" - } - } - } - }, - "command-line-usage": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-4.1.0.tgz", - "integrity": "sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g==", - "dev": true, - "requires": { - "ansi-escape-sequences": "^4.0.0", - "array-back": "^2.0.0", - "table-layout": "^0.4.2", - "typical": "^2.6.1" - }, - "dependencies": { - "array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "requires": { - "typical": "^2.6.1" - } - } - } - }, - "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "dev": true - }, - "common-sequence": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-2.0.2.tgz", - "integrity": "sha512-jAg09gkdkrDO9EWTdXfv80WWH3yeZl5oT69fGfedBNS9pXUKYInVJ1bJ+/ht2+Moeei48TmSbQDYMc8EOx9G0g==", - "dev": true - }, - "common-tags": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", - "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "config-master": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", - "integrity": "sha512-n7LBL1zBzYdTpF1mx5DNcZnZn05CWIdsdvtPL4MosvqbBUK3Rq6VWEtGUuF3Y0s9/CIhMejezqlSkP6TnCJ/9g==", - "dev": true, - "requires": { - "walk-back": "^2.0.1" - }, - "dependencies": { - "walk-back": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-2.0.1.tgz", - "integrity": "sha512-Nb6GvBR8UWX1D+Le+xUq0+Q1kFmRBIWVrfLnQAOmcpEzA9oAxwJ9gIr36t9TWYfzvWRvuMtjHiVsJYEkXWaTAQ==", - "dev": true - } - } - }, - "copy-webpack-plugin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-7.0.0.tgz", - "integrity": "sha512-SLjQNa5iE3BoCP76ESU9qYo9ZkEWtXoZxDurHoqPchAFRblJ9g96xTeC560UXBMre1Nx6ixIIUfiY3VcjpJw3g==", - "dev": true, - "requires": { - "fast-glob": "^3.2.4", - "glob-parent": "^5.1.1", - "globby": "^11.0.1", - "loader-utils": "^2.0.0", - "normalize-path": "^3.0.0", - "p-limit": "^3.0.2", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, - "create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "cypress": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-14.2.0.tgz", - "integrity": "sha512-u7fuc9JEpSYLOdu8mzZDZ/JWsHUzR5pc8i1TeSqMz/bafXp+6IweMAeyphsEJ6/13qbB6nwTEY1m+GUAp6GqCQ==", - "dev": true, - "requires": { - "@cypress/request": "^3.0.7", - "@cypress/xvfb": "^1.2.4", - "@types/sinonjs__fake-timers": "8.1.1", - "@types/sizzle": "^2.3.2", - "arch": "^2.2.0", - "blob-util": "^2.0.2", - "bluebird": "^3.7.2", - "buffer": "^5.7.1", - "cachedir": "^2.3.0", - "chalk": "^4.1.0", - "check-more-types": "^2.24.0", - "ci-info": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-table3": "~0.6.5", - "commander": "^6.2.1", - "common-tags": "^1.8.0", - "dayjs": "^1.10.4", - "debug": "^4.3.4", - "enquirer": "^2.3.6", - "eventemitter2": "6.4.7", - "execa": "4.1.0", - "executable": "^4.1.1", - "extract-zip": "2.0.1", - "figures": "^3.2.0", - "fs-extra": "^9.1.0", - "getos": "^3.2.1", - "is-installed-globally": "~0.4.0", - "lazy-ass": "^1.6.0", - "listr2": "^3.8.3", - "lodash": "^4.17.21", - "log-symbols": "^4.0.0", - "minimist": "^1.2.8", - "ospath": "^1.2.2", - "pretty-bytes": "^5.6.0", - "process": "^0.11.10", - "proxy-from-env": "1.0.0", - "request-progress": "^3.0.0", - "semver": "^7.5.3", - "supports-color": "^8.1.1", - "tmp": "~0.2.3", - "tree-kill": "1.2.2", - "untildify": "^4.0.0", - "yauzl": "^2.10.0" - }, - "dependencies": { - "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - } - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "dayjs": { - "version": "1.11.11", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", - "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==", - "dev": true - }, - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true - }, - "decode-named-character-reference": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", - "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", - "dev": true, - "requires": { - "character-entities": "^2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" - }, - "dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "dev": true - }, - "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true - }, - "diff-match-patch": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.5.tgz", - "integrity": "sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "dmd": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/dmd/-/dmd-6.1.0.tgz", - "integrity": "sha512-0zQIJ873gay1scCTFZvHPWM9mVJBnaylB2NQDI8O9u8O32m00Jb6uxDKexZm8hjTRM7RiWe0FJ32pExHoXdwoQ==", - "dev": true, - "requires": { - "array-back": "^6.2.2", - "cache-point": "^2.0.0", - "common-sequence": "^2.0.2", - "file-set": "^4.0.2", - "handlebars": "^4.7.7", - "marked": "^4.0.12", - "object-get": "^2.1.1", - "reduce-flatten": "^3.0.1", - "reduce-unique": "^2.0.1", - "reduce-without": "^1.0.1", - "test-value": "^3.0.0", - "walk-back": "^5.1.0" - } - }, - "dprint": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.33.0.tgz", - "integrity": "sha512-VploASP7wL1HAYe5xWZKRwp8gW5zTdcG3Tb60DASv6QLnGKsl+OS+bY7wsXFrS4UcIbUNujXdsNG5FxBfRJIQg==", - "dev": true, - "requires": { - "yauzl": "=2.10.0" - } - }, - "dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "requires": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - } - }, - "duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true - }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "electron-to-chromium": { - "version": "1.5.80", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.80.tgz", - "integrity": "sha512-LTrKpW0AqIuHwmlVNV+cjFYTnXtM9K37OGhpe0ZI10ScPSxqVSryZHIY3WnCS5NSYbBODRTZyhRMS2h5FAEqAw==", - "dev": true, - "peer": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "enhanced-resolve": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", - "integrity": "sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==", - "dev": true, - "peer": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - } - }, - "enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - } - }, - "entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true - }, - "es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true - }, - "es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true - }, - "es-module-lexer": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", - "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", - "dev": true, - "peer": true - }, - "es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, - "requires": { - "es-errors": "^1.3.0" - } - }, - "es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, - "requires": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - } - }, - "escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true - }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==", - "dev": true, - "requires": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, - "eventemitter2": { - "version": "6.4.7", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", - "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "peer": true - }, - "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - } - }, - "executable": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", - "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", - "dev": true, - "requires": { - "pify": "^2.2.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "requires": { - "@types/yauzl": "^2.9.1", - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.5.tgz", - "integrity": "sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q==", - "dev": true, - "peer": true - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "requires": { - "pend": "~1.2.0" - } - }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-set": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/file-set/-/file-set-4.0.2.tgz", - "integrity": "sha512-fuxEgzk4L8waGXaAkd8cMr73Pm0FxOVkn8hztzUW7BAHhOGH90viQNXbiOsnecCWmfInqU6YmAMwxRMdKETceQ==", - "dev": true, - "requires": { - "array-back": "^5.0.0", - "glob": "^7.1.6" - }, - "dependencies": { - "array-back": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", - "dev": true - } - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, - "requires": { - "array-back": "^3.0.1" - }, - "dependencies": { - "array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true - } - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, - "follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "dev": true - }, - "foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "dependencies": { - "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 - } - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true - }, - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==", - "dev": true - }, - "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==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "requires": { - "minipass": "^3.0.0" - }, - "dependencies": { - "minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - } - } - }, - "fs-then-native": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fs-then-native/-/fs-then-native-2.0.0.tgz", - "integrity": "sha512-X712jAOaWXkemQCAmWeg5rOT2i+KOpWz1Z/txk/cW0qlOu2oQ9H61vc5w3X/iyuUEfq/OyaFJ78/cZAQD1/bgA==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "requires": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - } - }, - "get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "requires": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - } - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "getos": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", - "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", - "dev": true, - "requires": { - "async": "^3.2.0" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true, - "peer": true - }, - "global-dirs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", - "dev": true, - "requires": { - "ini": "2.0.0" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true - }, - "gql.tada": { - "version": "1.8.10", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.8.10.tgz", - "integrity": "sha512-FrvSxgz838FYVPgZHGOSgbpOjhR+yq44rCzww3oOPJYi0OvBJjAgCiP6LEokZIYND2fUTXzQAyLgcvgw1yNP5A==", - "peer": true, - "requires": { - "@0no-co/graphql.web": "^1.0.5", - "@0no-co/graphqlsp": "^1.12.13", - "@gql.tada/cli-utils": "1.6.3", - "@gql.tada/internal": "1.0.8" - } - }, - "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 - }, - "graphql": { - "version": "16.10.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", - "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", - "peer": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", - "dev": true, - "requires": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4", - "wordwrap": "^1.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true - }, - "has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.3" - } - }, - "hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "requires": { - "function-bind": "^1.1.2" - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "http-signature": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", - "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^2.0.2", - "sshpk": "^1.18.0" - } - }, - "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "dev": true, - "requires": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true - }, - "is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "dev": true - }, - "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, - "jackspeak": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.0.tgz", - "integrity": "sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==", - "dev": true, - "requires": { - "@isaacs/cliui": "^8.0.2" - } - }, - "jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, - "peer": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - } - }, - "joi": { - "version": "17.13.3", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", - "integrity": "sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==", - "dev": true, - "requires": { - "@hapi/hoek": "^9.3.0", - "@hapi/topo": "^5.1.0", - "@sideway/address": "^4.1.5", - "@sideway/formula": "^3.0.1", - "@sideway/pinpoint": "^2.0.0" - } - }, - "jose": { - "version": "5.9.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.6.tgz", - "integrity": "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==" - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "js2xmlparser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", - "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", - "dev": true, - "requires": { - "xmlcreate": "^2.0.4" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, - "jsdoc": { - "version": "3.6.11", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz", - "integrity": "sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg==", - "dev": true, - "requires": { - "@babel/parser": "^7.9.4", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "taffydb": "2.6.2", - "underscore": "~1.13.2" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - } - } - }, - "jsdoc-api": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-7.1.1.tgz", - "integrity": "sha512-0pkuPCzVXiqsDAsVrNFXCkHzlyNepBIDVtwwehry4RJAnZmXtlAz7rh8F9FRz53u3NeynGbex+bpYWwi8lE66A==", - "dev": true, - "requires": { - "array-back": "^6.2.2", - "cache-point": "^2.0.0", - "collect-all": "^1.0.4", - "file-set": "^4.0.2", - "fs-then-native": "^2.0.0", - "jsdoc": "^3.6.10", - "object-to-spawn-args": "^2.0.1", - "temp-path": "^1.0.0", - "walk-back": "^5.1.0" - } - }, - "jsdoc-parse": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.1.0.tgz", - "integrity": "sha512-n/hDGQJa69IBun1yZAjqzV4gVR41+flZ3bIlm9fKvNe2Xjsd1/+zCo2+R9ls8LxtePgIWbpA1jU7xkB2lRdLLg==", - "dev": true, - "requires": { - "array-back": "^6.2.2", - "lodash.omit": "^4.5.0", - "lodash.pick": "^4.4.0", - "reduce-extract": "^1.0.0", - "sort-array": "^4.1.4", - "test-value": "^3.0.0" - } - }, - "jsdoc-to-markdown": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-7.1.1.tgz", - "integrity": "sha512-CI86d63xAVNO+ENumWwmJ034lYe5iGU5GwjtTA11EuphP9tpnoi4hrKgR/J8uME0D+o4KUpVfwX1fjZhc8dEtg==", - "dev": true, - "requires": { - "array-back": "^6.2.2", - "command-line-tool": "^0.8.0", - "config-master": "^3.1.0", - "dmd": "^6.1.0", - "jsdoc-api": "^7.1.1", - "jsdoc-parse": "^6.1.0", - "walk-back": "^5.1.0" - } - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "peer": true - }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, - "json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "jsprim": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", - "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, - "klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "dev": true - }, - "lazy-ass": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", - "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", - "dev": true - }, - "linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", - "dev": true, - "requires": { - "uc.micro": "^1.0.1" - } - }, - "listr2": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", - "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", - "dev": true, - "requires": { - "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", - "log-update": "^4.0.0", - "p-map": "^4.0.0", - "rfdc": "^1.3.0", - "rxjs": "^7.5.1", - "through": "^2.3.8", - "wrap-ansi": "^7.0.0" - } - }, - "loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true, - "peer": true - }, - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true - }, - "lodash.omit": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", - "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", - "dev": true - }, - "lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true - }, - "lodash.padend": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", - "integrity": "sha512-sOQs2aqGpbl27tmCS1QNZA09Uqp01ZzWfDUoD+xzTii0E7dSQfRKcRetFwa+uXaxaqL+TKm7CgD2JdKP7aZBSw==", - "dev": true - }, - "lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", - "dev": true - }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - } - }, - "log-update": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", - "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", - "dev": true, - "requires": { - "ansi-escapes": "^4.3.0", - "cli-cursor": "^3.1.0", - "slice-ansi": "^4.0.0", - "wrap-ansi": "^6.2.0" - }, - "dependencies": { - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - } - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==", - "dev": true - }, - "markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "dev": true, - "requires": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - } - }, - "markdown-it-anchor": { - "version": "8.6.5", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.5.tgz", - "integrity": "sha512-PI1qEHHkTNWT+X6Ip9w+paonfIQ+QZP9sCeMYi47oqhH+EsW8CrJ8J7CzV19QVOj6il8ATGbK2nTECj22ZHGvQ==", - "dev": true, - "requires": {} - }, - "marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", - "dev": true - }, - "math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true - }, - "mdast-util-from-markdown": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz", - "integrity": "sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "decode-named-character-reference": "^1.0.0", - "mdast-util-to-string": "^3.1.0", - "micromark": "^3.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-decode-string": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "unist-util-stringify-position": "^3.0.0", - "uvu": "^0.5.0" - } - }, - "mdast-util-to-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz", - "integrity": "sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==", - "dev": true - }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromark": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.0.10.tgz", - "integrity": "sha512-ryTDy6UUunOXy2HPjelppgJ2sNfcPz1pLlMdA6Rz9jPzhLikWXv/irpWV/I2jd68Uhmny7hHxAlAhk4+vWggpg==", - "dev": true, - "requires": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" - } - }, - "micromark-core-commonmark": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz", - "integrity": "sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA==", - "dev": true, - "requires": { - "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" - } - }, - "micromark-factory-destination": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz", - "integrity": "sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw==", - "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "micromark-factory-label": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.0.2.tgz", - "integrity": "sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg==", - "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } - }, - "micromark-factory-space": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz", - "integrity": "sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew==", - "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "micromark-factory-title": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz", - "integrity": "sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A==", - "dev": true, - "requires": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } - }, - "micromark-factory-whitespace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.0.0.tgz", - "integrity": "sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A==", - "dev": true, - "requires": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "micromark-util-character": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.1.0.tgz", - "integrity": "sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg==", - "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "micromark-util-chunked": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.0.0.tgz", - "integrity": "sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g==", - "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0" - } - }, - "micromark-util-classify-character": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.0.0.tgz", - "integrity": "sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA==", - "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "micromark-util-combine-extensions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz", - "integrity": "sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA==", - "dev": true, - "requires": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "micromark-util-decode-numeric-character-reference": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz", - "integrity": "sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w==", - "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0" - } - }, - "micromark-util-decode-string": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.0.2.tgz", - "integrity": "sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q==", - "dev": true, - "requires": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-symbol": "^1.0.0" - } - }, - "micromark-util-encode": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.0.1.tgz", - "integrity": "sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA==", - "dev": true - }, - "micromark-util-html-tag-name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.1.0.tgz", - "integrity": "sha512-BKlClMmYROy9UiV03SwNmckkjn8QHVaWkqoAqzivabvdGcwNGMMMH/5szAnywmsTBUzDsU57/mFi0sp4BQO6dA==", - "dev": true - }, - "micromark-util-normalize-identifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.0.0.tgz", - "integrity": "sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg==", - "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0" - } - }, - "micromark-util-resolve-all": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz", - "integrity": "sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw==", - "dev": true, - "requires": { - "micromark-util-types": "^1.0.0" - } - }, - "micromark-util-sanitize-uri": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.0.0.tgz", - "integrity": "sha512-cCxvBKlmac4rxCGx6ejlIviRaMKZc0fWm5HdCHEeDWRSkn44l6NdYVRyU+0nT1XC72EQJMZV8IPHF+jTr56lAg==", - "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-symbol": "^1.0.0" - } - }, - "micromark-util-subtokenize": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.0.2.tgz", - "integrity": "sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA==", - "dev": true, - "requires": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } - }, - "micromark-util-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.0.1.tgz", - "integrity": "sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ==", - "dev": true - }, - "micromark-util-types": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.0.2.tgz", - "integrity": "sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { - "mime-db": "1.52.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true - }, - "minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dev": true, - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "dependencies": { - "minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - } - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - }, - "mkdirp2": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mkdirp2/-/mkdirp2-1.0.5.tgz", - "integrity": "sha512-xOE9xbICroUDmG1ye2h4bZ8WBie9EGmACaco8K8cx6RlkJJrxGIqjGqztAI+NMhexXBcdGbSEzI6N3EJPevxZw==", - "dev": true - }, - "mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", - "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "4.2.1", - "ms": "2.1.3", - "nanoid": "3.3.1", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "dependencies": { - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "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 - } - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - } - } - }, - "mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", - "dev": true - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "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==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", - "dev": true, - "peer": true - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - }, - "object-get": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-get/-/object-get-2.1.1.tgz", - "integrity": "sha512-7n4IpLMzGGcLEMiQKsNR7vCe+N5E9LORFrtNUVy4sO3dj9a3HedZCxEL2T7QuLhcHN1NBuBsMOKaOsAYI9IIvg==", - "dev": true - }, - "object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true - }, - "object-to-spawn-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", - "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "ospath": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", - "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "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 - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, - "requires": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "dependencies": { - "lru-cache": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", - "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", - "dev": true - }, - "minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true - } - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", - "dev": true, - "requires": { - "through": "~2.3" - } - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, - "picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "peer": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true - }, - "pretty-bytes": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", - "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true - }, - "proxy-from-env": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", - "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true - }, - "ps-tree": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", - "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", - "dev": true, - "requires": { - "event-stream": "=3.3.4" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "punycode.js": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", - "dev": true - }, - "qs": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", - "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", - "dev": true, - "requires": { - "side-channel": "^1.1.0" - } - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "reduce-extract": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/reduce-extract/-/reduce-extract-1.0.0.tgz", - "integrity": "sha512-QF8vjWx3wnRSL5uFMyCjDeDc5EBMiryoT9tz94VvgjKfzecHAVnqmXAwQDcr7X4JmLc2cjkjFGCVzhMqDjgR9g==", - "dev": true, - "requires": { - "test-value": "^1.0.1" - }, - "dependencies": { - "array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "requires": { - "typical": "^2.6.0" - } - }, - "test-value": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-1.1.0.tgz", - "integrity": "sha512-wrsbRo7qP+2Je8x8DsK8ovCGyxe3sYfQwOraIY/09A2gFXU9DYKiTF14W4ki/01AEh56kMzAmlj9CaHGDDUBJA==", - "dev": true, - "requires": { - "array-back": "^1.0.2", - "typical": "^2.4.2" - } - } - } - }, - "reduce-flatten": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.1.tgz", - "integrity": "sha512-bYo+97BmUUOzg09XwfkwALt4PQH1M5L0wzKerBt6WLm3Fhdd43mMS89HiT1B9pJIqko/6lWx3OnV4J9f2Kqp5Q==", - "dev": true - }, - "reduce-unique": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/reduce-unique/-/reduce-unique-2.0.1.tgz", - "integrity": "sha512-x4jH/8L1eyZGR785WY+ePtyMNhycl1N2XOLxhCbzZFaqF4AXjLzqSxa2UHgJ2ZVR/HHyPOvl1L7xRnW8ye5MdA==", - "dev": true - }, - "reduce-without": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-without/-/reduce-without-1.0.1.tgz", - "integrity": "sha512-zQv5y/cf85sxvdrKPlfcRzlDn/OqKFThNimYmsS3flmkioKvkUGn2Qg9cJVoQiEvdxFGLE0MQER/9fZ9sUqdxg==", - "dev": true, - "requires": { - "test-value": "^2.0.0" - }, - "dependencies": { - "array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "requires": { - "typical": "^2.6.0" - } - }, - "test-value": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", - "dev": true, - "requires": { - "array-back": "^1.0.3", - "typical": "^2.6.0" - } - } - } - }, - "remark-parse": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.1.tgz", - "integrity": "sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-from-markdown": "^1.0.0", - "unified": "^10.0.0" - } - }, - "request-progress": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", - "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", - "dev": true, - "requires": { - "throttleit": "^1.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true - }, - "requizzle": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", - "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rfdc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", - "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true - }, - "rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", - "dev": true, - "requires": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "glob": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz", - "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==", - "dev": true, - "requires": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - } - }, - "minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true - } - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "rxjs": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", - "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", - "dev": true, - "requires": { - "tslib": "^2.1.0" - } - }, - "sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "dev": true, - "requires": { - "mri": "^1.1.0" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, - "requires": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - } - }, - "side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, - "requires": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - } - }, - "side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, - "requires": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - } - }, - "side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, - "requires": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - } - }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "sort-array": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/sort-array/-/sort-array-4.1.5.tgz", - "integrity": "sha512-Ya4peoS1fgFN42RN1REk2FgdNOeLIEMKFGJvs7VTP3OklF8+kl2SkpVliZ4tk/PurWsrWRsdNdU+tgyOBkB9sA==", - "dev": true, - "requires": { - "array-back": "^5.0.0", - "typical": "^6.0.1" - }, - "dependencies": { - "array-back": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", - "dev": true - }, - "typical": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-6.0.1.tgz", - "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", - "dev": true - } - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==", - "dev": true, - "requires": { - "through": "2" - } - }, - "sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "start-server-and-test": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.11.tgz", - "integrity": "sha512-TN39gLzPhHAflxyOkE/oMfQGj+pj3JgF6qVicFH/JrXt7xXktidKXwqfRga+ve7lVA8+RgPZVc25VrEPRScaDw==", - "dev": true, - "requires": { - "arg": "^5.0.2", - "bluebird": "3.7.2", - "check-more-types": "2.24.0", - "debug": "4.4.0", - "execa": "5.1.1", - "lazy-ass": "1.6.0", - "ps-tree": "1.2.0", - "wait-on": "8.0.3" - }, - "dependencies": { - "arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true - } - } - }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==", - "dev": true, - "requires": { - "duplexer": "~0.1.1" - } - }, - "stream-connect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-connect/-/stream-connect-1.0.2.tgz", - "integrity": "sha512-68Kl+79cE0RGKemKkhxTSg8+6AGrqBt+cbZAXevg2iJ6Y3zX4JhA/sZeGzLpxW9cXhmqAcE7KnJCisUmIUfnFQ==", - "dev": true, - "requires": { - "array-back": "^1.0.2" - }, - "dependencies": { - "array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "requires": { - "typical": "^2.6.0" - } - } - } - }, - "stream-via": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", - "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", - "dev": true - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "string-width-cjs": { - "version": "npm:string-width@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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "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, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "table-layout": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.5.tgz", - "integrity": "sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==", - "dev": true, - "requires": { - "array-back": "^2.0.0", - "deep-extend": "~0.6.0", - "lodash.padend": "^4.6.1", - "typical": "^2.6.1", - "wordwrapjs": "^3.0.0" - }, - "dependencies": { - "array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "requires": { - "typical": "^2.6.1" - } - } - } - }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==", - "dev": true - }, - "tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, - "peer": true - }, - "tar": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "dev": true, - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, - "temp-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-path/-/temp-path-1.0.0.tgz", - "integrity": "sha512-TvmyH7kC6ZVTYkqCODjJIbgvu0FKiwQpZ4D1aknE7xpcDf/qEOB8KZEK5ef2pfbVoiBhNWs3yx4y+ESMtNYmlg==", - "dev": true - }, - "terser": { - "version": "5.37.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", - "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", - "dev": true, - "peer": true, - "requires": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "peer": true - } - } - }, - "terser-webpack-plugin": { - "version": "5.3.11", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz", - "integrity": "sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ==", - "dev": true, - "peer": true, - "requires": { - "@jridgewell/trace-mapping": "^0.3.25", - "jest-worker": "^27.4.5", - "schema-utils": "^4.3.0", - "serialize-javascript": "^6.0.2", - "terser": "^5.31.1" - }, - "dependencies": { - "@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, - "peer": true, - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - } - }, - "ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.3" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - }, - "schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", - "dev": true, - "peer": true, - "requires": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - } - }, - "serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "peer": true, - "requires": { - "randombytes": "^2.1.0" - } - } - } - }, - "test-value": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-3.0.0.tgz", - "integrity": "sha512-sVACdAWcZkSU9x7AOmJo5TqE+GyNJknHaHsMrR6ZnhjVlVN9Yx6FjHrsKZ3BjIpPCT68zYesPWkakrNupwfOTQ==", - "dev": true, - "requires": { - "array-back": "^2.0.0", - "typical": "^2.6.1" - }, - "dependencies": { - "array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "requires": { - "typical": "^2.6.1" - } - } - } - }, - "throttleit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", - "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, - "tldts": { - "version": "6.1.84", - "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.84.tgz", - "integrity": "sha512-aRGIbCIF3teodtUFAYSdQONVmDRy21REM3o6JnqWn5ZkQBJJ4gHxhw6OfwQ+WkSAi3ASamrS4N4nyazWx6uTYg==", - "dev": true, - "requires": { - "tldts-core": "^6.1.84" - } - }, - "tldts-core": { - "version": "6.1.84", - "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.84.tgz", - "integrity": "sha512-NaQa1W76W2aCGjXybvnMYzGSM4x8fvG2AN/pla7qxcg0ZHbooOPhA8kctmOZUDfZyhDL27OGNbwAeig8P4p1vg==", - "dev": true - }, - "tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tough-cookie": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", - "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", - "dev": true, - "requires": { - "tldts": "^6.1.32" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true - }, - "trough": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", - "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", - "dev": true - }, - "ts-mocha": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/ts-mocha/-/ts-mocha-9.0.2.tgz", - "integrity": "sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw==", - "dev": true, - "requires": { - "ts-node": "7.0.1", - "tsconfig-paths": "^3.5.0" - }, - "dependencies": { - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - }, - "ts-node": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", - "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", - "dev": true, - "requires": { - "arrify": "^1.0.0", - "buffer-from": "^1.1.0", - "diff": "^3.1.0", - "make-error": "^1.1.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "source-map-support": "^0.5.6", - "yn": "^2.0.0" - } - }, - "tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", - "dev": true, - "optional": true, - "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "yn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ==", - "dev": true - } - } - }, - "ts-node": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, - "requires": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } - } - }, - "tsconfig-paths": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz", - "integrity": "sha512-AHx4Euop/dXFC+Vx589alFba8QItjF+8hf8LtmuiCwHyI4rHXQtOOENaM8kvYf5fR0dRChy3wzWIZ9WbB7FWow==", - "dev": true, - "requires": { - "json5": "^2.2.1", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - }, - "txm": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/txm/-/txm-8.1.0.tgz", - "integrity": "sha512-mVDmoN13jYX3igNcnS+TEJJmMIRLjn0wch/wOI23z5IkCKiw9xinv1WkugB55j57W8MfuEk/psVVO4BWMfZxfA==", - "dev": true, - "requires": { - "async": "^3.2.1", - "diff-match-patch": "^1.0.5", - "kleur": "^4.1.4", - "remark-parse": "^10.0.1", - "supports-color": "^9.1.0", - "unified": "^10.1.1" - }, - "dependencies": { - "supports-color": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.3.tgz", - "integrity": "sha512-aszYUX/DVK/ed5rFLb/dDinVJrQjG/vmU433wtqVSD800rYsJNWxh2R3USV90aLSU+UsyQkbNeffVLzc6B6foA==", - "dev": true - } - } - }, - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true - }, - "typedoc": { - "version": "0.27.6", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.6.tgz", - "integrity": "sha512-oBFRoh2Px6jFx366db0lLlihcalq/JzyCVp7Vaq1yphL/tbgx2e+bkpkCgJPunaPvPwoTOXSwasfklWHm7GfAw==", - "dev": true, - "requires": { - "@gerrit0/mini-shiki": "^1.24.0", - "lunr": "^2.3.9", - "markdown-it": "^14.1.0", - "minimatch": "^9.0.5", - "yaml": "^2.6.1" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", - "dev": true, - "requires": { - "uc.micro": "^2.0.0" - } - }, - "markdown-it": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", - "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", - "dev": true, - "requires": { - "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.0", - "mdurl": "^2.0.0", - "punycode.js": "^2.3.1", - "uc.micro": "^2.1.0" - } - }, - "mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", - "dev": true - }, - "minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "uc.micro": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", - "dev": true - } - } - }, - "typedoc-plugin-markdown": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.4.1.tgz", - "integrity": "sha512-fx23nSCvewI9IR8lzIYtzDphETcgTDuxKcmHKGD4lo36oexC+B1k4NaCOY58Snqb4OlE8OXDAGVcQXYYuLRCNw==", - "dev": true, - "requires": {} - }, - "typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==" - }, - "typical": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==", - "dev": true - }, - "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "uglify-js": { - "version": "3.17.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.1.tgz", - "integrity": "sha512-+juFBsLLw7AqMaqJ0GFvlsGZwdQfI2ooKQB39PSBgMnMakcFosi9O8jCwE+2/2nMNcc0z63r9mwjoDG8zr+q0Q==", - "dev": true, - "optional": true - }, - "underscore": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz", - "integrity": "sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==", - "dev": true - }, - "undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" - }, - "unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-stringify-position": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.2.tgz", - "integrity": "sha512-7A6eiDCs9UtjcwZOcCpM4aPII3bAAGv13E96IkawkOAW0OhH+yRxtY0lzo8KiHpzEMfH7Q+FizUmwp8Iqy5EWg==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0" - } - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true - }, - "untildify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true - }, - "update-browserslist-db": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", - "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", - "dev": true, - "peer": true, - "requires": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true - }, - "uvu": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", - "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", - "dev": true, - "requires": { - "dequal": "^2.0.0", - "diff": "^5.0.0", - "kleur": "^4.0.3", - "sade": "^1.7.3" - } - }, - "v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "valibot": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.36.0.tgz", - "integrity": "sha512-CjF1XN4sUce8sBK9TixrDqFM7RwNkuXdJu174/AwmQUB62QbCQADg5lLe8ldBalFgtj1uKj+pKwDJiNo4Mn+eQ==", - "peer": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vfile": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.5.tgz", - "integrity": "sha512-U1ho2ga33eZ8y8pkbQLH54uKqGhFJ6GYIHnnG5AhRpAh3OWjkrRHKa/KogbmQn8We+c0KVV3rTOgR9V/WowbXQ==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - } - }, - "vfile-message": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz", - "integrity": "sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" - } - }, - "wait-on": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-8.0.3.tgz", - "integrity": "sha512-nQFqAFzZDeRxsu7S3C7LbuxslHhk+gnJZHyethuGKAn2IVleIbTB9I3vJSQiSR+DifUqmdzfPMoMPJfLqMF2vw==", - "dev": true, - "requires": { - "axios": "^1.8.2", - "joi": "^17.13.3", - "lodash": "^4.17.21", - "minimist": "^1.2.8", - "rxjs": "^7.8.2" - } - }, - "walk-back": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-5.1.0.tgz", - "integrity": "sha512-Uhxps5yZcVNbLEAnb+xaEEMdgTXl9qAQDzKYejG2AZ7qPwRQ81lozY9ECDbjLPNWm7YsO1IK5rsP1KoQzXAcGA==", - "dev": true - }, - "wasm-opt": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/wasm-opt/-/wasm-opt-1.4.0.tgz", - "integrity": "sha512-wIsxxp0/FOSphokH4VOONy1zPkVREQfALN+/JTvJPK8gFSKbsmrcfECu2hT7OowqPfb4WEMSMceHgNL0ipFRyw==", - "dev": true, - "requires": { - "node-fetch": "^2.6.9", - "tar": "^6.1.13" - } - }, - "watchpack": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", - "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", - "dev": true, - "peer": true, - "requires": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - } - }, - "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==" - }, - "webpack": { - "version": "5.97.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", - "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", - "dev": true, - "peer": true, - "requires": { - "@types/eslint-scope": "^3.7.7", - "@types/estree": "^1.0.6", - "@webassemblyjs/ast": "^1.14.1", - "@webassemblyjs/wasm-edit": "^1.14.1", - "@webassemblyjs/wasm-parser": "^1.14.1", - "acorn": "^8.14.0", - "browserslist": "^4.24.0", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" - } - }, - "webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, - "peer": true - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true - }, - "wordwrapjs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-3.0.0.tgz", - "integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==", - "dev": true, - "requires": { - "reduce-flatten": "^1.0.1", - "typical": "^2.6.1" - }, - "dependencies": { - "reduce-flatten": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-1.0.1.tgz", - "integrity": "sha512-j5WfFJfc9CoXv/WbwVLHq74i/hdTUpy+iNC534LxczMRP67vJeK3V9JOdnL0N1cIRbn9mYhE2yVjvvKXDxvNXQ==", - "dev": true - } - } - }, - "workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true - }, - "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, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "xmlcreate": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", - "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", - "dev": true - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", - "dev": true - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "dependencies": { - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - } - } - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true - } } } diff --git a/bindings/wasm/identity_wasm/package.json b/bindings/wasm/identity_wasm/package.json index 5968e878f8..a6d5f619ba 100644 --- a/bindings/wasm/identity_wasm/package.json +++ b/bindings/wasm/identity_wasm/package.json @@ -74,7 +74,7 @@ "wasm-opt": "^1.4.0" }, "dependencies": { - "@iota/iota-interaction-ts": "^0.3.0", + "@iota/iota-interaction-ts": "^0.4.2", "@noble/ed25519": "^1.7.3", "@noble/hashes": "^1.4.0", "@types/node-fetch": "^2.6.2", @@ -83,7 +83,7 @@ "node-fetch": "^2.6.7" }, "peerDependencies": { - "@iota/iota-sdk": "^0.6.0" + "@iota/iota-sdk": "^1.0.0" }, "engines": { "node": ">=20" diff --git a/bindings/wasm/identity_wasm/src/error.rs b/bindings/wasm/identity_wasm/src/error.rs index 2bf1815822..5ca98a5822 100644 --- a/bindings/wasm/identity_wasm/src/error.rs +++ b/bindings/wasm/identity_wasm/src/error.rs @@ -10,6 +10,7 @@ use identity_iota::storage::key_storage::KeyStorageError; use identity_iota::storage::key_storage::KeyStorageErrorKind; use identity_iota::storage::key_storage::KeyStorageResult; use iota_interaction_ts::AdapterError; +use product_core::Error as ProductCommonError; use std::borrow::Cow; use std::fmt::Debug; use std::fmt::Display; @@ -111,7 +112,8 @@ impl_wasm_error_from!( identity_iota::credential::status_list_2021::StatusListError, identity_iota::credential::status_list_2021::StatusList2021CredentialError, identity_iota::iota::rebased::Error, - identity_iota::sd_jwt_rework::Error + identity_iota::sd_jwt_rework::Error, + ProductCommonError ); // Similar to `impl_wasm_error_from`, but uses the types name instead of requiring/calling Into &'static str diff --git a/bindings/wasm/identity_wasm/src/iota/iota_did.rs b/bindings/wasm/identity_wasm/src/iota/iota_did.rs index 2c11537241..38a037519b 100644 --- a/bindings/wasm/identity_wasm/src/iota/iota_did.rs +++ b/bindings/wasm/identity_wasm/src/iota/iota_did.rs @@ -4,7 +4,7 @@ use identity_iota::did::Error as DIDError; use identity_iota::did::DID; use identity_iota::iota::IotaDID; -use identity_iota::iota::NetworkName; +use product_core::network_name::NetworkName; use wasm_bindgen::prelude::*; use crate::did::WasmCoreDID; diff --git a/bindings/wasm/identity_wasm/src/iota/iota_document.rs b/bindings/wasm/identity_wasm/src/iota/iota_document.rs index 5f7a3bdefa..3d0adbbc1e 100644 --- a/bindings/wasm/identity_wasm/src/iota/iota_document.rs +++ b/bindings/wasm/identity_wasm/src/iota/iota_document.rs @@ -16,7 +16,6 @@ use identity_iota::credential::Presentation; use identity_iota::did::DIDUrl; use identity_iota::iota::IotaDID; use identity_iota::iota::IotaDocument; -use identity_iota::iota::NetworkName; use identity_iota::iota::StateMetadataEncoding; use identity_iota::storage::key_storage::KeyType; use identity_iota::storage::storage::JwkDocumentExt; @@ -25,6 +24,7 @@ use identity_iota::verification::jose::jws::JwsAlgorithm; use identity_iota::verification::MethodScope; use identity_iota::verification::VerificationMethod; use js_sys::Promise; +use product_core::network_name::NetworkName; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; use wasm_bindgen_futures::future_to_promise; diff --git a/bindings/wasm/identity_wasm/src/rebased/controller.rs b/bindings/wasm/identity_wasm/src/rebased/controller.rs index dd8ba16771..b62ae4a20d 100644 --- a/bindings/wasm/identity_wasm/src/rebased/controller.rs +++ b/bindings/wasm/identity_wasm/src/rebased/controller.rs @@ -7,10 +7,10 @@ use identity_iota::iota::rebased::migration::DelegateToken; use identity_iota::iota::rebased::migration::DelegationToken; use identity_iota::iota::rebased::migration::DelegationTokenRevocation; use identity_iota::iota::rebased::migration::DeleteDelegationToken; -use identity_iota::iota::rebased::transaction_builder::Transaction as _; -use identity_iota::iota::rebased::transaction_builder::TransactionBuilder; use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects; use js_sys::Object; +use product_core::transaction::transaction_builder::Transaction as _; +use product_core::transaction::transaction_builder::TransactionBuilder; use wasm_bindgen::prelude::wasm_bindgen; use wasm_bindgen::JsCast as _; use wasm_bindgen::JsError; @@ -143,9 +143,9 @@ impl WasmDelegateToken { wasm_effects: &WasmIotaTransactionBlockEffects, client: &WasmIdentityClientReadOnly, ) -> Result { - let effects = wasm_effects.clone().into(); - let (apply_result, rem_effects) = self.0.apply(effects, &client.0).await; - let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = self.0.apply(&mut effects, &client.0).await; + let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &rem_wasm_effects); apply_result.wasm_result().map(WasmDelegationToken) @@ -203,9 +203,9 @@ impl WasmDelegationTokenRevocation { wasm_effects: &WasmIotaTransactionBlockEffects, client: &WasmIdentityClientReadOnly, ) -> Result<()> { - let effects = wasm_effects.clone().into(); - let (apply_result, rem_effects) = self.0.apply(effects, &client.0).await; - let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = self.0.apply(&mut effects, &client.0).await; + let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &rem_wasm_effects); apply_result.wasm_result() @@ -243,9 +243,9 @@ impl WasmDeleteDelegationToken { wasm_effects: &WasmIotaTransactionBlockEffects, client: &WasmIdentityClientReadOnly, ) -> Result<()> { - let effects = wasm_effects.clone().into(); - let (apply_result, rem_effects) = self.0.apply(effects, &client.0).await; - let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = self.0.apply(&mut effects, &client.0).await; + let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &rem_wasm_effects); apply_result.wasm_result() diff --git a/bindings/wasm/identity_wasm/src/rebased/core_client.rs b/bindings/wasm/identity_wasm/src/rebased/core_client.rs index c850edf53a..4dc49d2458 100644 --- a/bindings/wasm/identity_wasm/src/rebased/core_client.rs +++ b/bindings/wasm/identity_wasm/src/rebased/core_client.rs @@ -1,16 +1,16 @@ // Copyright 2020-2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use identity_iota::iota::rebased::client::CoreClient; -use identity_iota::iota::rebased::client::CoreClientReadOnly; -use identity_iota::iota::NetworkName; use identity_iota::iota_interaction::types::base_types::IotaAddress; -use identity_iota::iota_interaction::types::base_types::ObjectID; -use identity_iota::iota_interaction::types::base_types::ObjectIDParseError; -use identity_iota::iota_interaction::types::crypto::PublicKey; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectIDParseError; +use iota_interaction::types::crypto::PublicKey; use iota_interaction_ts::bindings::WasmIotaClient; use iota_interaction_ts::IotaClientAdapter; use iota_interaction_ts::WasmPublicKey; +use product_core::core_client::CoreClient; +use product_core::core_client::CoreClientReadOnly; +use product_core::network_name::NetworkName; use wasm_bindgen::prelude::*; use crate::error::Result; diff --git a/bindings/wasm/identity_wasm/src/rebased/identity.rs b/bindings/wasm/identity_wasm/src/rebased/identity.rs index 55adb95e59..de4dcb722f 100644 --- a/bindings/wasm/identity_wasm/src/rebased/identity.rs +++ b/bindings/wasm/identity_wasm/src/rebased/identity.rs @@ -7,11 +7,11 @@ use identity_iota::iota::rebased::migration::ControllerToken; use identity_iota::iota::rebased::migration::CreateIdentity; use identity_iota::iota::rebased::migration::IdentityBuilder; use identity_iota::iota::rebased::migration::OnChainIdentity; -use identity_iota::iota::rebased::transaction_builder::Transaction; use identity_iota::iota::IotaDocument; use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects; use iota_interaction_ts::error::WasmResult as _; use js_sys::Object; +use product_core::transaction::transaction_builder::Transaction; use tokio::sync::RwLock; use wasm_bindgen::prelude::*; @@ -307,9 +307,9 @@ impl WasmCreateIdentity { client: &WasmCoreClientReadOnly, ) -> Result { let managed_client = WasmManagedCoreClientReadOnly::from_wasm(client)?; - let effects = wasm_effects.clone().into(); - let (apply_result, rem_effects) = self.0.apply(effects, &managed_client).await; - let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = self.0.apply(&mut effects, &managed_client).await; + let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &rem_wasm_effects); apply_result.wasm_result().map(WasmOnChainIdentity::new) diff --git a/bindings/wasm/identity_wasm/src/rebased/proposals/config_change.rs b/bindings/wasm/identity_wasm/src/rebased/proposals/config_change.rs index c5ad2481a8..1ee8544e4d 100644 --- a/bindings/wasm/identity_wasm/src/rebased/proposals/config_change.rs +++ b/bindings/wasm/identity_wasm/src/rebased/proposals/config_change.rs @@ -9,9 +9,9 @@ use identity_iota::iota::rebased::migration::Proposal; use identity_iota::iota::rebased::proposals::ConfigChange; use identity_iota::iota::rebased::proposals::ProposalResult; use identity_iota::iota::rebased::proposals::ProposalT; -use identity_iota::iota::rebased::transaction_builder::Transaction; use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects; use js_sys::Object; +use product_core::transaction::transaction_builder::Transaction; use tokio::sync::RwLock; use wasm_bindgen::prelude::wasm_bindgen; use wasm_bindgen::prelude::JsCast; @@ -200,8 +200,9 @@ impl WasmApproveConfigChangeProposal { .approve(&identity, &self.controller_token.0) .wasm_result()? .into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); apply_result.wasm_result() @@ -258,8 +259,9 @@ impl WasmExecuteConfigChangeProposal { .await .wasm_result()? .into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); apply_result.wasm_result() @@ -392,8 +394,9 @@ impl WasmCreateConfigChangeProposal { let tx = builder.finish(&managed_client).await.wasm_result()?.into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let rem_wasm_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &rem_wasm_effects); match apply_result.wasm_result()? { diff --git a/bindings/wasm/identity_wasm/src/rebased/proposals/send.rs b/bindings/wasm/identity_wasm/src/rebased/proposals/send.rs index ad8eb0a309..c31c5cd6be 100644 --- a/bindings/wasm/identity_wasm/src/rebased/proposals/send.rs +++ b/bindings/wasm/identity_wasm/src/rebased/proposals/send.rs @@ -7,9 +7,9 @@ use identity_iota::iota::rebased::migration::Proposal; use identity_iota::iota::rebased::proposals::ProposalResult; use identity_iota::iota::rebased::proposals::ProposalT; use identity_iota::iota::rebased::proposals::SendAction; -use identity_iota::iota::rebased::transaction_builder::Transaction; use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects; use js_sys::Object; +use product_core::transaction::transaction_builder::Transaction; use tokio::sync::RwLock; use wasm_bindgen::prelude::wasm_bindgen; use wasm_bindgen::prelude::JsCast; @@ -173,8 +173,9 @@ impl WasmApproveSendProposal { .await .wasm_result()? .into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); apply_result.wasm_result() @@ -226,15 +227,16 @@ impl WasmExecuteSendProposal { let mut identity_ref = self.identity.0.write().await; let proposal = self.proposal.0.read().await.clone(); - let (apply_result, rem_effects) = proposal + let mut effects = wasm_effects.clone().into(); + let apply_result = proposal .into_tx(&mut identity_ref, &self.controller_token.0, &managed_client) .await .wasm_result()? .into_inner() - .apply(wasm_effects.clone().into(), &managed_client) + .apply(&mut effects, &managed_client) .await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); apply_result.wasm_result() @@ -322,8 +324,9 @@ impl WasmCreateSendProposal { .wasm_result()? .into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); match apply_result.wasm_result()? { diff --git a/bindings/wasm/identity_wasm/src/rebased/proposals/update_did.rs b/bindings/wasm/identity_wasm/src/rebased/proposals/update_did.rs index e51b353173..d53b1c1a86 100644 --- a/bindings/wasm/identity_wasm/src/rebased/proposals/update_did.rs +++ b/bindings/wasm/identity_wasm/src/rebased/proposals/update_did.rs @@ -7,10 +7,10 @@ use identity_iota::iota::rebased::migration::Proposal; use identity_iota::iota::rebased::proposals::ProposalResult; use identity_iota::iota::rebased::proposals::ProposalT; use identity_iota::iota::rebased::proposals::UpdateDidDocument; -use identity_iota::iota::rebased::transaction_builder::Transaction; use identity_iota::iota::StateMetadataDocument; use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects; use js_sys::Object; +use product_core::transaction::transaction_builder::Transaction; use tokio::sync::RwLock; use wasm_bindgen::prelude::wasm_bindgen; use wasm_bindgen::prelude::JsCast; @@ -192,8 +192,9 @@ impl WasmApproveUpdateDidDocumentProposal { .approve(&identity, &self.controller_token.0) .wasm_result()? .into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); apply_result.wasm_result() @@ -247,8 +248,9 @@ impl WasmExecuteUpdateDidDocumentProposal { .await .wasm_result()? .into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); apply_result.wasm_result() @@ -364,8 +366,9 @@ impl WasmCreateUpdateDidProposal { .wasm_result()? .into_inner(); - let (apply_result, rem_effects) = tx.apply(wasm_effects.clone().into(), &managed_client).await; - let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); + let mut effects = wasm_effects.clone().into(); + let apply_result = tx.apply(&mut effects, &managed_client).await; + let wasm_rem_effects = WasmIotaTransactionBlockEffects::from(&effects); Object::assign(wasm_effects, &wasm_rem_effects); let ProposalResult::Pending(proposal) = apply_result.wasm_result()? else { diff --git a/bindings/wasm/identity_wasm/src/rebased/transaction_builder.rs b/bindings/wasm/identity_wasm/src/rebased/transaction_builder.rs index eff4fc55d7..51134dace2 100644 --- a/bindings/wasm/identity_wasm/src/rebased/transaction_builder.rs +++ b/bindings/wasm/identity_wasm/src/rebased/transaction_builder.rs @@ -7,11 +7,6 @@ use anyhow::anyhow; use anyhow::Context as _; use async_trait::async_trait; use fastcrypto::traits::EncodeDecodeBase64; -use identity_iota::iota::rebased::client::CoreClientReadOnly; -use identity_iota::iota::rebased::transaction::TransactionOutputInternal; -use identity_iota::iota::rebased::transaction_builder::MutGasDataRef; -use identity_iota::iota::rebased::transaction_builder::Transaction; -use identity_iota::iota::rebased::transaction_builder::TransactionBuilder; use identity_iota::iota::rebased::Error as IotaError; use identity_iota::iota_interaction::rpc_types::IotaTransactionBlockEffects; use identity_iota::iota_interaction::types::crypto::Signature; @@ -23,6 +18,11 @@ use iota_interaction_ts::bindings::WasmIotaTransactionBlockResponse; use iota_interaction_ts::bindings::WasmObjectRef; use iota_interaction_ts::bindings::WasmTransactionDataBuilder; use js_sys::JsString; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::MutGasDataRef; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; +use product_core::transaction::TransactionOutputInternal; use wasm_bindgen::prelude::wasm_bindgen; use wasm_bindgen::JsCast as _; use wasm_bindgen::JsValue; @@ -57,8 +57,9 @@ extern "C" { #[async_trait(?Send)] impl Transaction for WasmTransaction { type Output = JsValue; + type Error = IotaError; - async fn build_programmable_transaction(&self, client: &C) -> StdResult + async fn build_programmable_transaction(&self, client: &C) -> StdResult where C: CoreClientReadOnly, { @@ -71,23 +72,17 @@ impl Transaction for WasmTransaction { Ok(bcs::from_bytes(&pt_bcs)?) } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - client: &C, - ) -> (StdResult, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> StdResult where C: CoreClientReadOnly, { let managed_client = WasmManagedCoreClientReadOnly::from_rust(client); let core_client = managed_client.into_wasm(); - let wasm_effects = WasmIotaTransactionBlockEffects::from(&effects); + let wasm_effects = WasmIotaTransactionBlockEffects::from(&*effects); - let apply_result = Self::apply(&self, &wasm_effects, &core_client) + Self::apply(&self, &wasm_effects, &core_client) .await - .map_err(|e| IotaError::FfiError(format!("failed to apply effects from WASM Transaction: {e:?}"))); - - (apply_result, wasm_effects.into()) + .map_err(|e| IotaError::FfiError(format!("failed to apply effects from WASM Transaction: {e:?}"))) } } diff --git a/bindings/wasm/identity_wasm/src/rebased/wasm_identity_client.rs b/bindings/wasm/identity_wasm/src/rebased/wasm_identity_client.rs index 28115082ed..4b80a165af 100644 --- a/bindings/wasm/identity_wasm/src/rebased/wasm_identity_client.rs +++ b/bindings/wasm/identity_wasm/src/rebased/wasm_identity_client.rs @@ -5,17 +5,17 @@ use std::ops::Deref; use std::rc::Rc; use anyhow::anyhow; -use identity_iota::iota::rebased::client::CoreClient as _; use identity_iota::iota::rebased::client::IdentityClient; use identity_iota::iota::rebased::client::PublishDidDocument; -use identity_iota::iota::rebased::transaction::TransactionOutputInternal; +use product_core::core_client::CoreClient as _; +use product_core::transaction::TransactionOutputInternal; -use identity_iota::iota::rebased::transaction_builder::Transaction as _; use iota_interaction_ts::bindings::WasmExecutionStatus; use iota_interaction_ts::bindings::WasmIotaClient; use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects; use iota_interaction_ts::bindings::WasmOwnedObjectRef; use iota_interaction_ts::WasmPublicKey; +use product_core::transaction::transaction_builder::Transaction; use identity_iota::iota::rebased::Error; use iota_interaction_ts::NativeTransactionBlockResponse; @@ -233,10 +233,10 @@ impl WasmPublishDidDocument { client: &WasmCoreClientReadOnly, ) -> Result { let managed_client = WasmManagedCoreClientReadOnly::from_wasm(client)?; - let effects = wasm_effects.clone().into(); - let (apply_result, rem_effects) = self.0.apply(effects, &managed_client).await; - let wasm_remaining_effects = WasmIotaTransactionBlockEffects::from(&rem_effects); - Object::assign(wasm_effects.as_ref(), wasm_remaining_effects.as_ref()); + let mut effects = wasm_effects.clone().into(); + let apply_result = self.0.apply(&mut effects, &managed_client).await; + let wasm_remaining_effects = WasmIotaTransactionBlockEffects::from(&effects); + Object::assign(wasm_effects.as_ref(), &wasm_remaining_effects); apply_result.wasm_result().map(WasmIotaDocument::from) } diff --git a/bindings/wasm/iota_interaction_ts/Cargo.toml b/bindings/wasm/iota_interaction_ts/Cargo.toml deleted file mode 100644 index 5e6ad0892e..0000000000 --- a/bindings/wasm/iota_interaction_ts/Cargo.toml +++ /dev/null @@ -1,57 +0,0 @@ -[package] -name = "iota_interaction_ts" -version = "1.6.0-alpha" -authors = ["IOTA Stiftung"] -edition = "2021" -homepage = "https://www.iota.org" -keywords = ["iota", "tangle", "identity", "wasm"] -license = "Apache-2.0" -publish = false -readme = "README.md" -resolver = "2" -description = "identity_iota_interaction Adapters using Web Assembly bindings." - -[lib] -crate-type = ["cdylib", "rlib"] - -[dependencies] -anyhow = { version = "1.0.94", features = ["std"] } -async-trait = { version = "0.1", default-features = false } -bcs = "0.1.6" -bls12_381_plus = "0.8.17" -cfg-if = "1.0.0" -console_error_panic_hook = { version = "0.1" } -eyre = "0.6.12" -fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "2f502fd8570fe4e9cff36eea5bbd6fef22002898", package = "fastcrypto" } -futures = { version = "0.3" } -identity_core = { version = "=1.6.0-alpha", path = "../../../identity_core" } -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../../../identity_iota_interaction", default-features = false } -js-sys = { version = "0.3.61" } -secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", default-features = false, tag = "v0.3.0" } -serde = { version = "1.0", features = ["derive"] } -serde-wasm-bindgen = "0.6.5" -serde_json.workspace = true -serde_repr = { version = "0.1", default-features = false } -thiserror.workspace = true -# Want to use the nice API of tokio::sync::RwLock for now even though we can't use threads. -tokio = { version = "1.43", default-features = false, features = ["sync"] } -tsify = "0.4.5" -wasm-bindgen = { version = "0.2.100", features = ["serde-serialize"] } -wasm-bindgen-futures = { version = "0.4", default-features = false } -zkryptium = "0.2.2" - -[dev-dependencies] -rand = "0.8.5" - -[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies] -getrandom = { version = "0.2", default-features = false, features = ["js"] } -instant = { version = "0.1", default-features = false, features = ["wasm-bindgen"] } - -[lints.clippy] -# can be removed as soon as fix has been added to clippy -# see https://github.com/rust-lang/rust-clippy/issues/12377 -empty_docs = "allow" - -[features] -default = [] -keytool = ["identity_iota_interaction/keytool"] diff --git a/bindings/wasm/iota_interaction_ts/LICENSE b/bindings/wasm/iota_interaction_ts/LICENSE deleted file mode 100644 index 4947287f7b..0000000000 --- a/bindings/wasm/iota_interaction_ts/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/bindings/wasm/iota_interaction_ts/README.md b/bindings/wasm/iota_interaction_ts/README.md deleted file mode 100644 index 6f7839c274..0000000000 --- a/bindings/wasm/iota_interaction_ts/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Web Assembly adapters for identity_iota_interaction - -WASM bindings importing types from the IOTA Client typescript SDK to be used in the Identity library Rust code. \ No newline at end of file diff --git a/bindings/wasm/iota_interaction_ts/lib/index.ts b/bindings/wasm/iota_interaction_ts/lib/index.ts deleted file mode 100644 index 1a201cc257..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -export * from "~iota_interaction_ts"; -export * as iota_client_helpers from "./iota_client_helpers"; -export * as move_calls from "./move_calls"; diff --git a/bindings/wasm/iota_interaction_ts/lib/iota_client_helpers.ts b/bindings/wasm/iota_interaction_ts/lib/iota_client_helpers.ts deleted file mode 100644 index 1eafe9e97f..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/iota_client_helpers.ts +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { CoinStruct, IotaClient, IotaTransactionBlockResponse, TransactionEffects } from "@iota/iota-sdk/client"; -import { GasData, TransactionDataBuilder } from "@iota/iota-sdk/transactions"; - -export type Signer = { sign(data: Uint8Array): Promise }; - -const MINIMUM_BALANCE_FOR_COIN = BigInt(1_000_000_000); - -export class WasmIotaTransactionBlockResponseWrapper { - response: IotaTransactionBlockResponse; - - constructor(response: IotaTransactionBlockResponse) { - this.response = response; - } - - to_string(): string { - return JSON.stringify(this.response); - } - - get_effects(): TransactionEffects | null | undefined { - return this.response.effects; - } - - get_response(): IotaTransactionBlockResponse { - return this.response; - } - - get_digest(): string { - return this.response.digest; - } -} - -function byHighestBalance({ balance: a }: T, { balance: b }: T) { - if (a > b) { - return -1; - } - if (a < b) { - return 1; - } - return 0; -} - -async function getCoinForTransaction(iotaClient: IotaClient, senderAddress: string): Promise { - let cursor: string | null | undefined = undefined; - do { - const response = await iotaClient.getCoins({ owner: senderAddress, cursor }); - if (response.data.length === 0) { - throw new Error( - `no coin found with minimum required balance of ${MINIMUM_BALANCE_FOR_COIN} for address ${senderAddress}"`, - ); - } - - let sortedValidCoins = response.data - .map((coin) => ({ coin, balance: BigInt(coin.balance) })) - .filter(({ balance }) => balance >= MINIMUM_BALANCE_FOR_COIN) - .sort(byHighestBalance); - - if (sortedValidCoins.length >= 1) { - return sortedValidCoins[0].coin; - } - - cursor = response.nextCursor; - } while (cursor); - - throw new Error( - `no coin found with minimum required balance of ${MINIMUM_BALANCE_FOR_COIN} for address ${senderAddress}"`, - ); -} - -/** - * Inserts these values into the transaction and replaces placeholder values. - * - * - sender (overwritten as we assume a placeholder to be used in prepared transaction) - * - gas budget (value determined automatically if not provided) - * - gas price (value determined automatically) - * - gas coin / payment object (fetched automatically) - * - gas owner (equals sender) - * - * @param iotaClient client instance - * @param senderAddress transaction sender (and the one paying for it) - * @param txBcs transaction data serialized to bcs, most probably having placeholder values - * @param gasBudget optional fixed gas budget, determined automatically with a dry run if not provided - * @returns updated transaction data - */ -export async function addGasDataToTransaction( - iotaClient: IotaClient, - senderAddress: string, - txBcs: Uint8Array, - gasBudget?: bigint, -): Promise { - const gasPrice = await iotaClient.getReferenceGasPrice(); - const gasCoin = await getCoinForTransaction(iotaClient, senderAddress); - const txData = TransactionDataBuilder.fromBytes(txBcs); - const gasData: GasData = { - budget: gasBudget ? gasBudget.toString() : "50000000", // 50_000_000 - owner: senderAddress, - payment: [{ - objectId: gasCoin.coinObjectId, - version: gasCoin.version, - digest: gasCoin.digest, - }], - price: gasPrice.toString(), - }; - const overrides = { - gasData, - sender: senderAddress, - }; - // TODO: check why `.build` with `overrides` doesn't override these values - txData.sender = overrides.sender; - txData.gasData = overrides.gasData; - let builtTx = txData.build({ overrides }); - - if (!gasBudget) { - // no budget given, so we have to estimate gas usage - const dryRunGasResult = (await iotaClient - .dryRunTransactionBlock({ transactionBlock: builtTx })).effects; - if (dryRunGasResult.status.status === "failure") { - throw new Error("transaction returned an unexpected response; " + dryRunGasResult.status.error); - } - - const gasSummary = dryRunGasResult.gasUsed; - const overhead = gasPrice * BigInt(1000); - let netUsed = BigInt(gasSummary.computationCost) - + BigInt(gasSummary.storageCost) - - BigInt(gasSummary.storageRebate); - netUsed = netUsed >= 0 ? netUsed : BigInt(0); - const computation = BigInt(gasSummary.computationCost); - const maxCost = netUsed > computation ? netUsed : computation; - const budget = overhead + maxCost; - - overrides.gasData.budget = budget.toString(); - txData.gasData.budget = budget.toString(); - - builtTx = txData.build({ overrides }); - } - - return builtTx; -} - -// estimate gas, get coin, execute tx here -export async function executeTransaction( - iotaClient: IotaClient, - senderAddress: string, - txBcs: Uint8Array, - signer: Signer, - gasBudget?: bigint, -): Promise { - const txWithGasData = await addGasDataToTransaction(iotaClient, senderAddress, txBcs, gasBudget); - const signature = await signer.sign(txWithGasData); - - const response = await iotaClient.executeTransactionBlock({ - transactionBlock: txWithGasData, - signature, - options: { // equivalent of `IotaTransactionBlockResponseOptions::full_content()` - showEffects: true, - showInput: true, - showRawInput: true, - showEvents: true, - showObjectChanges: true, - showBalanceChanges: true, - showRawEffects: false, - }, - }); - - if (response?.effects?.status.status === "failure") { - throw new Error(`transaction returned an unexpected response; ${response?.effects?.status.error}`); - } - - return new WasmIotaTransactionBlockResponseWrapper(response); -} - -/** - * Helper function to pause execution. - * - * @param durationMs time to sleep in ms - */ -export function sleep(durationMs: number) { - return new Promise(resolve => setTimeout(resolve, durationMs)); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/create.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/create.ts deleted file mode 100644 index 9aee87fa2c..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/create.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { Transaction } from "@iota/iota-sdk/transactions"; - -export function create( - inner_bytes: Uint8Array, - inner_type: string, - mutable: boolean, - transferable: boolean, - deletable: boolean, - packageId: string, -): Promise { - const tx = new Transaction(); - const inner_arg = tx.pure(inner_bytes); - const mutableArg = tx.pure.bool(mutable); - const transferableArg = tx.pure.bool(transferable); - const deletableArg = tx.pure.bool(deletable); - - tx.moveCall({ - target: `${packageId}::asset::new_with_config`, - typeArguments: [inner_type], - arguments: [inner_arg, mutableArg, transferableArg, deletableArg], - }); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/delete.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/delete.ts deleted file mode 100644 index 04b4a10f99..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/delete.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; - -export function remove( - asset: ObjectRef, - asset_type: string, - packageId: string, -): Promise { - const tx = new Transaction(); - const asset_arg = tx.objectRef(asset); - - tx.moveCall({ - target: `${packageId}::asset::delete`, - typeArguments: [asset_type], - arguments: [asset_arg], - }); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/index.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/index.ts deleted file mode 100644 index feaf3adfc2..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -export * from "./create"; -export * from "./delete"; -export * from "./transfer"; -export * from "./update"; diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/transfer.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/transfer.ts deleted file mode 100644 index 5ab2b7ad7d..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/transfer.ts +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; - -export function transfer( - asset: ObjectRef, - assetType: string, - recipient: string, - packageId: string, -): Promise { - const tx = new Transaction(); - const assetArg = tx.objectRef(asset); - const recipientArg = tx.pure.address(recipient); - - tx.moveCall({ - target: `${packageId}::asset::transfer`, - typeArguments: [assetType], - arguments: [assetArg, recipientArg], - }); - - return tx.build(); -} - -function makeTx( - proposal: SharedObjectRef, - cap: ObjectRef, - asset: ObjectRef, - assetType: string, - packageId: string, - functionName: string, -): Promise { - const tx = new Transaction(); - const proposalArg = tx.sharedObjectRef(proposal); - const capArg = tx.objectRef(cap); - const assetArg = tx.objectRef(asset); - - tx.moveCall({ - target: `${packageId}::asset::${functionName}`, - typeArguments: [assetType], - arguments: [proposalArg, capArg, assetArg], - }); - - return tx.build(); -} - -export function acceptProposal( - proposal: SharedObjectRef, - recipientCap: ObjectRef, - asset: ObjectRef, - assetType: string, - packageId: string, -): Promise { - return makeTx( - proposal, - recipientCap, - asset, - assetType, - packageId, - "accept", - ); -} - -export function concludeOrCancel( - proposal: SharedObjectRef, - senderCap: ObjectRef, - asset: ObjectRef, - assetType: string, - packageId: string, -): Promise { - return makeTx( - proposal, - senderCap, - asset, - assetType, - packageId, - "conclude_or_cancel", - ); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/update.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/update.ts deleted file mode 100644 index c80f52f9b3..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/asset/update.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; - -export function update( - asset: ObjectRef, - content: Uint8Array, - contentType: string, - packageId: string, -): Promise { - const tx = new Transaction(); - const contentArg = tx.pure(content); - const assetArg = tx.objectRef(asset); - - tx.moveCall({ - target: `${packageId}::asset::update`, - typeArguments: [contentType], - arguments: [assetArg, contentArg], - }); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/borrow_asset.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/borrow_asset.ts deleted file mode 100644 index b9ea863fb9..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/borrow_asset.ts +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { IotaObjectData } from "@iota/iota-sdk/dist/cjs/client"; -import { ObjectRef, Transaction, TransactionArgument } from "@iota/iota-sdk/transactions"; -import { controllerTokenRefToTxArgument, putBackControllerToken } from "../utils"; -import { ControllerTokenRef } from "./controller"; - -export function proposeBorrow( - identity: SharedObjectRef, - capability: ControllerTokenRef, - objects: string[], - packageId: string, - expiration?: number, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const exp = tx.pure.option("u64", expiration); - const objectsArg = tx.pure.vector("id", objects); - - tx.moveCall({ - target: `${packageId}::identity::propose_borrow`, - arguments: [identityArg, cap.token, exp, objectsArg], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} - -export function executeBorrow( - identity: SharedObjectRef, - capability: ControllerTokenRef, - proposalId: string, - objects: IotaObjectData[], - intentFn: (arg0: Transaction, arg1: Map) => void, - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const proposal = tx.pure.id(proposalId); - const identityArg = tx.sharedObjectRef(identity); - - let action = tx.moveCall({ - target: `${packageId}::identity::execute_proposal`, - typeArguments: [`${packageId}::borrow_proposal::Borrow`], - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - const objectArgMap = new Map(); - for (const obj of objects) { - const recvObj = tx.receivingRef(obj); - const objArg = tx.moveCall({ - target: `${packageId}::identity::execute_borrow`, - typeArguments: [obj.type!], - arguments: [identityArg, action, recvObj], - }); - - objectArgMap.set(obj.objectId, [objArg, obj]); - } - - intentFn(tx, objectArgMap); - - for (const [obj, objData] of objectArgMap.values()) { - tx.moveCall({ - target: `${packageId}::borrow_proposal::put_back`, - typeArguments: [objData.type!], - arguments: [action, obj], - }); - } - - tx.moveCall({ - target: `${packageId}::transfer_proposal::conclude_borrow`, - arguments: [action], - }); - - return tx.build(); -} - -export function createAndExecuteBorrow( - identity: SharedObjectRef, - capability: ControllerTokenRef, - objects: IotaObjectData[], - intentFn: (arg0: Transaction, arg1: Map) => void, - packageId: string, - expiration?: number, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const exp = tx.pure.option("u64", expiration); - const objectsArg = tx.pure.vector("id", objects.map(obj => obj.objectId)); - - const proposal = tx.moveCall({ - target: `${packageId}::identity::propose_borrow`, - arguments: [identityArg, cap.token, exp, objectsArg], - }); - - let action = tx.moveCall({ - target: `${packageId}::identity::execute_proposal`, - typeArguments: [`${packageId}::borrow_proposal::Borrow`], - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - const objectArgMap = new Map(); - for (const obj of objects) { - const recvObj = tx.receivingRef(obj); - const objArg = tx.moveCall({ - target: `${packageId}::identity::execute_borrow`, - typeArguments: [obj.type!], - arguments: [identityArg, action, recvObj], - }); - - objectArgMap.set(obj.objectId, [objArg, obj]); - } - - intentFn(tx, objectArgMap); - - for (const [obj, objData] of objectArgMap.values()) { - tx.moveCall({ - target: `${packageId}::borrow_proposal::put_back`, - typeArguments: [objData.type!], - arguments: [action, obj], - }); - } - - tx.moveCall({ - target: `${packageId}::transfer_proposal::conclude_borrow`, - arguments: [action], - }); - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/config.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/config.ts deleted file mode 100644 index 38ca1c5481..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/config.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; -import { controllerTokenRefToTxArgument, putBackControllerToken } from "../utils"; -import { ControllerTokenRef } from "./controller"; - -export function proposeConfigChange( - identity: SharedObjectRef, - capability: ControllerTokenRef, - controllersToAdd: [string, number][], - controllersToRemove: string[], - controllersToUpdate: [string, number][], - packageId: string, - expiration?: number, - threshold?: number, -): Promise { - const tx = new Transaction(); - const addressesToAdd = tx.pure.vector("address", controllersToAdd.map(c => c[0])); - const vpsToAdd = tx.pure.vector("u64", controllersToAdd.map(c => c[1])); - const controllersToAddArg = tx.moveCall({ - target: `${packageId}::utils::vec_map_from_keys_values`, - typeArguments: ["address", "u64"], - arguments: [addressesToAdd, vpsToAdd], - }); - - const idsToUpdate = tx.pure.vector("id", controllersToUpdate.map(c => c[0])); - const vpsToUpdate = tx.pure.vector("u64", controllersToUpdate.map(c => c[1])); - const controllersToUpdateArg = tx.moveCall({ - target: `${packageId}::utils::vec_map_from_keys_values`, - typeArguments: ["id", "u64"], - arguments: [idsToUpdate, vpsToUpdate], - }); - - const identityArg = tx.sharedObjectRef(identity); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const thresholdArg = tx.pure.option("u64", threshold); - const exp = tx.pure.option("u64", expiration); - const controllersToRemoveArg = tx.pure.vector("id", controllersToRemove); - - tx.moveCall({ - target: `${packageId}::identity::propose_config_change`, - arguments: [identityArg, cap.token, exp, thresholdArg, controllersToAddArg, controllersToRemoveArg, - controllersToUpdateArg], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} - -export function executeConfigChange( - identity: SharedObjectRef, - capability: ControllerTokenRef, - proposalId: string, - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const proposal = tx.pure.id(proposalId); - const identityArg = tx.sharedObjectRef(identity); - - tx.moveCall({ - target: `${packageId}::identity::execute_config_change`, - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/controller.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/controller.ts deleted file mode 100644 index c48a748eb7..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/controller.ts +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; - -export interface ControllerTokenRef { - objectRef: ObjectRef; - type: "ControllerCap" | "DelegationToken"; -} - -export async function delegateControllerCap( - controllerCap: ObjectRef, - recipient: string, - permissions: number, - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = tx.objectRef(controllerCap); - const recipientAddress = tx.pure.address(recipient); - const permissionsArg = tx.pure.u32(permissions); - - const delegationToken = tx.moveCall({ - target: `${packageId}::controller::delegate_with_permissions`, - arguments: [cap, permissionsArg], - }); - - tx.transferObjects([delegationToken], recipientAddress); - - return tx.build({ onlyTransactionKind: true }); -} - -export async function revokeDelegationToken( - identity: SharedObjectRef, - controllerCap: ObjectRef, - delegationTokenId: string, - packageId: string, -): Promise { - const tx = new Transaction(); - - const identityArg = tx.sharedObjectRef(identity); - const controllerCapArg = tx.objectRef(controllerCap); - const tokenIdArg = tx.pure.id(delegationTokenId); - - tx.moveCall({ - target: `${packageId}::identity::revoke_delegation_token`, - arguments: [identityArg, controllerCapArg, tokenIdArg], - }); - - return tx.build({ onlyTransactionKind: true }); -} - -export async function unrevokeDelegationToken( - identity: SharedObjectRef, - controllerCap: ObjectRef, - delegationTokenId: string, - packageId: string, -): Promise { - const tx = new Transaction(); - - const identityArg = tx.sharedObjectRef(identity); - const controllerCapArg = tx.objectRef(controllerCap); - const tokenIdArg = tx.pure.id(delegationTokenId); - - tx.moveCall({ - target: `${packageId}::identity::unrevoke_delegation_token`, - arguments: [identityArg, controllerCapArg, tokenIdArg], - }); - - return tx.build({ onlyTransactionKind: true }); -} - -export async function destroyDelegationToken( - identity: SharedObjectRef, - delegationToken: ObjectRef, - packageId: string, -): Promise { - const tx = new Transaction(); - - const identityArg = tx.sharedObjectRef(identity); - const tokenArg = tx.objectRef(delegationToken); - - tx.moveCall({ - target: `${packageId}::identity::destroy_delegation_token`, - arguments: [identityArg, tokenArg], - }); - - return tx.build({ onlyTransactionKind: true }); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/controller_execution.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/controller_execution.ts deleted file mode 100644 index 8d03f06a36..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/controller_execution.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction, TransactionArgument } from "@iota/iota-sdk/transactions"; -import { controllerTokenRefToTxArgument, putBackControllerToken } from "../utils"; -import { ControllerTokenRef } from "./controller"; - -export function proposeControllerExecution( - identity: SharedObjectRef, - capability: ControllerTokenRef, - controllerCapId: string, - packageId: string, - expiration?: number, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const exp = tx.pure.option("u64", expiration); - const controllerCapIdArg = tx.pure.id(controllerCapId); - - tx.moveCall({ - target: `${packageId}::identity::propose_controller_execution`, - arguments: [identityArg, cap.token, controllerCapIdArg, exp], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} - -export function executeControllerExecution( - identity: SharedObjectRef, - capability: ControllerTokenRef, - proposalId: string, - controllerCapRef: ObjectRef, - intentFn: (arg0: Transaction, arg1: TransactionArgument) => void, - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const proposal = tx.pure.id(proposalId); - const identityArg = tx.sharedObjectRef(identity); - - let action = tx.moveCall({ - target: `${packageId}::identity::execute_proposal`, - typeArguments: [`${packageId}::borrow_proposal::Borrow`], - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - const receiving = tx.receivingRef(controllerCapRef); - const BorrowedControllerCap = tx.moveCall({ - target: `${packageId}::identity::borrow_controller_cap`, - arguments: [identityArg, action, receiving], - }); - - intentFn(tx, BorrowedControllerCap); - - tx.moveCall({ - target: `${packageId}::controller_proposal::put_back`, - arguments: [action, BorrowedControllerCap], - }); - - return tx.build(); -} - -export function createAndExecuteControllerExecution( - identity: SharedObjectRef, - capability: ControllerTokenRef, - controllerCapRef: ObjectRef, - intentFn: (arg0: Transaction, arg1: TransactionArgument) => void, - packageId: string, - expiration?: number, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const exp = tx.pure.option("u64", expiration); - const controller_cap_id = tx.pure.id(controllerCapRef.objectId); - - const proposal = tx.moveCall({ - target: `${packageId}::identity::propose_controller_execution`, - arguments: [identityArg, cap.token, controller_cap_id, exp], - }); - - let action = tx.moveCall({ - target: `${packageId}::identity::execute_proposal`, - typeArguments: [`${packageId}::borrow_proposal::Borrow`], - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - const receiving = tx.receivingRef(controllerCapRef); - const borrowedControllerCap = tx.moveCall({ - target: `${packageId}::identity::borrow_controller_cap`, - arguments: [identityArg, action, receiving], - }); - - intentFn(tx, borrowedControllerCap); - - tx.moveCall({ - target: `${packageId}::controller_proposal::put_back`, - arguments: [action, borrowedControllerCap], - }); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/create.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/create.ts deleted file mode 100644 index 36528b97e4..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/create.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { bcs } from "@iota/iota-sdk/bcs"; -import { Transaction } from "@iota/iota-sdk/transactions"; -import { getClockRef } from "../utils"; - -export async function create(didDoc: Uint8Array | undefined, packageId: string): Promise { - const tx = new Transaction(); - const didDocArg = tx.pure(bcs.option(bcs.vector(bcs.U8)).serialize(didDoc)); - const clock = getClockRef(tx); - - tx.moveCall({ - target: `${packageId}::identity::new`, - arguments: [didDocArg, clock], - }); - - return tx.build({ onlyTransactionKind: true }); -} - -export async function newWithControllers( - didDoc: Uint8Array | undefined, - controllers: [string, number, boolean][], - threshold: number, - packageId: string, -): Promise { - const tx = new Transaction(); - const controllers_no_delegate = controllers.filter(([_addr, _vp, can_delegate]) => !can_delegate); - const controllers_delegate = controllers.filter(([_addr, _vp, can_delegate]) => can_delegate); - const ids = tx.pure.vector("address", controllers_no_delegate.map(controller => controller[0])); - const vps = tx.pure.vector("u64", controllers_no_delegate.map(controller => controller[1])); - - const ids_delegate = tx.pure.vector("address", controllers_delegate.map(controller => controller[0])); - const vps_delegate = tx.pure.vector("u64", controllers_delegate.map(controller => controller[1])); - const controllersArg = tx.moveCall({ - target: `${packageId}::utils::vec_map_from_keys_values`, - typeArguments: ["address", "u64"], - arguments: [ids, vps], - }); - const controllersThatCanDelegate = tx.moveCall({ - target: `${packageId}::utils::vec_map_from_keys_values`, - typeArguments: ["address", "u64"], - arguments: [ids_delegate, vps_delegate], - }); - const didDocArg = tx.pure(bcs.option(bcs.vector(bcs.U8)).serialize(didDoc)); - const clock = getClockRef(tx); - const thresholdArg = tx.pure.u64(threshold); - - tx.moveCall({ - target: `${packageId}::identity::new_with_controllers`, - arguments: [didDocArg, controllersArg, controllersThatCanDelegate, thresholdArg, clock], - }); - - return await tx.build({ onlyTransactionKind: true }); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/index.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/index.ts deleted file mode 100644 index e2ab275617..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -export * from "./borrow_asset"; -export * from "./config"; -export * from "./controller"; -export * from "./controller_execution"; -export * from "./create"; -export * from "./proposal"; -export * from "./send_asset"; -export * from "./update"; -export * from "./upgrade"; diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/proposal.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/proposal.ts deleted file mode 100644 index f569a225a8..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/proposal.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; -import { controllerTokenRefToTxArgument, putBackControllerToken } from "../utils"; -import { ControllerTokenRef } from "./controller"; - -export function approve( - identity: SharedObjectRef, - capability: ControllerTokenRef, - proposalId: string, - proposalType: string, - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const proposal = tx.pure.id(proposalId); - - tx.moveCall({ - target: `${packageId}::identity::approve_proposal`, - typeArguments: [proposalType], - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/send_asset.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/send_asset.ts deleted file mode 100644 index 347533ba05..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/send_asset.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; -import { controllerTokenRefToTxArgument, putBackControllerToken } from "../utils"; -import { ControllerTokenRef } from "./controller"; - -export function proposeSend( - identity: SharedObjectRef, - capability: ControllerTokenRef, - transferMap: [string, string][], - packageId: string, - expiration?: number, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const exp = tx.pure.option("u64", expiration); - const objects = tx.pure.vector("id", transferMap.map(t => t[0])); - const recipients = tx.pure.vector("address", transferMap.map(t => t[1])); - - tx.moveCall({ - target: `${packageId}::identity::propose_send`, - arguments: [identityArg, cap.token, exp, objects, recipients], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} - -export function executeSend( - identity: SharedObjectRef, - capability: ControllerTokenRef, - proposalId: string, - objects: [ObjectRef, string][], - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const proposal = tx.pure.id(proposalId); - const identityArg = tx.sharedObjectRef(identity); - - let action = tx.moveCall({ - target: `${packageId}::identity::execute_proposal`, - typeArguments: [`${packageId}::transfer_proposal::Send`], - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - for (const [obj, objType] of objects) { - const recv_obj = tx.receivingRef(obj); - tx.moveCall({ - target: `${packageId}::identity::execute_send`, - typeArguments: [objType], - arguments: [identityArg, action, recv_obj], - }); - } - - tx.moveCall({ - target: `${packageId}::transfer_proposal::complete_send`, - arguments: [action], - }); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/update.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/update.ts deleted file mode 100644 index ebd99f6faa..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/update.ts +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { bcs } from "@iota/iota-sdk/bcs"; -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; -import { controllerTokenRefToTxArgument, getClockRef, putBackControllerToken } from "../utils"; -import { ControllerTokenRef } from "./controller"; - -export function proposeUpdate( - identity: SharedObjectRef, - capability: ControllerTokenRef, - didDoc: Uint8Array | undefined, - packageId: string, - expiration?: number, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const exp = tx.pure.option("u64", expiration); - const doc = tx.pure(bcs.option(bcs.vector(bcs.U8)).serialize(didDoc)); - const clock = getClockRef(tx); - - tx.moveCall({ - target: `${packageId}::identity::propose_update`, - arguments: [identityArg, cap.token, doc, exp, clock], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build({ onlyTransactionKind: true }); -} - -export function executeUpdate( - identity: SharedObjectRef, - capability: ControllerTokenRef, - proposalId: string, - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const proposal = tx.pure.id(proposalId); - const identityArg = tx.sharedObjectRef(identity); - const clock = getClockRef(tx); - - tx.moveCall({ - target: `${packageId}::identity::execute_update`, - arguments: [identityArg, cap.token, proposal, clock], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build({ onlyTransactionKind: true }); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/upgrade.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/upgrade.ts deleted file mode 100644 index 46ac45e9ba..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/identity/upgrade.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { Transaction } from "@iota/iota-sdk/transactions"; -import { controllerTokenRefToTxArgument, putBackControllerToken } from "../utils"; -import { ControllerTokenRef } from "./controller"; - -export function proposeUpgrade( - identity: SharedObjectRef, - capability: ControllerTokenRef, - packageId: string, - expiration?: number, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const identityArg = tx.sharedObjectRef(identity); - const exp = tx.pure.option("u64", expiration); - - tx.moveCall({ - target: `${packageId}::identity::propose_upgrade`, - arguments: [identityArg, cap.token, exp], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} - -export function executeUpgrade( - identity: SharedObjectRef, - capability: ControllerTokenRef, - proposalId: string, - packageId: string, -): Promise { - const tx = new Transaction(); - const cap = controllerTokenRefToTxArgument(tx, capability, packageId); - const proposal = tx.pure.id(proposalId); - const identityArg = tx.sharedObjectRef(identity); - - tx.moveCall({ - target: `${packageId}::identity::execute_upgrade`, - arguments: [identityArg, cap.token, proposal], - }); - - putBackControllerToken(tx, cap, packageId); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/index.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/index.ts deleted file mode 100644 index 7c8b6e125f..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -export * as asset from "./asset"; -export * as identity from "./identity"; -export * from "./migration"; diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/migration.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/migration.ts deleted file mode 100644 index e29cd620fa..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/migration.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { SharedObjectRef } from "@iota/iota-sdk/dist/cjs/bcs/types"; -import { ObjectRef, Transaction } from "@iota/iota-sdk/transactions"; -import { getClockRef } from "./utils"; - -export function migrateDidOutput( - didOutput: ObjectRef, - migrationRegistry: SharedObjectRef, - packageId: string, - creationTimestamp?: number, -): Promise { - const tx = new Transaction(); - const did_output = tx.objectRef(didOutput); - const migration_registry = tx.sharedObjectRef(migrationRegistry); - const clock = getClockRef(tx); - let timestamp; - if (creationTimestamp) { - timestamp = tx.pure.u64(creationTimestamp); - } else { - timestamp = tx.moveCall({ - target: "0x2::clock::timestamp_ms", - arguments: [clock], - }); - } - - tx.moveCall({ - target: `${packageId}::migration::migrate_alias_output`, - arguments: [did_output, migration_registry, timestamp, clock], - }); - - return tx.build(); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/move_calls/utils.ts b/bindings/wasm/iota_interaction_ts/lib/move_calls/utils.ts deleted file mode 100644 index aeac4977ec..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/move_calls/utils.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ObjectRef, Transaction, TransactionArgument } from "@iota/iota-sdk/transactions"; -import { IOTA_CLOCK_OBJECT_ID } from "@iota/iota-sdk/utils"; -import { ControllerTokenRef } from "./identity"; - -const PLACEHOLDER_SENDER = "0x00000000000000090807060504030201"; -const PLACEHOLDER_GAS_BUDGET = 9; -const PLACEHOLDER_GAS_PRICE = 8; -const PLACEHOLDER_GAS_PAYMENT: ObjectRef[] = []; - -export function getClockRef(tx: Transaction): TransactionArgument { - return tx.sharedObjectRef({ objectId: IOTA_CLOCK_OBJECT_ID, initialSharedVersion: 1, mutable: false }); -} - -export interface ControllerTokenArg { - cap?: TransactionArgument; - token: TransactionArgument; - borrow?: TransactionArgument; -} - -export function controllerTokenRefToTxArgument( - tx: Transaction, - controllerToken: ControllerTokenRef, - packageId: string, -): ControllerTokenArg { - const token = tx.objectRef(controllerToken.objectRef); - if (controllerToken.type == "DelegationToken") { - return { token }; - } else { - const [delegation_token, borrow] = tx.moveCall({ - target: `${packageId}::controller::borrow`, - arguments: [token], - }); - return { cap: token, token: delegation_token, borrow }; - } -} - -export function putBackControllerToken( - tx: Transaction, - controllerToken: ControllerTokenArg, - packageId: string, -) { - if (controllerToken.cap && controllerToken.borrow) { - tx.moveCall({ - target: `${packageId}::controller::put_back`, - arguments: [controllerToken.cap, controllerToken.token, controllerToken.borrow], - }); - } -} - -/** - * Inserts placeholders related to sender and payment into transaction. - * - * This is required if wanting to call `tx.build`, as this will check if these values have been set. - * - * @param tx transaction to update - */ -export function insertPlaceholders(tx: Transaction) { - tx.setGasPrice(PLACEHOLDER_GAS_PRICE); - tx.setGasBudget(PLACEHOLDER_GAS_BUDGET); - tx.setGasPayment([...PLACEHOLDER_GAS_PAYMENT]); // make sure, we're not sharing the array between tx - tx.setSender(PLACEHOLDER_SENDER); -} diff --git a/bindings/wasm/iota_interaction_ts/lib/tsconfig.json b/bindings/wasm/iota_interaction_ts/lib/tsconfig.json deleted file mode 100644 index 9bee396afd..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../tsconfig.node.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "../lib": [ - "." - ], - "~iota_interaction_ts": [ - "../node/iota_interaction_ts", - "./iota_interaction_ts.js" - ] - }, - "outDir": "../node", - "declarationDir": "../node" - } -} diff --git a/bindings/wasm/iota_interaction_ts/lib/tsconfig.web.json b/bindings/wasm/iota_interaction_ts/lib/tsconfig.web.json deleted file mode 100644 index b1937c9cbb..0000000000 --- a/bindings/wasm/iota_interaction_ts/lib/tsconfig.web.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "target": "ES2020", - "baseUrl": "./", - "paths": { - "../lib": [ - "." - ], - "~iota_interaction_ts": [ - "../web/iota_interaction_ts", - "./iota_interaction_ts.js" - ] - }, - "outDir": "../web", - "declarationDir": "../web", - "module": "ES2020" - } -} diff --git a/bindings/wasm/iota_interaction_ts/package-lock.json b/bindings/wasm/iota_interaction_ts/package-lock.json deleted file mode 100644 index ff0c6f9bd0..0000000000 --- a/bindings/wasm/iota_interaction_ts/package-lock.json +++ /dev/null @@ -1,1068 +0,0 @@ -{ - "name": "@iota/iota-interaction-ts", - "version": "0.3.3", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@iota/iota-interaction-ts", - "version": "0.3.3", - "license": "Apache-2.0", - "devDependencies": { - "@types/node": "^22.0.0", - "dprint": "^0.33.0", - "rimraf": "^6.0.1", - "tsconfig-paths": "^4.1.0", - "typescript": "^5.7.3", - "wasm-opt": "^1.4.0" - }, - "engines": { - "node": ">=20" - }, - "peerDependencies": { - "@iota/iota-sdk": "^0.6.0" - } - }, - "node_modules/@0no-co/graphql.web": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/@0no-co/graphql.web/-/graphql.web-1.0.13.tgz", - "integrity": "sha512-jqYxOevheVTU1S36ZdzAkJIdvRp2m3OYIG5SEoKDw5NI8eVwkoI0D/Q3DYNGmXCxkA6CQuoa7zvMiDPTLqUNuw==", - "license": "MIT", - "peer": true, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" - }, - "peerDependenciesMeta": { - "graphql": { - "optional": true - } - } - }, - "node_modules/@0no-co/graphqlsp": { - "version": "1.12.16", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.16.tgz", - "integrity": "sha512-B5pyYVH93Etv7xjT6IfB7QtMBdaaC07yjbhN6v8H7KgFStMkPvi+oWYBTibMFRMY89qwc9H8YixXg8SXDVgYWw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@gql.tada/cli-utils": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.6.3.tgz", - "integrity": "sha512-jFFSY8OxYeBxdKi58UzeMXG1tdm4FVjXa8WHIi66Gzu9JWtCE6mqom3a8xkmSw+mVaybFW5EN2WXf1WztJVNyQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@0no-co/graphqlsp": "^1.12.13", - "@gql.tada/internal": "1.0.8", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - }, - "peerDependencies": { - "@0no-co/graphqlsp": "^1.12.13", - "@gql.tada/svelte-support": "1.0.1", - "@gql.tada/vue-support": "1.0.1", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - }, - "peerDependenciesMeta": { - "@gql.tada/svelte-support": { - "optional": true - }, - "@gql.tada/vue-support": { - "optional": true - } - } - }, - "node_modules/@gql.tada/internal": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.8.tgz", - "integrity": "sha512-XYdxJhtHC5WtZfdDqtKjcQ4d7R1s0d1rnlSs3OcBEUbYiPoJJfZU7tWsVXuv047Z6msvmr4ompJ7eLSK5Km57g==", - "license": "MIT", - "peer": true, - "dependencies": { - "@0no-co/graphql.web": "^1.0.5" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@graphql-typed-document-node/core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "license": "MIT", - "peer": true, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@iota/bcs": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@iota/bcs/-/bcs-0.2.1.tgz", - "integrity": "sha512-T+iv5gZhUZP7BiDY7+Ir4MA2rYmyGNZA2b+nxjv219Fp8klFt+l38OWA+1RgJXrCmzuZ+M4hbMAeHhHziURX6Q==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "bs58": "^6.0.0" - } - }, - "node_modules/@iota/iota-sdk": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@iota/iota-sdk/-/iota-sdk-0.6.0.tgz", - "integrity": "sha512-NEYiE7bdWw2DA3vLV7dO2EnoLDljN9NPhYrjfDGefTbIS9XpqX0JZTHMi//Q/K0aO4NwSHR5gu7n/ywoOTzTKg==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@graphql-typed-document-node/core": "^3.2.0", - "@iota/bcs": "0.2.1", - "@noble/curves": "^1.4.2", - "@noble/hashes": "^1.4.0", - "@scure/bip32": "^1.4.0", - "@scure/bip39": "^1.3.0", - "@suchipi/femver": "^1.0.0", - "bech32": "^2.0.0", - "gql.tada": "^1.8.2", - "graphql": "^16.9.0", - "tweetnacl": "^1.0.3", - "valibot": "^0.36.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@iota/iota-sdk/node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "license": "Unlicense", - "peer": 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, - "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/@noble/curves": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@noble/hashes": "1.7.1" - }, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", - "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/base": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz", - "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==", - "license": "MIT", - "peer": true, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", - "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@noble/curves": "~1.8.1", - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", - "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.4" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@suchipi/femver": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", - "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==", - "license": "MIT", - "peer": true - }, - "node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, - "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, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "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, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base-x": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.0.tgz", - "integrity": "sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ==", - "license": "MIT", - "peer": true - }, - "node_modules/bech32": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", - "license": "MIT", - "peer": true - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/bs58": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", - "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", - "license": "MIT", - "peer": true, - "dependencies": { - "base-x": "^5.0.0" - } - }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/dprint": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.33.0.tgz", - "integrity": "sha512-VploASP7wL1HAYe5xWZKRwp8gW5zTdcG3Tb60DASv6QLnGKsl+OS+bY7wsXFrS4UcIbUNujXdsNG5FxBfRJIQg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "yauzl": "=2.10.0" - }, - "bin": { - "dprint": "bin.js" - } - }, - "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 - }, - "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 - }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "pend": "~1.2.0" - } - }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/glob": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz", - "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/gql.tada": { - "version": "1.8.10", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.8.10.tgz", - "integrity": "sha512-FrvSxgz838FYVPgZHGOSgbpOjhR+yq44rCzww3oOPJYi0OvBJjAgCiP6LEokZIYND2fUTXzQAyLgcvgw1yNP5A==", - "license": "MIT", - "peer": true, - "dependencies": { - "@0no-co/graphql.web": "^1.0.5", - "@0no-co/graphqlsp": "^1.12.13", - "@gql.tada/cli-utils": "1.6.3", - "@gql.tada/internal": "1.0.8" - }, - "bin": { - "gql-tada": "bin/cli.js", - "gql.tada": "bin/cli.js" - }, - "peerDependencies": { - "typescript": "^5.0.0" - } - }, - "node_modules/graphql": { - "version": "16.10.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", - "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/jackspeak": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.0.tgz", - "integrity": "sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==", - "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/lru-cache": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", - "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", - "dev": true, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dev": true, - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "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==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "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 - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true, - "license": "MIT" - }, - "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", - "dev": true, - "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "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, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "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, - "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/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, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/string-width-cjs/node_modules/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, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "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, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "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, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/tar": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "dev": true, - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/tsconfig-paths": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", - "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "json5": "^2.2.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "dev": true, - "license": "MIT" - }, - "node_modules/valibot": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.36.0.tgz", - "integrity": "sha512-CjF1XN4sUce8sBK9TixrDqFM7RwNkuXdJu174/AwmQUB62QbCQADg5lLe8ldBalFgtj1uKj+pKwDJiNo4Mn+eQ==", - "license": "MIT", - "peer": true - }, - "node_modules/wasm-opt": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/wasm-opt/-/wasm-opt-1.4.0.tgz", - "integrity": "sha512-wIsxxp0/FOSphokH4VOONy1zPkVREQfALN+/JTvJPK8gFSKbsmrcfECu2hT7OowqPfb4WEMSMceHgNL0ipFRyw==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "node-fetch": "^2.6.9", - "tar": "^6.1.13" - }, - "bin": { - "wasm-opt": "bin/wasm-opt.js" - } - }, - "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==", - "dev": true - }, - "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==", - "dev": true, - "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", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "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, - "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/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, - "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/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/wrap-ansi-cjs/node_modules/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, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/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, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - } - } -} diff --git a/bindings/wasm/iota_interaction_ts/package.json b/bindings/wasm/iota_interaction_ts/package.json deleted file mode 100644 index 3f4eadcb67..0000000000 --- a/bindings/wasm/iota_interaction_ts/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@iota/iota-interaction-ts", - "author": "IOTA Foundation ", - "description": "WASM bindings importing types from the IOTA Client typescript SDK to be used in Rust", - "homepage": "https://www.iota.org", - "version": "0.3.3", - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "git+https://github.com/iotaledger/identity.rs.git" - }, - "scripts": { - "build:src": "cargo build --lib --release --target wasm32-unknown-unknown --target-dir ../target", - "build:src:node": "cargo build --lib --release --target wasm32-unknown-unknown --features keytool --target-dir ../target", - "prebundle:nodejs": "rimraf node", - "bundle:nodejs": "wasm-bindgen ../target/wasm32-unknown-unknown/release/iota_interaction_ts.wasm --typescript --weak-refs --target nodejs --out-dir node && node ../build/node iota_interaction_ts && tsc --project ./lib/tsconfig.json && node ../build/replace_paths ./lib/tsconfig.json node iota_interaction_ts", - "prebundle:web": "rimraf web", - "bundle:web": "wasm-bindgen ../target/wasm32-unknown-unknown/release/iota_interaction_ts.wasm --typescript --target web --out-dir web && node ../build/web iota_interaction_ts && tsc --project ./lib/tsconfig.web.json && node ../build/replace_paths ./lib/tsconfig.web.json web iota_interaction_ts", - "build:nodejs": "npm run build:src:node && npm run bundle:nodejs && wasm-opt -O node/iota_interaction_ts_bg.wasm -o node/iota_interaction_ts_bg.wasm", - "build:web": "npm run build:src && npm run bundle:web && wasm-opt -O web/iota_interaction_ts_bg.wasm -o web/iota_interaction_ts_bg.wasm", - "build": "npm run build:web && npm run build:nodejs", - "fmt": "dprint fmt" - }, - "bugs": { - "url": "https://github.com/iotaledger/identity.rs/issues" - }, - "publishConfig": { - "access": "public" - }, - "files": [ - "web/*", - "node/*" - ], - "devDependencies": { - "@types/node": "^22.0.0", - "dprint": "^0.33.0", - "rimraf": "^6.0.1", - "tsconfig-paths": "^4.1.0", - "typescript": "^5.7.3", - "wasm-opt": "^1.4.0" - }, - "peerDependencies": { - "@iota/iota-sdk": "^0.6.0" - }, - "engines": { - "node": ">=20" - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/asset_move_calls.rs b/bindings/wasm/iota_interaction_ts/src/asset_move_calls.rs deleted file mode 100644 index be0b7a0878..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/asset_move_calls.rs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::types::execution_status::CommandArgumentError; -use js_sys::Uint8Array; -use serde::Serialize; -use wasm_bindgen::prelude::wasm_bindgen; -use wasm_bindgen::JsValue; - -use crate::bindings::WasmObjectRef; -use crate::bindings::WasmSharedObjectRef; -use crate::error::TsSdkError; -use crate::error::WasmError; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::AssetMoveCalls; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::ProgrammableTransactionBcs; - -#[wasm_bindgen(module = "@iota/iota-interaction-ts/move_calls/asset")] -extern "C" { - #[wasm_bindgen(js_name = "create", catch)] - pub(crate) async fn new_asset( - inner_bytes: &[u8], - inner_type: &str, - mutable: bool, - transferable: bool, - deletable: bool, - package: &str, - ) -> Result; - - #[wasm_bindgen(catch, js_name = "remove")] - pub(crate) async fn delete(asset: WasmObjectRef, asset_type: &str, package: &str) -> Result; - - #[wasm_bindgen(catch)] - pub(crate) async fn update( - asset: WasmObjectRef, - content: &[u8], - content_type: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(catch)] - pub(crate) async fn transfer( - asset: WasmObjectRef, - asset_type: &str, - recipient: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "acceptProposal", catch)] - pub(crate) async fn accept_proposal( - proposal: WasmSharedObjectRef, - recipient_cap: WasmObjectRef, - asset: WasmObjectRef, - asset_type: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "concludeOrCancel", catch)] - pub(crate) async fn conclude_or_cancel( - proposal: WasmSharedObjectRef, - sender_cap: WasmObjectRef, - asset: WasmObjectRef, - asset_type: &str, - package: &str, - ) -> Result; -} - -pub struct AssetMoveCallsTsSdk {} - -impl AssetMoveCalls for AssetMoveCallsTsSdk { - type Error = TsSdkError; - - fn new_asset( - inner: &T, - mutable: bool, - transferable: bool, - deletable: bool, - package: ObjectID, - ) -> Result { - let inner_bytes = bcs::to_bytes(inner).map_err(|_| CommandArgumentError::InvalidBCSBytes)?; - let inner_type = T::move_type(package).to_string(); - let package = package.to_string(); - - futures::executor::block_on(new_asset( - &inner_bytes, - &inner_type, - mutable, - transferable, - deletable, - &package, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn delete(asset: ObjectRef, package: ObjectID) -> Result { - let asset = asset.into(); - let asset_type = T::move_type(package).to_string(); - let package = package.to_string(); - - futures::executor::block_on(delete(asset, &asset_type, &package)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn transfer( - asset: ObjectRef, - recipient: IotaAddress, - package: ObjectID, - ) -> Result { - let asset = asset.into(); - let asset_type = T::move_type(package).to_string(); - let recipient = recipient.to_string(); - let package = package.to_string(); - - futures::executor::block_on(transfer(asset, &asset_type, &recipient, &package)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn make_tx( - _proposal: (ObjectID, SequenceNumber), - _cap: ObjectRef, - _asset: ObjectRef, - _asset_type_param: TypeTag, - _package: ObjectID, - _function_name: &'static str, - ) -> Result { - unimplemented!(); - } - - fn accept_proposal( - proposal: (ObjectID, SequenceNumber), - recipient_cap: ObjectRef, - asset: ObjectRef, - asset_type: TypeTag, - package: ObjectID, - ) -> Result { - let proposal = (proposal.0, proposal.1, true).into(); - let asset = asset.into(); - let asset_type = asset_type.to_canonical_string(true); - let recipient = recipient_cap.into(); - let package = package.to_string(); - - futures::executor::block_on(accept_proposal(proposal, recipient, asset, &asset_type, &package)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn conclude_or_cancel( - proposal: (ObjectID, SequenceNumber), - sender_cap: ObjectRef, - asset: ObjectRef, - asset_type: TypeTag, - package: ObjectID, - ) -> Result { - let proposal = (proposal.0, proposal.1, true).into(); - let asset = asset.into(); - let asset_type = asset_type.to_canonical_string(true); - let sender = sender_cap.into(); - let package = package.to_string(); - - futures::executor::block_on(conclude_or_cancel(proposal, sender, asset, &asset_type, &package)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn update( - asset: ObjectRef, - new_content: &T, - package: ObjectID, - ) -> Result { - let asset = asset.into(); - let content_type = T::move_type(package).to_string(); - let content = bcs::to_bytes(new_content).map_err(|_| CommandArgumentError::InvalidBCSBytes)?; - let package = package.to_string(); - - futures::executor::block_on(update(asset, &content, &content_type, &package)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/bindings/keytool/mod.rs b/bindings/wasm/iota_interaction_ts/src/bindings/keytool/mod.rs deleted file mode 100644 index 4bc1a321ad..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/bindings/keytool/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -mod signer; -mod storage; - -pub use signer::*; -pub use storage::*; diff --git a/bindings/wasm/iota_interaction_ts/src/bindings/keytool/signer.rs b/bindings/wasm/iota_interaction_ts/src/bindings/keytool/signer.rs deleted file mode 100644 index a5d77cc289..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/bindings/keytool/signer.rs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::str::FromStr; - -use crate::error::Result; -use crate::error::WasmResult; -use fastcrypto::traits::EncodeDecodeBase64 as _; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::KeytoolSigner; -use identity_iota_interaction::KeytoolSignerBuilder; -use secret_storage::Signer; -use serde_json::Value; -use wasm_bindgen::prelude::wasm_bindgen; -use wasm_bindgen::JsError; - -use crate::WasmPublicKey; - -#[wasm_bindgen(module = buffer)] -extern "C" { - #[wasm_bindgen(typescript_type = Buffer)] - type NodeBuffer; - #[wasm_bindgen(method, js_name = toString)] - fn to_string(this: &NodeBuffer) -> String; -} - -#[wasm_bindgen(module = child_process)] -extern "C" { - #[wasm_bindgen(js_name = execSync, catch)] - fn exec_cli_cmd(cmd: &str) -> Result; -} - -/// An implementation of the Signer interface that relies on -/// IOTA Keytool. -#[wasm_bindgen(js_name = KeytoolSigner)] -pub struct WasmKeytoolSigner(pub(crate) KeytoolSigner); - -#[wasm_bindgen(js_class = KeytoolSigner)] -impl WasmKeytoolSigner { - /// Returns a new {@link KeytoolSigner}. The optional parameters respectively - /// allow to set the signing address and the `iota` binary to use. Defaults - /// to use the current active address and the binary found in $PATH. - #[wasm_bindgen(constructor)] - pub fn new(address: Option, iota_bin_location: Option) -> Result { - let address = address - .as_deref() - .map(IotaAddress::from_str) - .transpose() - .wasm_result()?; - - let builder = address - .map(|address| KeytoolSignerBuilder::new().with_address(address)) - .unwrap_or_default(); - let builder = if let Some(iota_bin_location) = iota_bin_location { - builder.iota_bin_location(iota_bin_location) - } else { - builder - }; - - Ok(WasmKeytoolSigner(builder.build().wasm_result()?)) - } - - /// Returns the signing address. - #[wasm_bindgen] - pub fn address(&self) -> String { - self.0.address().to_string() - } - - // These method definition are needed to make sure `KeytoolSigner` - // implements `Signer` interface. - - #[wasm_bindgen(js_name = keyId)] - pub fn key_id(&self) -> String { - self.address() - } - - #[wasm_bindgen(js_name = publicKey)] - pub async fn public_key(&self) -> Result { - self.0.public_key().try_into() - } - - #[wasm_bindgen] - pub async fn sign(&self, tx_data_bcs: &[u8]) -> Result { - let tx_data = bcs::from_bytes(tx_data_bcs).map_err(|e| JsError::new(&e.to_string()))?; - self - .0 - .sign(&tx_data) - .await - .map(|sig| sig.encode_base64()) - .map_err(|e| JsError::new(&e.to_string()).into()) - } - - #[wasm_bindgen(js_name = iotaPublicKeyBytes)] - pub async fn iota_public_key_bytes(&self) -> Vec { - let pk = self.0.public_key(); - let mut bytes = vec![pk.flag()]; - bytes.extend_from_slice(pk.as_ref()); - - bytes - } -} - -// This is used in KeytoolSigner implementation to issue CLI commands. -#[no_mangle] -pub extern "Rust" fn __wasm_exec_iota_cmd(cmd: &str) -> anyhow::Result { - let output = exec_cli_cmd(cmd) - .map_err(|e| anyhow::anyhow!("exec failed: {e:?}"))? - .to_string(); - serde_json::from_str(&output).map_err(|_| anyhow::anyhow!("failed to deserialize JSON object from command output")) -} diff --git a/bindings/wasm/iota_interaction_ts/src/bindings/keytool/storage.rs b/bindings/wasm/iota_interaction_ts/src/bindings/keytool/storage.rs deleted file mode 100644 index a78951a460..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/bindings/keytool/storage.rs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::str::FromStr; - -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::crypto::IotaKeyPair; -use identity_iota_interaction::types::crypto::SignatureScheme; -use identity_iota_interaction::KeytoolStorage; -use js_sys::Array; -use js_sys::JsString; -use wasm_bindgen::prelude::*; - -use crate::error::Result; -use crate::error::WasmResult; -use crate::WasmPublicKey; - -use super::signer::WasmKeytoolSigner; - -const __TS_IMPORTS: &str = r#" -import { PublicKey } from "@iota/iota-sdk/cryptography"; -"#; - -fn make_pk_alias_tuple(pk: &WasmPublicKey, alias: &str) -> Array { - let arr = Array::new(); - arr.push(pk.as_ref()); - arr.push(JsString::from(alias).as_ref()); - - arr -} - -/// IOTA Keytool CLI wrapper. -#[derive(Default, Clone)] -#[wasm_bindgen(js_name = KeytoolStorage)] -pub struct WasmKeytoolStorage(pub(crate) KeytoolStorage); - -impl AsRef for WasmKeytoolStorage { - fn as_ref(&self) -> &KeytoolStorage { - &self.0 - } -} - -#[wasm_bindgen(js_class = KeytoolStorage)] -impl WasmKeytoolStorage { - /// Creates a new {@link KeytoolStorage} that wraps the given iota binary. - /// Attempts to use the one in PATH if none is provided. - #[wasm_bindgen(constructor)] - pub fn new(iota_bin: Option) -> Self { - iota_bin - .as_deref() - .map(KeytoolStorage::new_with_custom_bin) - .map(Self) - .unwrap_or_default() - } - - /// Returns a {@link KeytoolSigner} that will use the provided `address` - /// to sign transactions. If no address is provided the current active - /// one will be used. - pub fn signer(&self, address: Option) -> Result { - let address = address.map(|s| IotaAddress::from_str(&s)).transpose().wasm_result()?; - let mut signer_builder = self.0.signer(); - if let Some(address) = address { - signer_builder = signer_builder.with_address(address); - } - - signer_builder.build().map(WasmKeytoolSigner).wasm_result() - } - - /// Creates a new key of type `key_scheme`. - /// Returns the tuple ([`PublicKey`](https://docs.iota.org/ts-sdk/api/cryptography/classes/PublicKey), alias). - #[wasm_bindgen( - js_name = generateKey, - unchecked_return_type = "[PublicKey, string]", - )] - pub fn generate_key( - &self, - #[wasm_bindgen(unchecked_param_type = "'ed25519' | 'secp256r1' | 'secp256k1'")] key_scheme: &str, - ) -> Result { - let key_scheme = match key_scheme { - "ed25519" => SignatureScheme::ED25519, - "secp256r1" => SignatureScheme::Secp256r1, - "secp256k1" => SignatureScheme::Secp256k1, - _ => return Err(JsError::new("invalid key type").into()), - }; - - self - .0 - .generate_key(key_scheme) - .wasm_result() - .map(|(pk, alias)| make_pk_alias_tuple(&WasmPublicKey::try_from(&pk).unwrap(), &alias)) - } - - /// Inserts a Bech32-encoded private key in the keystore. - /// The key must use the prefix `iotaprivkey`. - /// - /// Returns the key's alias. - #[wasm_bindgen(js_name = insertKey)] - pub fn insert_key(&self, bech32_secret_key: &str) -> Result { - let key = IotaKeyPair::decode(bech32_secret_key) - .map_err(|e| anyhow::anyhow!("{e:?}")) - .wasm_result()?; - self.0.insert_key(key).wasm_result() - } - - /// Signs `data` with `address`'s secret key. - #[wasm_bindgen(js_name = signRaw)] - pub fn sign_raw(&self, address: &str, data: &[u8]) -> Result> { - let address = address.parse().wasm_result()?; - self.0.sign_raw(address, data).wasm_result() - } - - /// Updates an alias from `old_alias` to `new_alias` - /// If no value for `new_alias` is provided, a randomly generated one will be used. - #[wasm_bindgen(js_name = updateAlias)] - pub fn update_alias(&self, old_alias: &str, new_alias: Option) -> Result<()> { - let new_alias = new_alias.as_deref(); - self.0.update_alias(old_alias, new_alias).wasm_result() - } - - /// Returns the [`PublicKey`](https://docs.iota.org/ts-sdk/api/cryptography/classes/PublicKey) for the given address together with its alias. - #[wasm_bindgen( - js_name = getKey, - unchecked_return_type = "[PublicKey, string]", - )] - pub fn get_key(&self, address: &str) -> Result { - let address = address.parse().wasm_result()?; - self - .0 - .get_key(address) - .wasm_result()? - .map(|(pk, alias)| make_pk_alias_tuple(&WasmPublicKey::try_from(&pk).unwrap(), &alias)) - .ok_or_else(|| anyhow::anyhow!("the requested address is not in the keystore")) - .wasm_result() - } - - /// Returns the [`PublicKey`](https://docs.iota.org/ts-sdk/api/cryptography/classes/PublicKey) that has the given alias. - #[wasm_bindgen(js_name = getKeyByAlias)] - pub fn get_key_by_alias(&self, alias: &str) -> Result { - self - .0 - .get_key_by_alias(alias) - .wasm_result()? - .map(|pk| WasmPublicKey::try_from(&pk).unwrap()) - .ok_or_else(|| anyhow::anyhow!("the requested alias is not in the keystore")) - .wasm_result() - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/bindings/mod.rs b/bindings/wasm/iota_interaction_ts/src/bindings/mod.rs deleted file mode 100644 index 095591007d..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/bindings/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[cfg(feature = "keytool")] -pub mod keytool; -mod types; -mod wasm_iota_client; -mod wasm_types; - -pub use types::*; -pub use wasm_iota_client::*; diff --git a/bindings/wasm/iota_interaction_ts/src/bindings/types.rs b/bindings/wasm/iota_interaction_ts/src/bindings/types.rs deleted file mode 100644 index fe0645f61b..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/bindings/types.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020-2023 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use wasm_bindgen::prelude::*; - -pub use super::wasm_types::*; - -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseBalance; -} diff --git a/bindings/wasm/iota_interaction_ts/src/bindings/wasm_iota_client.rs b/bindings/wasm/iota_interaction_ts/src/bindings/wasm_iota_client.rs deleted file mode 100644 index 0bf674cfe4..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/bindings/wasm_iota_client.rs +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright 2020-2023 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::error::Error as IotaRpcError; -use identity_iota_interaction::error::IotaRpcResult; -use identity_iota_interaction::generated_types::ExecuteTransactionBlockParams; -use identity_iota_interaction::generated_types::GetCoinsParams; -use identity_iota_interaction::generated_types::GetDynamicFieldObjectParams; -use identity_iota_interaction::generated_types::GetObjectParams; -use identity_iota_interaction::generated_types::GetOwnedObjectsParams; -use identity_iota_interaction::generated_types::GetTransactionBlockParams; -use identity_iota_interaction::generated_types::QueryEventsParams; -use identity_iota_interaction::generated_types::SortOrder; -use identity_iota_interaction::generated_types::WaitForTransactionParams; -use identity_iota_interaction::rpc_types::CoinPage; -use identity_iota_interaction::rpc_types::EventFilter; -use identity_iota_interaction::rpc_types::EventPage; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaObjectResponse; -use identity_iota_interaction::rpc_types::IotaObjectResponseQuery; -use identity_iota_interaction::rpc_types::IotaPastObjectResponse; -use identity_iota_interaction::rpc_types::IotaTransactionBlockResponseOptions; -use identity_iota_interaction::rpc_types::ObjectsPage; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::crypto::Signature; -use identity_iota_interaction::types::digests::TransactionDigest; -use identity_iota_interaction::types::dynamic_field::DynamicFieldName; -use identity_iota_interaction::types::event::EventID; -use identity_iota_interaction::types::quorum_driver_types::ExecuteTransactionRequestType; -use identity_iota_interaction::types::transaction::TransactionData; -use js_sys::Promise; -use serde::Serialize; -use wasm_bindgen::prelude::*; -use wasm_bindgen_futures::JsFuture; - -use super::wasm_types::PromiseIotaTransactionBlockResponse; -use super::wasm_types::WasmExecuteTransactionBlockParams; -use super::wasm_types::WasmIotaTransactionBlockResponseWrapper; -use super::PromiseDryRunTransactionBlockResponse; -use super::WasmDryRunTransactionBlockParams; -use super::WasmWaitForTransactionParams; - -use crate::bindings::PromiseIotaObjectResponse; -use crate::bindings::PromiseObjectRead; -use crate::bindings::PromisePaginatedCoins; -use crate::bindings::PromisePaginatedEvents; -use crate::bindings::PromisePaginatedObjectsResponse; -use crate::bindings::WasmGetCoinsParams; -use crate::bindings::WasmGetDynamicFieldObjectParams; -use crate::bindings::WasmGetObjectParams; -use crate::bindings::WasmGetOwnedObjectsParams; -use crate::bindings::WasmGetTransactionBlockParams; -use crate::bindings::WasmQueryEventsParams; -use crate::bindings::WasmTryGetPastObjectParams; -use crate::common::types::PromiseString; -use crate::common::PromiseBigint; -use crate::console_log; -use crate::error::into_ts_sdk_result; -use crate::error::TsSdkError; - -// This file contains the wasm-bindgen 'glue code' providing -// the interface of the TS Iota client to rust code. - -// The typescript declarations imported in the following typescript_custom_section -// can be used as arguments for rust functions via the typescript_type annotation. -// In other words: The typescript_type "IotaClient" is imported here to be bound -// to the WasmIotaClient functions below. -// TODO: check why this isn't done by `module` macro attribute for `WasmIotaClient` -#[wasm_bindgen(typescript_custom_section)] -const IOTA_CLIENT_TYPE: &'static str = r#" - import { IotaClient } from "@iota/iota-sdk/client"; -"#; - -#[wasm_bindgen(module = "@iota/iota-sdk/client")] -extern "C" { - #[wasm_bindgen(typescript_type = "IotaClient")] - #[derive(Clone)] - pub type WasmIotaClient; - - #[wasm_bindgen(method, js_name = getChainIdentifier)] - pub fn get_chain_identifier(this: &WasmIotaClient) -> PromiseString; - - #[wasm_bindgen(method, js_name = dryRunTransactionBlock)] - pub fn dry_run_transaction_block( - this: &WasmIotaClient, - params: &WasmDryRunTransactionBlockParams, - ) -> PromiseDryRunTransactionBlockResponse; - - #[wasm_bindgen(method, js_name = executeTransactionBlock)] - pub fn execute_transaction_block( - this: &WasmIotaClient, - params: &WasmExecuteTransactionBlockParams, - ) -> PromiseIotaTransactionBlockResponse; - - #[wasm_bindgen(method, js_name = getDynamicFieldObject)] - pub fn get_dynamic_field_object( - this: &WasmIotaClient, - input: &WasmGetDynamicFieldObjectParams, - ) -> PromiseIotaObjectResponse; - - #[wasm_bindgen(method, js_name = getObject)] - pub fn get_object(this: &WasmIotaClient, input: &WasmGetObjectParams) -> PromiseIotaObjectResponse; - - #[wasm_bindgen(method, js_name = getOwnedObjects)] - pub fn get_owned_objects(this: &WasmIotaClient, input: &WasmGetOwnedObjectsParams) - -> PromisePaginatedObjectsResponse; - - #[wasm_bindgen(method, js_name = getTransactionBlock)] - pub fn get_transaction_block( - this: &WasmIotaClient, - input: &WasmGetTransactionBlockParams, - ) -> PromiseIotaTransactionBlockResponse; - - #[wasm_bindgen(method, js_name = getReferenceGasPrice)] - pub fn get_reference_gas_price(this: &WasmIotaClient) -> PromiseBigint; - - #[wasm_bindgen(method, js_name = tryGetPastObject)] - pub fn try_get_past_object(this: &WasmIotaClient, input: &WasmTryGetPastObjectParams) -> PromiseObjectRead; - - #[wasm_bindgen(method, js_name = queryEvents)] - pub fn query_events(this: &WasmIotaClient, input: &WasmQueryEventsParams) -> PromisePaginatedEvents; - - #[wasm_bindgen(method, js_name = getCoins)] - pub fn get_coins(this: &WasmIotaClient, input: &WasmGetCoinsParams) -> PromisePaginatedCoins; - - #[wasm_bindgen(method, js_name = waitForTransaction)] - pub fn wait_for_transaction( - this: &WasmIotaClient, - input: &WasmWaitForTransactionParams, - ) -> PromiseIotaTransactionBlockResponse; -} - -// Helper struct used to convert TYPESCRIPT types to RUST types -#[derive(Clone)] -pub struct ManagedWasmIotaClient(pub(crate) WasmIotaClient); - -// convert TYPESCRIPT types to RUST types -impl ManagedWasmIotaClient { - pub fn new(iota_client: WasmIotaClient) -> Self { - ManagedWasmIotaClient(iota_client) - } - - pub async fn get_chain_identifier(&self) -> Result { - let promise: Promise = Promise::resolve(&WasmIotaClient::get_chain_identifier(&self.0)); - into_ts_sdk_result(JsFuture::from(promise).await) - } - - pub async fn execute_transaction_block( - &self, - tx_data: TransactionData, - signatures: Vec, - options: Option, - request_type: Option, - ) -> IotaRpcResult { - let params = ExecuteTransactionBlockParams::new(tx_data, signatures, options, request_type); - let wasm_params = params - .serialize(&serde_wasm_bindgen::Serializer::json_compatible()) - .map_err(|e| { - IotaRpcError::FfiError(format!( - "failed to convert ExecuteTransactionBlockParams to JS value: {e}" - )) - })? - .into(); - - let promise: Promise = Promise::resolve(&WasmIotaClient::execute_transaction_block(&self.0, &wasm_params)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - Ok(WasmIotaTransactionBlockResponseWrapper::new(result.into())) - } - - /** - * Return the dynamic field object information for a specified object - */ - pub async fn get_dynamic_field_object( - &self, - parent_object_id: ObjectID, - name: DynamicFieldName, - ) -> IotaRpcResult { - let params: WasmGetDynamicFieldObjectParams = - serde_wasm_bindgen::to_value(&GetDynamicFieldObjectParams::new(parent_object_id.to_string(), name)) - .map_err(|e| { - console_log!( - "Error executing serde_wasm_bindgen::to_value(WasmGetDynamicFieldObjectParams): {:?}", - e - ); - IotaRpcError::FfiError(format!("{:?}", e)) - })? - .into(); - - let promise: Promise = Promise::resolve(&WasmIotaClient::get_dynamic_field_object(&self.0, ¶ms)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - #[allow(deprecated)] // will be refactored - Ok(result.into_serde()?) - } - - pub async fn get_object_with_options( - &self, - object_id: ObjectID, - options: IotaObjectDataOptions, - ) -> IotaRpcResult { - let params: WasmGetObjectParams = - serde_wasm_bindgen::to_value(&GetObjectParams::new(object_id.to_string(), Some(options))) - .map_err(|e| { - console_log!( - "Error executing serde_wasm_bindgen::to_value(WasmIotaObjectDataOptions): {:?}", - e - ); - IotaRpcError::FfiError(format!("{:?}", e)) - })? - .into(); - - let promise: Promise = Promise::resolve(&WasmIotaClient::get_object(&self.0, ¶ms)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - #[allow(deprecated)] // will be refactored - Ok(result.into_serde()?) - } - - pub async fn get_owned_objects( - &self, - address: IotaAddress, - query: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult { - let params: WasmGetOwnedObjectsParams = serde_wasm_bindgen::to_value(&GetOwnedObjectsParams::new( - address.to_string(), - cursor.map(|v| v.to_string()), - limit, - query.clone().map(|v| v.filter).flatten(), - query.clone().map(|v| v.options).flatten(), - )) - .map_err(|e| { - console_log!( - "Error executing serde_wasm_bindgen::to_value(WasmIotaObjectDataOptions): {:?}", - e - ); - IotaRpcError::FfiError(format!("{:?}", e)) - })? - .into(); - - let promise: Promise = Promise::resolve(&WasmIotaClient::get_owned_objects(&self.0, ¶ms)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - #[allow(deprecated)] // will be refactored - Ok(result.into_serde()?) - } - - pub async fn get_transaction_with_options( - &self, - digest: TransactionDigest, - options: IotaTransactionBlockResponseOptions, - ) -> IotaRpcResult { - let params: WasmGetTransactionBlockParams = - serde_wasm_bindgen::to_value(&GetTransactionBlockParams::new(digest.to_string(), Some(options))) - .map_err(|e| { - console_log!( - "Error executing serde_wasm_bindgen::to_value(WasmIotaObjectDataOptions): {:?}", - e - ); - IotaRpcError::FfiError(format!("{:?}", e)) - })? - .into(); - - // Rust `ReadApi::get_transaction_with_options` calls `get_transaction_block` via http while - // TypeScript uses the name `getTransactionBlock` directly, so we have to call this function - let promise: Promise = Promise::resolve(&WasmIotaClient::get_transaction_block(&self.0, ¶ms)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - Ok(WasmIotaTransactionBlockResponseWrapper::new(result.into())) - } - - pub async fn get_reference_gas_price(&self) -> IotaRpcResult { - let promise: Promise = Promise::resolve(&WasmIotaClient::get_reference_gas_price(&self.0)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - serde_wasm_bindgen::from_value(result) - .map_err(|e| IotaRpcError::FfiError(format!("failed to deserialize gas price from JS value: {e}"))) - } - - pub async fn try_get_parsed_past_object( - &self, - _object_id: ObjectID, - _version: SequenceNumber, - _options: IotaObjectDataOptions, - ) -> IotaRpcResult { - // TODO: does not work anymore, find out, why we need to pass a different `SequenceNumber` now - unimplemented!("try_get_parsed_past_object"); - // let params: WasmTryGetPastObjectParams = serde_wasm_bindgen::to_value(&TryGetPastObjectParams::new( - // object_id.to_string(), - // version, - // Some(options), - // )) - // .map_err(|e| { - // console_log!( - // "Error executing serde_wasm_bindgen::to_value(WasmIotaObjectDataOptions): {:?}", - // e - // ); - // IotaRpcError::FfiError(format!("{:?}", e)) - // })? - // .into(); - - // let promise: Promise = Promise::resolve(&WasmIotaClient::try_get_past_object(&self.0, ¶ms)); - // let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - // console_log!("Error executing JsFuture::from(promise): {:?}", e); - // IotaRpcError::FfiError(format!("{:?}", e)) - // })?; - - // Ok(result.into_serde()?) - } - - pub async fn query_events( - &self, - query: EventFilter, - cursor: Option, - limit: Option, - descending_order: bool, - ) -> IotaRpcResult { - let params: WasmQueryEventsParams = serde_wasm_bindgen::to_value(&QueryEventsParams::new( - query, - cursor, - limit, - Some(SortOrder::new(descending_order)), - )) - .map_err(|e| { - console_log!( - "Error executing serde_wasm_bindgen::to_value(WasmIotaObjectDataOptions): {:?}", - e - ); - IotaRpcError::FfiError(format!("{:?}", e)) - })? - .into(); - - let promise: Promise = Promise::resolve(&WasmIotaClient::query_events(&self.0, ¶ms)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - #[allow(deprecated)] // will be refactored - Ok(result.into_serde()?) - } - - pub async fn get_coins( - &self, - owner: IotaAddress, - coin_type: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult { - let params: WasmGetCoinsParams = serde_wasm_bindgen::to_value(&GetCoinsParams::new( - owner.to_string(), - coin_type.map(|v| v.to_string()), - cursor.map(|v| v.to_string()), - limit, - )) - .map_err(|e| { - console_log!( - "Error executing serde_wasm_bindgen::to_value(WasmIotaObjectDataOptions): {:?}", - e - ); - IotaRpcError::FfiError(format!("{:?}", e)) - })? - .into(); - - let promise: Promise = Promise::resolve(&WasmIotaClient::get_coins(&self.0, ¶ms)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - #[allow(deprecated)] // will be refactored - Ok(result.into_serde()?) - } - - /// Wait for a transaction block result to be available over the API. - /// This can be used in conjunction with `execute_transaction_block` to wait for the transaction to - /// be available via the API. - /// This currently polls the `getTransactionBlock` API to check for the transaction. - /// - /// # Arguments - /// - /// * `digest` - The digest of the queried transaction. - /// * `options` - Options for specifying the content to be returned. - /// * `timeout` - The amount of time to wait for a transaction block. Defaults to one minute. - /// * `poll_interval` - The amount of time to wait between checks for the transaction block. Defaults to 2 seconds. - pub async fn wait_for_transaction( - &self, - digest: TransactionDigest, - options: Option, - timeout: Option, - poll_interval: Option, - ) -> IotaRpcResult { - let params_object = WaitForTransactionParams::new(digest.to_string(), options, timeout, poll_interval); - let params: WasmWaitForTransactionParams = serde_json::to_value(¶ms_object) - .map_err(|e| { - console_log!("Error serializing WaitForTransactionParams to Value: {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - }) - .and_then(|v| { - v.serialize(&serde_wasm_bindgen::Serializer::json_compatible()) - .map_err(|e| { - console_log!("Error serializing Value to WasmWaitForTransactionParams: {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - }) - })? - .into(); - - let promise: Promise = Promise::resolve(&WasmIotaClient::wait_for_transaction(&self.0, ¶ms)); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - console_log!("Error executing JsFuture::from(promise): {:?}", e); - IotaRpcError::FfiError(format!("{:?}", e)) - })?; - - Ok(WasmIotaTransactionBlockResponseWrapper::new(result.into())) - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/bindings/wasm_types.rs b/bindings/wasm/iota_interaction_ts/src/bindings/wasm_types.rs deleted file mode 100644 index 7e7abda810..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/bindings/wasm_types.rs +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 -use std::str::FromStr; - -use fastcrypto::encoding::Base64; -use fastcrypto::encoding::Encoding; -use fastcrypto::traits::EncodeDecodeBase64 as _; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::crypto::PublicKey; -use identity_iota_interaction::types::crypto::Signature; -use identity_iota_interaction::types::digests::TransactionDigest; -use identity_iota_interaction::types::execution_status::CommandArgumentError; -use identity_iota_interaction::types::object::Owner; -use identity_iota_interaction::types::transaction::TransactionData; -use identity_iota_interaction::ProgrammableTransactionBcs; -use js_sys::Promise; -use js_sys::Uint8Array; -use serde::Deserialize; -use serde::Serialize; -use wasm_bindgen::prelude::wasm_bindgen; -use wasm_bindgen::JsCast; -use wasm_bindgen::JsError; -use wasm_bindgen::JsValue; -use wasm_bindgen_futures::JsFuture; - -use crate::bindings::WasmIotaClient; -use crate::console_log; -use crate::error::TsSdkError; -use crate::error::WasmError; - -// TODO: fix/add signer or remove functions relying on it -type WasmStorageSigner = (); - -#[wasm_bindgen(typescript_custom_section)] -const TS_SDK_TYPES: &str = r#" - import { - Balance, - ExecuteTransactionBlockParams, - GetCoinsParams, - GetDynamicFieldObjectParams, - GetObjectParams, - GetOwnedObjectsParams, - GetTransactionBlockParams, - IotaClient, - IotaObjectData, - IotaObjectResponse, - IotaTransactionBlockResponse, - IotaTransactionBlockResponseOptions, - ObjectRead, - PaginatedCoins, - PaginatedEvents, - PaginatedObjectsResponse, - QueryEventsParams, - TryGetPastObjectParams, - } from "@iota/iota-sdk/client"; - import { bcs } from "@iota/iota-sdk/bcs"; - import { - executeTransaction, - WasmIotaTransactionBlockResponseWrapper, - } from "./iota_client_helpers" -"#; - -#[wasm_bindgen(module = "@iota/iota-sdk/client")] -extern "C" { - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseBalance; - - #[wasm_bindgen(typescript_type = "TransactionArgument")] - pub type WasmTransactionArgument; - - #[wasm_bindgen(typescript_type = "IotaObjectData")] - pub type WasmIotaObjectData; - - #[wasm_bindgen(typescript_type = "ExecuteTransactionBlockParams")] - #[derive(Clone)] - pub type WasmExecuteTransactionBlockParams; - - #[wasm_bindgen(typescript_type = "IotaTransactionBlockResponseOptions")] - #[derive(Clone)] - pub type WasmIotaTransactionBlockResponseOptions; - - #[wasm_bindgen(typescript_type = "IotaTransactionBlockResponse")] - #[derive(Clone)] - pub type WasmIotaTransactionBlockResponse; - - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseDryRunTransactionBlockResponse; - - #[wasm_bindgen(typescript_type = "DryRunTransactionBlockResponse")] - #[derive(Clone)] - pub type WasmDryRunTransactionBlockResponse; - - #[wasm_bindgen(typescript_type = "DryRunTransactionBlockParams")] - #[derive(Clone)] - pub type WasmDryRunTransactionBlockParams; - - #[derive(Clone)] - #[wasm_bindgen( - typescript_type = "TransactionEffects", - extends = js_sys::Object, - )] - pub type WasmIotaTransactionBlockEffects; - - #[wasm_bindgen(typescript_type = "GetDynamicFieldObjectParams")] - #[derive(Clone)] - pub type WasmGetDynamicFieldObjectParams; - - #[wasm_bindgen(typescript_type = "GetObjectParams")] - #[derive(Clone)] - pub type WasmGetObjectParams; - - #[wasm_bindgen(typescript_type = "Promise")] - #[derive(Clone)] - pub type PromiseIotaTransactionBlockResponse; - - #[wasm_bindgen(typescript_type = "Promise")] - #[derive(Clone)] - pub type PromiseIotaObjectResponse; - - #[wasm_bindgen(typescript_type = "GetOwnedObjectsParams")] - #[derive(Clone)] - pub type WasmGetOwnedObjectsParams; - - #[wasm_bindgen(typescript_type = "GetTransactionBlockParams")] - #[derive(Clone)] - pub type WasmGetTransactionBlockParams; - - #[wasm_bindgen(typescript_type = "Promise")] - #[derive(Clone)] - pub type PromisePaginatedObjectsResponse; - - #[wasm_bindgen(typescript_type = "TryGetPastObjectParams")] - #[derive(Clone)] - pub type WasmTryGetPastObjectParams; - - #[wasm_bindgen(typescript_type = "Promise")] - #[derive(Clone)] - pub type PromiseObjectRead; - - #[wasm_bindgen(typescript_type = "ExecutionStatus")] - #[derive(Clone)] - pub type WasmExecutionStatus; - - #[wasm_bindgen(typescript_type = "IotaObjectRef")] - #[derive(Clone)] - pub type WasmObjectRef; - - #[wasm_bindgen(method, getter, js_name = objectId)] - pub fn object_id(this: &WasmObjectRef) -> String; - - #[wasm_bindgen(method, getter, js_name = digest)] - pub fn digest(this: &WasmObjectRef) -> String; - - #[wasm_bindgen(method, getter, js_name = version)] - pub fn version(this: &WasmObjectRef) -> String; - - #[wasm_bindgen(typescript_type = "SharedObjectRef")] - #[derive(Clone)] - pub type WasmSharedObjectRef; - - #[wasm_bindgen(typescript_type = "OwnedObjectRef")] - #[derive(Clone)] - pub type WasmOwnedObjectRef; - - #[wasm_bindgen(typescript_type = "QueryEventsParams")] - #[derive(Clone)] - pub type WasmQueryEventsParams; - - #[wasm_bindgen(typescript_type = "Promise")] - #[derive(Clone)] - pub type PromisePaginatedEvents; - - #[wasm_bindgen(typescript_type = "GetCoinsParams")] - #[derive(Clone)] - pub type WasmGetCoinsParams; - - #[wasm_bindgen(typescript_type = "Promise")] - #[derive(Clone)] - pub type PromisePaginatedCoins; - - #[wasm_bindgen(typescript_type = "Promise")] - #[derive(Clone)] - pub type PromiseIotaTransactionBlockResponseWrapper; - - #[wasm_bindgen(typescript_type = "Signature")] - pub type WasmIotaSignature; - - #[wasm_bindgen(typescript_type = "Parameters")] - #[derive(Clone, Debug)] - pub type WasmWaitForTransactionParams; -} - -impl From for IotaTransactionBlockEffects { - fn from(value: WasmIotaTransactionBlockEffects) -> Self { - serde_wasm_bindgen::from_value(value.into()).expect("have the same repr") - } -} - -impl From<&'_ IotaTransactionBlockEffects> for WasmIotaTransactionBlockEffects { - fn from(value: &'_ IotaTransactionBlockEffects) -> Self { - value - .serialize(&serde_wasm_bindgen::Serializer::json_compatible()) - .expect("same representation") - .unchecked_into() - } -} - -#[derive(Serialize, Deserialize)] -enum IotaSignatureHelper { - Ed25519IotaSignature(String), - Secp256k1IotaSignature(String), - Secp256r1IotaSignature(String), -} - -impl TryFrom for WasmIotaSignature { - type Error = JsValue; - fn try_from(sig: Signature) -> Result { - let base64sig = Base64::encode(&sig); - let json_signature = match sig { - Signature::Ed25519IotaSignature(_) => IotaSignatureHelper::Ed25519IotaSignature(base64sig), - Signature::Secp256r1IotaSignature(_) => IotaSignatureHelper::Secp256r1IotaSignature(base64sig), - Signature::Secp256k1IotaSignature(_) => IotaSignatureHelper::Secp256k1IotaSignature(base64sig), - }; - - json_signature - .serialize(&serde_wasm_bindgen::Serializer::json_compatible()) - .map(JsCast::unchecked_into) - .map_err(|e| e.into()) - } -} - -impl TryFrom for Signature { - type Error = JsValue; - fn try_from(sig: WasmIotaSignature) -> Result { - let sig_helper = serde_wasm_bindgen::from_value(sig.into())?; - let base64sig = match sig_helper { - IotaSignatureHelper::Ed25519IotaSignature(s) => s, - IotaSignatureHelper::Secp256k1IotaSignature(s) => s, - IotaSignatureHelper::Secp256r1IotaSignature(s) => s, - }; - - base64sig - .parse() - .map_err(|e: eyre::Report| JsError::new(&e.to_string()).into()) - } -} - -#[wasm_bindgen(module = "@iota/iota-sdk/transactions")] -extern "C" { - #[derive(Clone)] - #[wasm_bindgen(typescript_type = "Transaction")] - pub type WasmTransaction; - - #[wasm_bindgen(js_name = "from", js_class = "Transaction", static_method_of = WasmTransaction, catch)] - pub fn from_bcs_bytes(bytes: Uint8Array) -> Result; - - #[wasm_bindgen(method, structural, catch)] - pub async fn build( - this: &WasmTransaction, - options: Option, - ) -> Result; - - #[wasm_bindgen(typescript_type = BuildTransactionOptions)] - pub type WasmBuildTransactionOptions; - - #[derive(Clone)] - #[wasm_bindgen(typescript_type = "TransactionData")] - pub type WasmTransactionData; - - #[wasm_bindgen(typescript_type = "Transaction")] - pub type WasmTransactionBuilder; - - #[wasm_bindgen(js_name = "from", js_class = "Transaction", static_method_of = WasmTransactionBuilder, catch)] - pub fn from_bcs_bytes(bytes: Uint8Array) -> Result; - - #[wasm_bindgen(method, structural, catch)] - pub async fn build(this: &WasmTransactionBuilder) -> Result; - - #[derive(Clone)] - #[wasm_bindgen(typescript_type = TransactionDataBuilder)] - pub type WasmTransactionDataBuilder; - - #[wasm_bindgen( - js_name = fromBytes, - js_class = TransactionDataBuilder, - static_method_of = WasmTransactionDataBuilder, - catch - )] - pub fn from_bcs_bytes(bytes: Uint8Array) -> Result; - - #[wasm_bindgen( - js_name = fromKindBytes, - js_class = TransactionDataBuilder, - static_method_of = WasmTransactionDataBuilder, - catch - )] - pub fn from_kind_bcs_bytes(bytes: Uint8Array) -> Result; - - #[wasm_bindgen(method, catch)] - pub fn build(this: &WasmTransactionDataBuilder) -> Result; - // TODO: decide if we need the following functions: "yagni" or not? - - // #[wasm_bindgen(js_name = "setSender", method, catch)] - // pub fn set_sender(this: &WasmTransactionBuilder, address: String) -> Result<(), JsValue>; - - // #[wasm_bindgen(js_name = "setGasOwner", method, catch)] - // pub fn set_gas_owner(this: &WasmTransactionBuilder, address: String) -> Result<(), JsValue>; - - // #[wasm_bindgen(js_name = "setGasPrice", method, catch)] - // pub fn set_gas_price(this: &WasmTransactionBuilder, price: u64) -> Result<(), JsValue>; - - // #[wasm_bindgen(js_name = "setGasPayment", method, catch)] - // pub fn set_gas_payment(this: &WasmTransactionBuilder, payments: Vec) -> Result<(), JsValue>; - - // #[wasm_bindgen(js_name = "setGasBudget", method, catch)] - // pub fn set_gas_budget(this: &WasmTransactionBuilder, budget: u64) -> Result<(), JsValue>; - - // #[wasm_bindgen(js_name = "getData", method, catch)] - // pub fn get_data(this: &WasmTransactionBuilder) -> Result; -} - -impl TryFrom for WasmTransactionData { - type Error = serde_wasm_bindgen::Error; - fn try_from(value: TransactionData) -> Result { - let js_value = serde_wasm_bindgen::to_value(&value)?; - Ok(js_value.unchecked_into()) - } -} - -impl TryFrom for TransactionData { - type Error = serde_wasm_bindgen::Error; - fn try_from(value: WasmTransactionData) -> Result { - serde_wasm_bindgen::from_value(value.into()) - } -} - -#[wasm_bindgen(module = "@iota/iota-sdk/cryptography")] -extern "C" { - #[derive(Clone)] - #[wasm_bindgen(typescript_type = PublicKey)] - pub type WasmPublicKey; - - #[wasm_bindgen(js_name = toIotaPublicKey, method)] - pub fn to_iota_public_key(this: &WasmPublicKey) -> String; - - #[wasm_bindgen(js_name = toRawBytes, method)] - pub fn to_raw_bytes(this: &WasmPublicKey) -> Vec; - - #[wasm_bindgen(js_name = toIotaAddress, method)] - pub fn to_iota_address(this: &WasmPublicKey) -> String; - - #[wasm_bindgen(method)] - pub fn flag(this: &WasmPublicKey) -> u8; -} - -#[wasm_bindgen(module = "@iota/iota-sdk/keypairs/ed25519")] -extern "C" { - #[wasm_bindgen(extends = WasmPublicKey)] - pub type Ed25519PublicKey; - - #[wasm_bindgen(constructor, catch)] - pub fn new_ed25519_pk(bytes: &[u8]) -> Result; -} - -#[wasm_bindgen(module = "@iota/iota-sdk/keypairs/secp256r1")] -extern "C" { - #[wasm_bindgen(extends = WasmPublicKey)] - pub type Secp256r1PublicKey; - - #[wasm_bindgen(constructor, catch)] - pub fn new_secp256r1_pk(bytes: &[u8]) -> Result; -} - -#[wasm_bindgen(module = "@iota/iota-sdk/keypairs/secp256k1")] -extern "C" { - #[wasm_bindgen(extends = WasmPublicKey)] - pub type Secp256k1PublicKey; - - #[wasm_bindgen(constructor, catch)] - pub fn new_secp256k1_pk(bytes: &[u8]) -> Result; -} - -impl TryFrom<&'_ PublicKey> for WasmPublicKey { - type Error = JsValue; - fn try_from(pk: &PublicKey) -> Result { - let pk_bytes = pk.as_ref(); - let wasm_pk: WasmPublicKey = match pk { - PublicKey::Ed25519(_) => Ed25519PublicKey::new_ed25519_pk(pk_bytes)?.into(), - PublicKey::Secp256r1(_) => Secp256r1PublicKey::new_secp256r1_pk(pk_bytes)?.into(), - PublicKey::Secp256k1(_) => Secp256k1PublicKey::new_secp256k1_pk(pk_bytes)?.into(), - _ => return Err(JsError::new("unsupported PublicKey type").into()), - }; - - assert_eq!(pk_bytes, &wasm_pk.to_raw_bytes()); - assert_eq!( - IotaAddress::from(pk), - wasm_pk.to_iota_address().parse().expect("valid iota address") - ); - - Ok(wasm_pk) - } -} - -impl TryFrom for PublicKey { - type Error = JsValue; - fn try_from(wasm_pk: WasmPublicKey) -> Result { - let pk = PublicKey::decode_base64(&wasm_pk.to_iota_public_key()) - .map_err(|_| JsError::new("failed to decode base64 JS PublicKey"))?; - - assert_eq!(&wasm_pk.to_raw_bytes(), pk.as_ref()); - assert_eq!( - IotaAddress::from(&pk), - wasm_pk.to_iota_address().parse().expect("valid iota address") - ); - - Ok(pk) - } -} - -impl TryFrom for ObjectRef { - type Error = anyhow::Error; - fn try_from(value: WasmObjectRef) -> Result { - let digest = serde_json::from_value(serde_json::Value::String(value.digest()))?; - let version = { - let version_number = serde_json::Number::from_str(&value.version())?; - serde_json::from_value(serde_json::Value::Number(version_number))? - }; - let object_id = value.object_id().parse()?; - - Ok((object_id, version, digest)) - } -} - -impl From for WasmObjectRef { - fn from(value: ObjectRef) -> Self { - let json_obj = serde_json::json!({ - "objectId": value.0, - "version": value.1, - "digest": value.2, - }); - - json_obj - .serialize(&serde_wasm_bindgen::Serializer::json_compatible()) - .expect("a JSON object is a JS value") - // safety: `json_obj` was constructed following TS ObjectRef's interface. - .unchecked_into() - } -} - -impl From<(ObjectID, SequenceNumber, bool)> for WasmSharedObjectRef { - fn from(value: (ObjectID, SequenceNumber, bool)) -> Self { - let json_obj = serde_json::json!({ - "objectId": value.0, - "initialSharedVersion": value.1, - "mutable": value.2, - }); - - json_obj - .serialize(&serde_wasm_bindgen::Serializer::json_compatible()) - .expect("a JSON object is a JS value") - // safety: `json_obj` was constructed following TS SharedObjectRef's interface. - .unchecked_into() - } -} - -impl TryFrom for WasmSharedObjectRef { - type Error = TsSdkError; - fn try_from(value: OwnedObjectRef) -> Result { - let Owner::Shared { initial_shared_version } = value.owner else { - return Err(TsSdkError::CommandArgumentError(CommandArgumentError::TypeMismatch)); - }; - let obj_id = value.object_id(); - - Ok((obj_id, initial_shared_version, true).into()) - } -} - -impl WasmSharedObjectRef { - #[allow(dead_code)] - pub(crate) fn immutable(self) -> Self { - const JS_FALSE: JsValue = JsValue::from_bool(false); - - let _ = js_sys::Reflect::set(&self, &JsValue::from_str("mutable"), &JS_FALSE); - self - } -} - -#[wasm_bindgen(module = "@iota/iota-interaction-ts/iota_client_helpers")] -extern "C" { - // Please note: For unclear reasons the `typescript_type` name and the `pub type` name defined - // in wasm_bindgen extern "C" scopes must be equal. Otherwise, the JS constructor will not be - // found in the generated js code. - #[wasm_bindgen(typescript_type = "WasmIotaTransactionBlockResponseWrapper")] - #[derive(Clone)] - pub type WasmIotaTransactionBlockResponseWrapper; - - #[wasm_bindgen(constructor)] - pub fn new(response: WasmIotaTransactionBlockResponse) -> WasmIotaTransactionBlockResponseWrapper; - - #[wasm_bindgen(method, js_name = get_effects)] - pub fn effects(this: &WasmIotaTransactionBlockResponseWrapper) -> Option; - - #[wasm_bindgen(method)] - pub fn to_string(this: &WasmIotaTransactionBlockResponseWrapper) -> String; - - #[wasm_bindgen(method, js_name = "get_digest")] - fn digest_inner(this: &WasmIotaTransactionBlockResponseWrapper) -> String; - - #[wasm_bindgen(method, js_name = "get_response")] - pub fn response(this: &WasmIotaTransactionBlockResponseWrapper) -> WasmIotaTransactionBlockResponse; - - #[wasm_bindgen(js_name = executeTransaction)] - fn execute_transaction_inner( - iota_client: &WasmIotaClient, // --> TypeScript: IotaClient - sender_address: String, // --> TypeScript: string - tx_bcs: Vec, // --> TypeScript: Uint8Array, - signer: WasmStorageSigner, // --> TypeScript: Signer (iota_client_helpers module) - gas_budget: Option, // --> TypeScript: optional bigint - ) -> PromiseIotaTransactionBlockResponseWrapper; - - #[wasm_bindgen(js_name = "sleep")] - fn sleep_inner(ms: i32) -> Promise; -} - -/// Helper function to pause execution. -pub async fn sleep(duration_ms: i32) -> Result<(), JsValue> { - let promise = sleep_inner(duration_ms); - let js_fut = JsFuture::from(promise); - js_fut.await?; - Ok(()) -} - -impl WasmIotaTransactionBlockResponseWrapper { - pub fn digest(&self) -> Result { - TransactionDigest::from_str(&self.digest_inner()) - .map_err(|err| TsSdkError::WasmError("Failed to parse transaction block digest".to_string(), err.to_string())) - } -} - -pub async fn execute_transaction( - iota_client: &WasmIotaClient, // --> Binding: WasmIotaClient - sender_address: IotaAddress, // --> Binding: String - tx_bcs: ProgrammableTransactionBcs, // --> Binding: Vec - signer: WasmStorageSigner, // --> Binding: WasmStorageSigner - gas_budget: Option, // --> Binding: Option, -) -> Result { - let promise: Promise = Promise::resolve(&execute_transaction_inner( - iota_client, - sender_address.to_string(), - tx_bcs, - signer, - gas_budget, - )); - let result: JsValue = JsFuture::from(promise).await.map_err(|e| { - let message = "Error executing JsFuture::from(promise) for `execute_transaction`"; - let details = format!("{e:?}"); - console_log!("{message}; {details}"); - TsSdkError::WasmError(message.to_string(), details.to_string()) - })?; - - Ok(WasmIotaTransactionBlockResponseWrapper::new(result.into())) -} - -#[derive(Deserialize)] -#[serde(try_from = "Vec")] -pub struct ProgrammableTransaction(#[allow(dead_code)] pub(crate) WasmTransactionBuilder); -impl TryFrom> for ProgrammableTransaction { - type Error = TsSdkError; - fn try_from(value: Vec) -> Result { - let uint8array: Uint8Array = value.as_slice().into(); - WasmTransactionBuilder::from_bcs_bytes(uint8array) - .map(Self) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/common/macros.rs b/bindings/wasm/iota_interaction_ts/src/common/macros.rs deleted file mode 100644 index 259fc54171..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/common/macros.rs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2020-2021 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use wasm_bindgen::prelude::wasm_bindgen; - -#[macro_export] -macro_rules! log { - ($($tt:tt)*) => { - web_sys::console::log_1(&format!($($tt)*).into()); - } -} - -/// Log to console utility without the need for web_sys dependency -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(js_namespace = console, js_name = log)] - pub fn console_log(s: &str); -} - -/// Logging macro without the need for web_sys dependency -#[macro_export] -macro_rules! console_log { - ($($tt:tt)*) => { - crate::common::macros::console_log((format!($($tt)*)).as_str()) - } -} - -#[macro_export] -macro_rules! impl_wasm_clone { - ($wasm_class:ident, $js_class:ident) => { - #[wasm_bindgen(js_class = $js_class)] - impl $wasm_class { - /// Deep clones the object. - #[wasm_bindgen(js_name = clone)] - pub fn deep_clone(&self) -> $wasm_class { - return $wasm_class(self.0.clone()); - } - } - }; -} - -#[macro_export] -macro_rules! impl_wasm_json { - ($wasm_class:ident, $js_class:ident) => { - #[wasm_bindgen(js_class = $js_class)] - impl $wasm_class { - /// Serializes this to a JSON object. - #[wasm_bindgen(js_name = toJSON)] - pub fn to_json(&self) -> $crate::error::Result { - use $crate::error::WasmResult; - JsValue::from_serde(&self.0).wasm_result() - } - - /// Deserializes an instance from a JSON object. - #[wasm_bindgen(js_name = fromJSON)] - pub fn from_json(json: &JsValue) -> $crate::error::Result<$wasm_class> { - use $crate::error::WasmResult; - json.into_serde().map(Self).wasm_result() - } - } - }; -} diff --git a/bindings/wasm/iota_interaction_ts/src/common/mod.rs b/bindings/wasm/iota_interaction_ts/src/common/mod.rs deleted file mode 100644 index f764977e2d..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/common/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[macro_use] -pub mod macros; - -pub mod types; -pub mod utils; - -pub use types::*; -pub use utils::*; diff --git a/bindings/wasm/iota_interaction_ts/src/common/types.rs b/bindings/wasm/iota_interaction_ts/src/common/types.rs deleted file mode 100644 index d95f6dcfa1..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/common/types.rs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2020-2023 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_core::common::Object; -use identity_iota_interaction::types::transaction::TransactionKind; -use identity_iota_interaction::ProgrammableTransactionBcs; -use js_sys::Promise; -use js_sys::Uint8Array; -use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; -use wasm_bindgen_futures::JsFuture; - -use crate::error::TsSdkError; -use crate::error::TsSdkResult; -use crate::error::WasmError; -use crate::error::WasmResult; - -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseVoid; - - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseBigint; - - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseBool; - - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseString; - - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseOptionString; - - #[wasm_bindgen(typescript_type = "Promise")] - pub type PromiseUint8Array; - - #[wasm_bindgen(typescript_type = "Array")] - pub type ArrayString; - - #[wasm_bindgen(typescript_type = "Map")] - pub type MapStringAny; - - #[wasm_bindgen(typescript_type = "Record")] - pub type RecordStringAny; - - #[wasm_bindgen(typescript_type = "number | number[]")] - pub type UOneOrManyNumber; - - #[wasm_bindgen(typescript_type = "string | string[] | null")] - pub type OptionOneOrManyString; - - #[wasm_bindgen(typescript_type = "VerificationMethod[]")] - pub type ArrayVerificationMethod; - - #[wasm_bindgen(typescript_type = "Array")] - pub type ArrayCoreMethodRef; - - #[wasm_bindgen(typescript_type = "DIDUrl | string")] - pub type UDIDUrlQuery; - - #[wasm_bindgen(typescript_type = "Service[]")] - pub type ArrayService; -} - -impl TryFrom for MapStringAny { - type Error = JsValue; - - fn try_from(properties: Object) -> Result { - MapStringAny::try_from(&properties) - } -} - -impl TryFrom<&Object> for MapStringAny { - type Error = JsValue; - - fn try_from(properties: &Object) -> Result { - let map: js_sys::Map = js_sys::Map::new(); - for (key, value) in properties.iter() { - map.set( - &JsValue::from_str(key.as_str()), - #[allow(deprecated)] // will be refactored - &JsValue::from_serde(&value).wasm_result()?, - ); - } - Ok(map.unchecked_into::()) - } -} - -impl Default for MapStringAny { - fn default() -> Self { - js_sys::Map::new().unchecked_into() - } -} - -impl PromiseUint8Array { - /// Helper function to convert Uint8 arrays from contract calls to the internal `ProgrammableTransactionBcs` type. - pub async fn to_programmable_transaction_bcs(&self) -> TsSdkResult { - let promise: Promise = Promise::resolve(self); - let tx_kind_bcs = JsFuture::from(promise) - .await - .map(|v| Uint8Array::from(v).to_vec()) - .map_err(WasmError::from)?; - - let tx_kind = bcs::from_bytes(&tx_kind_bcs).map_err(|e| { - TsSdkError::TransactionSerializationError(format!("failed to deserialize BCS TransactionKind: {e}")) - })?; - - #[allow(irrefutable_let_patterns)] - let TransactionKind::ProgrammableTransaction(pt) = tx_kind - else { - return Err(TsSdkError::WasmError( - "TransactionKind variant".to_owned(), - "only programmable transactions can be used within this library".to_owned(), - )); - }; - - bcs::to_bytes(&pt).map_err(|e| { - TsSdkError::TransactionSerializationError(format!("failed to BCS serialize programmable transaction: {e}")) - }) - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/common/utils.rs b/bindings/wasm/iota_interaction_ts/src/common/utils.rs deleted file mode 100644 index 3ed8447a1b..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/common/utils.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2020-2023 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::de::DeserializeOwned; -use wasm_bindgen::prelude::*; - -use crate::error::WasmError; - -pub fn into_sdk_type<'a, T: DeserializeOwned, W: Into>( - wasm_type_instance: W, -) -> core::result::Result> { - let js_value: JsValue = wasm_type_instance.into(); - match serde_wasm_bindgen::from_value::(js_value.clone()) { - Ok(ret_val) => Ok(ret_val), - Err(e) => { - // TODO: Replace all console_log! usages by proper Error management and Result types. - // Use console_log! only for debug purposes - console_log!( - "[iota_interaction_ts::common::utils - fn into_sdk_type]\n js_value: {:?}\n Error: {:?}", - js_value, - e - ); - Err(e.into()) - } - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/error.rs b/bindings/wasm/iota_interaction_ts/src/error.rs deleted file mode 100644 index e29a098370..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/error.rs +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::result::Result as StdResult; - -use serde::de::DeserializeOwned; -use std::borrow::Cow; -use std::fmt::Debug; -use std::fmt::Display; -use wasm_bindgen::JsValue; - -use crate::common::into_sdk_type; -use identity_iota_interaction::types::execution_status::CommandArgumentError; -use identity_iota_interaction::types::execution_status::ExecutionFailureStatus; -use identity_iota_interaction::types::execution_status::PackageUpgradeError; -use identity_iota_interaction::types::execution_status::TypeArgumentError; -use thiserror::Error as ThisError; - -/// Convenience wrapper for `Result`. -/// -/// All exported errors must be converted to [`JsValue`] when using wasm_bindgen. -/// See: https://rustwasm.github.io/docs/wasm-bindgen/reference/types/result.html -pub type Result = core::result::Result; - -/// Convert an error into an idiomatic [js_sys::Error]. -pub fn wasm_error<'a, E>(error: E) -> JsValue -where - E: Into>, -{ - let wasm_err: WasmError<'_> = error.into(); - JsValue::from(wasm_err) -} - -/// Convenience trait to simplify `result.map_err(wasm_error)` to `result.wasm_result()` -pub trait WasmResult { - fn wasm_result(self) -> Result; -} - -impl<'a, T, E> WasmResult for core::result::Result -where - E: Into>, -{ - fn wasm_result(self) -> Result { - self.map_err(wasm_error) - } -} - -/// Convenience struct to convert internal errors to [js_sys::Error]. Uses [std::borrow::Cow] -/// internally to avoid unnecessary clones. -/// -/// This is a workaround for orphan rules so we can implement [core::convert::From] on errors from -/// dependencies. -#[derive(Debug, Clone)] -pub struct WasmError<'a> { - pub name: Cow<'a, str>, - pub message: Cow<'a, str>, -} - -impl<'a> WasmError<'a> { - pub fn new(name: Cow<'a, str>, message: Cow<'a, str>) -> Self { - Self { name, message } - } -} - -/// Convert [WasmError] into [js_sys::Error] for idiomatic error handling. -impl From> for js_sys::Error { - fn from(error: WasmError<'_>) -> Self { - let js_error = js_sys::Error::new(&error.message); - js_error.set_name(&error.name); - js_error - } -} - -/// Convert [WasmError] into [wasm_bindgen::JsValue]. -impl From> for JsValue { - fn from(error: WasmError<'_>) -> Self { - JsValue::from(js_sys::Error::from(error)) - } -} - -/// Implement WasmError for each type individually rather than a trait due to Rust's orphan rules. -/// Each type must implement `Into<&'static str> + Display`. The `Into<&'static str>` trait can be -/// derived using `strum::IntoStaticStr`. -#[macro_export] -macro_rules! impl_wasm_error_from { - ( $($t:ty),* ) => { - $(impl From<$t> for WasmError<'_> { - fn from(error: $t) -> Self { - Self { - message: Cow::Owned(ErrorMessage(&error).to_string()), - name: Cow::Borrowed(error.into()), - } - } - })* - } -} - -// Similar to `impl_wasm_error_from`, but uses the types name instead of requiring/calling Into &'static str -#[macro_export] -macro_rules! impl_wasm_error_from_with_struct_name { - ( $($t:ty),* ) => { - $(impl From<$t> for WasmError<'_> { - fn from(error: $t) -> Self { - Self { - message: Cow::Owned(error.to_string()), - name: Cow::Borrowed(stringify!($t)), - } - } - })* - } -} - -impl From for WasmError<'_> { - fn from(error: JsValue) -> Self { - let js_err = js_sys::Error::from(error); - let name: String = js_err.name().into(); - let message: String = js_err.message().into(); - WasmError::new(name.into(), message.into()) - } -} - -// identity_iota::iota now has some errors where the error message does not include the source error's error message. -// This is in compliance with the Rust error handling project group's recommendation: -// * An error type with a source error should either return that error via source or include that source's error message -// in its own Display output, but never both. * -// See https://blog.rust-lang.org/inside-rust/2021/07/01/What-the-error-handling-project-group-is-working-towards.html#guidelines-for-implementing-displayfmt-and-errorsource. -// -// However in WasmError we want the display message of the entire error chain. We introduce a workaround here that let's -// us display the entire display chain for new variants that don't include the error message of the source error in its -// own display. - -// the following function is inspired by https://www.lpalmieri.com/posts/error-handling-rust/#error-source -fn error_chain_fmt(e: &impl std::error::Error, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{e}. ")?; - let mut current = e.source(); - while let Some(cause) = current { - write!(f, "Caused by: {cause}. ")?; - current = cause.source(); - } - Ok(()) -} - -struct ErrorMessage<'a, E: std::error::Error>(&'a E); - -impl<'a, E: std::error::Error> Display for ErrorMessage<'a, E> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - error_chain_fmt(self.0, f) - } -} - -impl From for WasmError<'_> { - fn from(error: serde_json::Error) -> Self { - Self { - name: Cow::Borrowed("serde_json::Error"), // the exact error code is embedded in the message - message: Cow::Owned(error.to_string()), - } - } -} - -impl From for WasmError<'_> { - fn from(error: serde_wasm_bindgen::Error) -> Self { - Self { - name: Cow::Borrowed("serde_wasm_bindgen::Error"), - message: Cow::Owned(ErrorMessage(&error).to_string()), - } - } -} - -impl From for WasmError<'_> { - fn from(error: anyhow::Error) -> Self { - Self { - name: Cow::Borrowed("anyhow::Error"), - message: Cow::Owned(error.to_string()), - } - } -} - -/// Consumes the struct and returns a Result<_, String>, leaving an `Ok` value untouched. -pub fn stringify_js_error(result: Result) -> StdResult { - result.map_err(|js_value| { - let error_string: String = match wasm_bindgen::JsCast::dyn_into::(js_value) { - Ok(js_err) => ToString::to_string(&js_err.to_string()), - Err(js_val) => { - // Fall back to debug formatting if this is not a proper JS Error instance. - format!("{js_val:?}") - } - }; - error_string - }) -} - -#[derive(ThisError, Debug)] -pub enum TsSdkError { - #[error("[TsSdkError] PackageUpgradeError: {0}")] - PackageUpgradeError(#[from] PackageUpgradeError), - #[error("[TsSdkError] CommandArgumentError: {0}")] - CommandArgumentError(#[from] CommandArgumentError), - #[error("[TsSdkError] ExecutionFailureStatus: {0}")] - ExecutionFailureStatus(#[from] ExecutionFailureStatus), - #[error("[TsSdkError] TypeArgumentError: {0}")] - TypeArgumentError(#[from] TypeArgumentError), - #[error("[TsSdkError] WasmError:{{\n name: {0},\n message: {1}\n}}")] - WasmError(String, String), - #[error("[TsSdkError] JsSysError: {0}")] - JsSysError(String), - #[error("[TsSdkError] TransactionSerializationError: {0}")] - TransactionSerializationError(String), -} - -pub type TsSdkResult = core::result::Result; - -impl From> for TsSdkError { - fn from(err: WasmError<'_>) -> Self { - TsSdkError::WasmError(err.name.to_string(), err.message.to_string()) - } -} - -pub fn into_ts_sdk_result(result: Result) -> TsSdkResult { - let result_str = stringify_js_error(result); - let js_value = result_str.map_err(|e| TsSdkError::JsSysError(e))?; - let ret_val: T = into_sdk_type(js_value)?; - Ok(ret_val) -} diff --git a/bindings/wasm/iota_interaction_ts/src/identity_move_calls.rs b/bindings/wasm/iota_interaction_ts/src/identity_move_calls.rs deleted file mode 100644 index 742cfb065e..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/identity_move_calls.rs +++ /dev/null @@ -1,803 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use async_trait::async_trait; -use identity_iota_interaction::ControllerTokenRef; -use js_sys::Uint8Array; -use std::cell::Cell; -use std::collections::HashSet; -use wasm_bindgen::prelude::wasm_bindgen; -use wasm_bindgen::JsCast; -use wasm_bindgen::JsValue; - -use crate::bindings::WasmIotaObjectData; -use crate::bindings::WasmObjectRef; -use crate::bindings::WasmSharedObjectRef; -use crate::bindings::WasmTransactionArgument; -use crate::bindings::WasmTransactionBuilder; -use crate::common::PromiseUint8Array; -use crate::error::TsSdkError; -use crate::error::WasmError; -use crate::transaction_builder::TransactionBuilderTsSdk; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::BorrowIntentFnInternalT; -use identity_iota_interaction::ControllerIntentFnInternalT; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::ProgrammableTransactionBcs; - -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "[string, number, bool]")] - pub(crate) type WasmControllerData; - - #[wasm_bindgen(typescript_type = "[string, string]")] - pub(crate) type WasmTransferCouple; - - #[wasm_bindgen(typescript_type = "[ObjectRef, string]")] - pub(crate) type WasmObjectRefAndType; - - #[wasm_bindgen(typescript_type = "Map")] - pub(crate) type WasmTxArgumentMap; -} - -impl From<(IotaAddress, u64, bool)> for WasmControllerData { - fn from((address, vp, can_delegate): (IotaAddress, u64, bool)) -> Self { - let address = JsValue::from_str(&address.to_string()); - let vp = JsValue::bigint_from_str(&vp.to_string()); - let can_delegate_flag = JsValue::from_bool(can_delegate); - - let arr = js_sys::Array::new(); - arr.push(&address); - arr.push(&vp); - arr.push(&can_delegate_flag); - - arr.unchecked_into() - } -} - -#[wasm_bindgen(module = "@iota/iota-interaction-ts/move_calls/identity")] -extern "C" { - #[wasm_bindgen(typescript_type = "ControllerTokenRef")] - type WasmControllerTokenRef; - - #[wasm_bindgen(js_name = "create", catch)] - fn identity_new(did: Option<&[u8]>, package: &str) -> Result; - - #[wasm_bindgen(js_name = "newWithControllers", catch)] - fn identity_new_with_controllers( - did: Option<&[u8]>, - controllers: Vec, - threshold: u64, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "approve", catch)] - async fn approve_proposal( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - proposal_type: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "proposeDeactivation", catch)] - fn propose_deactivation( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "executeDeactivation", catch)] - async fn execute_deactivation( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "proposeUpgrade", catch)] - async fn propose_upgrade( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "executeUpgrade", catch)] - async fn execute_upgrade( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "proposeSend", catch)] - async fn propose_send( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - assets: Vec, - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "executeSend", catch)] - async fn execute_send( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - assets: Vec, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "proposeUpdate", catch)] - fn propose_update( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - did_doc: Option<&[u8]>, - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "executeUpdate", catch)] - fn execute_update( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "proposeBorrow", catch)] - async fn propose_borrow( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - objects: Vec, - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "executeBorrow", catch)] - async fn execute_borrow( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - objects: Vec, - intent_fn: &dyn Fn(WasmTransactionBuilder, WasmTxArgumentMap), - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "createAndExecuteBorrow", catch)] - async fn create_and_execute_borrow( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - objects: Vec, - intent_fn: &dyn Fn(WasmTransactionBuilder, WasmTxArgumentMap), - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "proposeConfigChange", catch)] - async fn propose_config_change( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - controllers_to_add: Vec, - controllers_to_remove: Vec, - controllers_to_update: Vec, - package: &str, - expiration: Option, - threshold: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "executeConfigChange", catch)] - async fn execute_config_change( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "proposeControllerExecution", catch)] - async fn propose_controller_execution( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - controller_cap_id: &str, - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = "executeControllerExecution", catch)] - async fn execute_controller_execution( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - proposal: &str, - controller_cap_ref: WasmObjectRef, - intent_fn: &dyn Fn(WasmTransactionBuilder, WasmTransactionArgument), - package: &str, - ) -> Result; - - #[wasm_bindgen(js_name = "createAndExecuteControllerExecution", catch)] - async fn create_and_execute_controller_execution( - identity: WasmSharedObjectRef, - capability: WasmControllerTokenRef, - controller_cap_ref: WasmObjectRef, - intent_fn: &dyn Fn(WasmTransactionBuilder, WasmTransactionArgument), - package: &str, - expiration: Option, - ) -> Result; - - #[wasm_bindgen(js_name = delegateControllerCap, catch)] - async fn delegate_controller_cap( - controller_cap: WasmObjectRef, - recipient: &str, - permissions: u32, - package_id: &str, - ) -> Result; - - #[wasm_bindgen(js_name = revokeDelegationToken, catch)] - async fn revoke_delegation_token( - identity: WasmSharedObjectRef, - controller_cap: WasmObjectRef, - delegation_token_id: &str, - package_id: &str, - ) -> Result; - - #[wasm_bindgen(js_name = unrevokeDelegationToken, catch)] - async fn unrevoke_delegation_token( - identity: WasmSharedObjectRef, - controller_cap: WasmObjectRef, - delegation_token_id: &str, - package_id: &str, - ) -> Result; - - #[wasm_bindgen(js_name = destroyDelegationToken, catch)] - async fn destroy_delegation_token( - identity: WasmSharedObjectRef, - delegation_token: WasmObjectRef, - package_id: &str, - ) -> Result; -} - -impl From for WasmControllerTokenRef { - fn from(value: ControllerTokenRef) -> Self { - use js_sys::Object; - use js_sys::Reflect; - - let wasm_object_ref = WasmObjectRef::from(value.object_ref()); - let js_object = Object::new(); - let _ = Reflect::set(&js_object, &JsValue::from_str("objectRef"), &wasm_object_ref); - - let wasm_type = { - let type_name = match value { - ControllerTokenRef::Controller(_) => "ControllerCap", - ControllerTokenRef::Delegate(_) => "DelegationToken", - }; - - JsValue::from_str(type_name) - }; - - let _ = Reflect::set(&js_object, &JsValue::from_str("type"), &wasm_type); - - js_object.unchecked_into() - } -} - -pub struct IdentityMoveCallsTsSdk {} - -#[async_trait(?Send)] -impl IdentityMoveCalls for IdentityMoveCallsTsSdk { - type Error = TsSdkError; - type NativeTxBuilder = WasmTransactionBuilder; - - fn propose_borrow( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - objects: Vec, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = capability.into(); - let package_id = package_id.to_string(); - let objects = objects.into_iter().map(|obj| obj.to_string()).collect(); - - futures::executor::block_on(propose_borrow( - identity, - controller_cap, - objects, - &package_id, - expiration, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn execute_borrow>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - objects: Vec, - intent_fn: F, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let capability = capability.into(); - let proposal = proposal_id.to_string(); - let package = package.to_string(); - let objects = objects - .into_iter() - .map(|obj| serde_wasm_bindgen::to_value(&obj).map(WasmIotaObjectData::from)) - .collect::, _>>() - .map_err(WasmError::from)?; - - // Use cell to move `intent_fn` inside `closure` without actually moving it. - // This ensures that `closure` is an `impl Fn(..)` instead of `impl FnOnce(..)` like `intent_fn`. - let wrapped_intent_fn = Cell::new(Some(intent_fn)); - let closure = |tx_builder: WasmTransactionBuilder, args: WasmTxArgumentMap| { - let mut builder = TransactionBuilderTsSdk::new(tx_builder); - let args = serde_wasm_bindgen::from_value(args.into()).expect("failed to convert JS argument map"); - wrapped_intent_fn.take().unwrap()(&mut builder, &args); - }; - - futures::executor::block_on(execute_borrow( - identity, capability, &proposal, objects, &closure, &package, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn create_and_execute_borrow>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - objects: Vec, - intent_fn: F, - expiration: Option, - package_id: ObjectID, - ) -> anyhow::Result { - let identity = identity.try_into()?; - let capability = capability.into(); - let package = package_id.to_string(); - let objects = objects - .into_iter() - .map(|obj| serde_wasm_bindgen::to_value(&obj).map(WasmIotaObjectData::from)) - .collect::, _>>() - .map_err(WasmError::from)?; - - // Use cell to move `intent_fn` inside `closure` without actually moving it. - // This ensures that `closure` is an `impl Fn(..)` instead of `impl FnOnce(..)` like `intent_fn`. - let wrapped_intent_fn = Cell::new(Some(intent_fn)); - let closure = |tx_builder: WasmTransactionBuilder, args: WasmTxArgumentMap| { - let mut builder = TransactionBuilderTsSdk::new(tx_builder); - let args = serde_wasm_bindgen::from_value(args.into()).expect("failed to convert JS argument map"); - wrapped_intent_fn.take().unwrap()(&mut builder, &args); - }; - - futures::executor::block_on(create_and_execute_borrow( - identity, capability, objects, &closure, &package, expiration, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn propose_config_change( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - expiration: Option, - threshold: Option, - controllers_to_add: I1, - controllers_to_remove: HashSet, - controllers_to_update: I2, - package: ObjectID, - ) -> Result - where - I1: IntoIterator, - I2: IntoIterator, - { - let identity = identity.try_into()?; - let capability = controller_cap.into(); - let package = package.to_string(); - - let controllers_to_add = controllers_to_add - .into_iter() - .map(|controller| serde_wasm_bindgen::to_value(&controller).map(WasmControllerData::from)) - .collect::, _>>() - .map_err(WasmError::from)?; - let controllers_to_remove = controllers_to_remove - .into_iter() - .map(|controller| controller.to_string()) - .collect(); - let controllers_to_update = controllers_to_update - .into_iter() - .map(|controller| serde_wasm_bindgen::to_value(&controller).map(WasmControllerData::from)) - .collect::, _>>() - .map_err(WasmError::from)?; - - futures::executor::block_on(propose_config_change( - identity, - capability, - controllers_to_add, - controllers_to_remove, - controllers_to_update, - &package, - expiration, - threshold, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn execute_config_change( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - proposal_id: ObjectID, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let capability = controller_cap.into(); - let proposal = proposal_id.to_string(); - let package = package.to_string(); - - futures::executor::block_on(execute_config_change(identity, capability, &proposal, &package)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn propose_controller_execution( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - controller_cap_id: ObjectID, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = capability.into(); - let package_id = package_id.to_string(); - let borrowed_cap = controller_cap_id.to_string(); - - futures::executor::block_on(propose_controller_execution( - identity, - controller_cap, - &borrowed_cap, - &package_id, - expiration, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn execute_controller_execution>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let capability = capability.into(); - let proposal = proposal_id.to_string(); - let package = package.to_string(); - let borrowing_cap = borrowing_controller_cap_ref.into(); - - // Use cell to move `intent_fn` inside `closure` without actually moving it. - // This ensures that `closure` is an `impl Fn(..)` instead of `impl FnOnce(..)` like `intent_fn`. - let wrapped_intent_fn = Cell::new(Some(intent_fn)); - let closure = |tx_builder: WasmTransactionBuilder, args: WasmTransactionArgument| { - let mut builder = TransactionBuilderTsSdk::new(tx_builder); - let args = serde_wasm_bindgen::from_value(args.into()).expect("failed to convert JS argument map"); - wrapped_intent_fn.take().unwrap()(&mut builder, &args); - }; - - futures::executor::block_on(execute_controller_execution( - identity, - capability, - &proposal, - borrowing_cap, - &closure, - &package, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn create_and_execute_controller_execution( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - expiration: Option, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package_id: ObjectID, - ) -> Result - where - F: ControllerIntentFnInternalT, - { - let identity = identity.try_into()?; - let capability = capability.into(); - let package = package_id.to_string(); - let borrowing_cap = borrowing_controller_cap_ref.into(); - - // Use cell to move `intent_fn` inside `closure` without actually moving it. - // This ensures that `closure` is an `impl Fn(..)` instead of `impl FnOnce(..)` like `intent_fn`. - let wrapped_intent_fn = Cell::new(Some(intent_fn)); - let closure = |tx_builder: WasmTransactionBuilder, args: WasmTransactionArgument| { - let mut builder = TransactionBuilderTsSdk::new(tx_builder); - let args = serde_wasm_bindgen::from_value(args.into()).expect("failed to convert JS argument map"); - wrapped_intent_fn.take().unwrap()(&mut builder, &args); - }; - - futures::executor::block_on(create_and_execute_controller_execution( - identity, - capability, - borrowing_cap, - &closure, - &package, - expiration, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - async fn new_identity( - did_doc: Option<&[u8]>, - package_id: ObjectID, - ) -> Result { - let package = package_id.to_string(); - - identity_new(did_doc, &package) - .map_err(WasmError::from)? - .to_programmable_transaction_bcs() - .await - } - - async fn new_with_controllers( - did_doc: Option<&[u8]>, - controllers: C, - threshold: u64, - package_id: ObjectID, - ) -> Result - where - C: IntoIterator, - { - let package = package_id.to_string(); - let controllers = controllers.into_iter().map(Into::into).collect(); - - identity_new_with_controllers(did_doc, controllers, threshold, &package) - .map_err(WasmError::from)? - .to_programmable_transaction_bcs() - .await - } - - fn approve_proposal( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - proposal_id: ObjectID, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = controller_cap.into(); - let proposal_id = proposal_id.to_string(); - let package_id = package.to_string(); - - futures::executor::block_on(approve_proposal( - identity, - controller_cap, - &proposal_id, - &T::move_type(package).to_canonical_string(true), - &package_id, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn propose_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = capability.into(); - let package_id = package_id.to_string(); - let transfer_map = transfer_map - .into_iter() - .map(|tx| serde_wasm_bindgen::to_value(&tx).map(JsValue::into)) - .collect::, _>>() - .map_err(|e| WasmError::from(e))?; - - futures::executor::block_on(propose_send( - identity, - controller_cap, - transfer_map, - &package_id, - expiration, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn create_and_execute_send( - _identity: OwnedObjectRef, - _capability: ControllerTokenRef, - _transfer_map: Vec<(ObjectID, IotaAddress)>, - _expiration: Option, - _objects: Vec<(ObjectRef, TypeTag)>, - _package: ObjectID, - ) -> anyhow::Result { - todo!() - } - - fn execute_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = capability.into(); - let proposal = proposal_id.to_string(); - let package_id = package.to_string(); - let objects = objects - .into_iter() - .map(|tx| serde_wasm_bindgen::to_value(&tx).map(JsValue::into)) - .collect::, _>>() - .map_err(|e| WasmError::from(e))?; - - futures::executor::block_on(execute_send(identity, controller_cap, &proposal, objects, &package_id)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - async fn propose_update( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - did_doc: Option<&[u8]>, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = capability.into(); - let package_id = package_id.to_string(); - - propose_update(identity, controller_cap, did_doc, &package_id, expiration) - .map_err(WasmError::from)? - .to_programmable_transaction_bcs() - .await - } - - async fn execute_update( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - package_id: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = capability.into(); - let proposal = proposal_id.to_string(); - let package_id = package_id.to_string(); - - execute_update(identity, controller_cap, &proposal, &package_id) - .map_err(WasmError::from)? - .to_programmable_transaction_bcs() - .await - } - - fn propose_upgrade( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let capability = capability.into(); - let package = package_id.to_string(); - - futures::executor::block_on(propose_upgrade(identity, capability, &package, expiration)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - fn execute_upgrade( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - package_id: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let capability = capability.into(); - let proposal = proposal_id.to_string(); - let package = package_id.to_string(); - - futures::executor::block_on(execute_upgrade(identity, capability, &proposal, &package)) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - async fn delegate_controller_cap( - controller_cap: ObjectRef, - recipient: IotaAddress, - permissions: u32, - package: ObjectID, - ) -> Result { - let controller_cap = controller_cap.into(); - let recipient = recipient.to_string(); - let package = package.to_string(); - - delegate_controller_cap(controller_cap, &recipient, permissions, &package) - .await - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - async fn revoke_delegation_token( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - delegation_token_id: ObjectID, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = controller_cap.into(); - let token_id = delegation_token_id.to_string(); - let package = package.to_string(); - - revoke_delegation_token(identity, controller_cap, &token_id, &package) - .await - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - async fn unrevoke_delegation_token( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - delegation_token_id: ObjectID, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let controller_cap = controller_cap.into(); - let token_id = delegation_token_id.to_string(); - let package = package.to_string(); - - unrevoke_delegation_token(identity, controller_cap, &token_id, &package) - .await - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } - - async fn destroy_delegation_token( - identity: OwnedObjectRef, - delegation_token: ObjectRef, - package: ObjectID, - ) -> Result { - let identity = identity.try_into()?; - let token = delegation_token.into(); - let package = package.to_string(); - - destroy_delegation_token(identity, token, &package) - .await - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(TsSdkError::from) - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/iota_client_ts_sdk.rs b/bindings/wasm/iota_interaction_ts/src/iota_client_ts_sdk.rs deleted file mode 100644 index 3e44777b1c..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/iota_client_ts_sdk.rs +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::boxed::Box; -use std::option::Option; -use std::result::Result; - -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::types::crypto::Signature; -use identity_iota_interaction::types::digests::TransactionDigest; -use identity_iota_interaction::types::dynamic_field::DynamicFieldName; -use identity_iota_interaction::types::transaction::TransactionData; -use secret_storage::Signer; - -use identity_iota_interaction::error::Error as IotaRpcError; -use identity_iota_interaction::error::IotaRpcResult; -use identity_iota_interaction::rpc_types::CoinPage; -use identity_iota_interaction::rpc_types::EventFilter; -use identity_iota_interaction::rpc_types::EventPage; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaObjectResponse; -use identity_iota_interaction::rpc_types::IotaObjectResponseQuery; -use identity_iota_interaction::rpc_types::IotaPastObjectResponse; -use identity_iota_interaction::rpc_types::IotaTransactionBlockResponseOptions; -use identity_iota_interaction::rpc_types::ObjectsPage; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::event::EventID; -use identity_iota_interaction::types::quorum_driver_types::ExecuteTransactionRequestType; -use identity_iota_interaction::types::transaction::ProgrammableTransaction as ProgrammableTransactionSdk; -use identity_iota_interaction::types::transaction::TransactionDataAPI as _; -use identity_iota_interaction::CoinReadTrait; -use identity_iota_interaction::EventTrait; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::IotaTransactionBlockResponseT; -use identity_iota_interaction::QuorumDriverTrait; -use identity_iota_interaction::ReadTrait; - -use crate::bindings::ManagedWasmIotaClient; -use crate::bindings::WasmIotaClient; -use crate::bindings::WasmIotaTransactionBlockResponseWrapper; -use crate::error::TsSdkError; - -#[allow(dead_code)] -pub trait IotaTransactionBlockResponseAdaptedT: - IotaTransactionBlockResponseT -{ -} -impl IotaTransactionBlockResponseAdaptedT for T where - T: IotaTransactionBlockResponseT -{ -} -#[allow(dead_code)] -pub type IotaTransactionBlockResponseAdaptedTraitObj = - Box>; - -#[allow(dead_code)] -pub trait QuorumDriverApiAdaptedT: - QuorumDriverTrait -{ -} -impl QuorumDriverApiAdaptedT for T where - T: QuorumDriverTrait -{ -} -#[allow(dead_code)] -pub type QuorumDriverApiAdaptedTraitObj = - Box>; - -#[allow(dead_code)] -pub trait ReadApiAdaptedT: - ReadTrait -{ -} -impl ReadApiAdaptedT for T where - T: ReadTrait -{ -} -#[allow(dead_code)] -pub type ReadApiAdaptedTraitObj = - Box>; - -#[allow(dead_code)] -pub trait CoinReadApiAdaptedT: CoinReadTrait {} -impl CoinReadApiAdaptedT for T where T: CoinReadTrait {} -#[allow(dead_code)] -pub type CoinReadApiAdaptedTraitObj = Box>; - -#[allow(dead_code)] -pub trait EventApiAdaptedT: EventTrait {} -impl EventApiAdaptedT for T where T: EventTrait {} -#[allow(dead_code)] -pub type EventApiAdaptedTraitObj = Box>; - -#[allow(dead_code)] -pub trait IotaClientAdaptedT: - IotaClientTrait -{ -} -impl IotaClientAdaptedT for T where - T: IotaClientTrait -{ -} -#[allow(dead_code)] -pub type IotaClientAdaptedTraitObj = - Box>; - -pub struct IotaTransactionBlockResponseProvider { - response: WasmIotaTransactionBlockResponseWrapper, - effects: Option, -} - -impl IotaTransactionBlockResponseProvider { - pub fn new(response: WasmIotaTransactionBlockResponseWrapper) -> Self { - let effects = response.effects().map(Into::into); - IotaTransactionBlockResponseProvider { response, effects } - } -} - -#[async_trait::async_trait(?Send)] -impl IotaTransactionBlockResponseT for IotaTransactionBlockResponseProvider { - type Error = TsSdkError; - type NativeResponse = WasmIotaTransactionBlockResponseWrapper; - - fn to_string(&self) -> String { - format!("{:?}", self.response.to_string()) - } - - fn effects(&self) -> Option<&IotaTransactionBlockEffects> { - self.effects.as_ref() - } - - fn as_native_response(&self) -> &Self::NativeResponse { - &self.response - } - - fn as_mut_native_response(&mut self) -> &mut Self::NativeResponse { - &mut self.response - } - - fn clone_native_response(&self) -> Self::NativeResponse { - self.response.clone() - } - - fn digest(&self) -> Result { - self.response.digest() - } -} - -pub struct ReadAdapter { - client: ManagedWasmIotaClient, -} - -#[async_trait::async_trait(?Send)] -impl ReadTrait for ReadAdapter { - type Error = TsSdkError; - type NativeResponse = WasmIotaTransactionBlockResponseWrapper; - - async fn get_chain_identifier(&self) -> Result { - Ok(self.client.get_chain_identifier().await.unwrap()) - } - - async fn get_dynamic_field_object( - &self, - parent_object_id: ObjectID, - name: DynamicFieldName, - ) -> IotaRpcResult { - self.client.get_dynamic_field_object(parent_object_id, name).await - } - - async fn get_object_with_options( - &self, - object_id: ObjectID, - options: IotaObjectDataOptions, - ) -> IotaRpcResult { - self.client.get_object_with_options(object_id, options).await - } - - async fn get_owned_objects( - &self, - address: IotaAddress, - query: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult { - self.client.get_owned_objects(address, query, cursor, limit).await - } - - async fn get_reference_gas_price(&self) -> IotaRpcResult { - self.client.get_reference_gas_price().await - } - - async fn get_transaction_with_options( - &self, - digest: TransactionDigest, - options: IotaTransactionBlockResponseOptions, - ) -> IotaRpcResult { - let wasm_response = self.client.get_transaction_with_options(digest, options).await?; - - Ok(Box::new(IotaTransactionBlockResponseProvider::new(wasm_response))) - } - - async fn try_get_parsed_past_object( - &self, - _object_id: ObjectID, - _version: SequenceNumber, - _options: IotaObjectDataOptions, - ) -> IotaRpcResult { - // TODO: does not work anymore, find out, why we need to pass a different `SequenceNumber` now - unimplemented!("try_get_parsed_past_object"); - // self - // .client - // .try_get_parsed_past_object(object_id, version, options) - // .await - } -} - -pub struct QuorumDriverAdapter { - client: ManagedWasmIotaClient, -} - -#[async_trait::async_trait(?Send)] -impl QuorumDriverTrait for QuorumDriverAdapter { - type Error = TsSdkError; - type NativeResponse = WasmIotaTransactionBlockResponseWrapper; - - async fn execute_transaction_block( - &self, - tx_data: TransactionData, - signatures: Vec, - options: Option, - request_type: Option, - ) -> IotaRpcResult { - let wasm_response = self - .client - .execute_transaction_block(tx_data, signatures, options, request_type) - .await?; - - let digest = wasm_response - .digest() - .map_err(|e| IotaRpcError::FfiError(e.to_string()))?; - - self - .client - .wait_for_transaction(digest, Some(IotaTransactionBlockResponseOptions::new()), None, None) - .await?; - - Ok(Box::new(IotaTransactionBlockResponseProvider::new(wasm_response))) - } -} - -pub struct EventAdapter { - client: ManagedWasmIotaClient, -} - -#[async_trait::async_trait(?Send)] -impl EventTrait for EventAdapter { - type Error = TsSdkError; - - async fn query_events( - &self, - query: EventFilter, - cursor: Option, - limit: Option, - descending_order: bool, - ) -> IotaRpcResult { - self.client.query_events(query, cursor, limit, descending_order).await - } -} - -pub struct CoinReadAdapter { - client: ManagedWasmIotaClient, -} - -#[async_trait::async_trait(?Send)] -impl CoinReadTrait for CoinReadAdapter { - type Error = TsSdkError; - - async fn get_coins( - &self, - owner: IotaAddress, - coin_type: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult { - self.client.get_coins(owner, coin_type, cursor, limit).await - } -} - -#[derive(Clone)] -pub struct IotaClientTsSdk { - iota_client: ManagedWasmIotaClient, -} - -#[async_trait::async_trait(?Send)] -impl IotaClientTrait for IotaClientTsSdk { - type Error = TsSdkError; - type NativeResponse = WasmIotaTransactionBlockResponseWrapper; - - fn quorum_driver_api(&self) -> QuorumDriverApiAdaptedTraitObj { - Box::new(QuorumDriverAdapter { - client: self.iota_client.clone(), - }) - } - - fn read_api(&self) -> ReadApiAdaptedTraitObj { - Box::new(ReadAdapter { - client: self.iota_client.clone(), - }) - } - - fn coin_read_api(&self) -> Box + '_> { - Box::new(CoinReadAdapter { - client: self.iota_client.clone(), - }) - } - - fn event_api(&self) -> Box + '_> { - Box::new(EventAdapter { - client: self.iota_client.clone(), - }) - } - - async fn execute_transaction>( - &self, - tx_data: TransactionData, - signer: &S, - ) -> Result< - Box>, - Self::Error, - > { - let response = self.sdk_execute_transaction(tx_data, signer).await?; - - // wait until new transaction block is available - self - .iota_client - .wait_for_transaction( - response.digest()?, - Some(IotaTransactionBlockResponseOptions::new()), - None, - None, - ) - .await - .unwrap(); - - Ok(Box::new(response)) - } - - async fn default_gas_budget( - &self, - _sender_address: IotaAddress, - _tx: &ProgrammableTransactionSdk, - ) -> Result { - Ok(50_000_000) - } - - async fn get_previous_version(&self, _iod: IotaObjectData) -> Result, Self::Error> { - unimplemented!(); - } - - async fn get_past_object( - &self, - object_id: ObjectID, - version: SequenceNumber, - ) -> Result { - self - .iota_client - .try_get_parsed_past_object(object_id, version, IotaObjectDataOptions::full_content()) - .await - .map_err(|err| { - // TODO: check error variant here, selection has been reduced / focused - // Self::Error::InvalidIdentityHistory(format!("could not look up object {object_id} version {version}; {err}")) - Self::Error::JsSysError(format!("could not look up object {object_id} version {version}; {err}")) - }) - } -} - -impl IotaClientTsSdk { - pub fn new(iota_client: WasmIotaClient) -> Self { - Self { - iota_client: ManagedWasmIotaClient::new(iota_client), - } - } - - pub fn into_inner(self) -> WasmIotaClient { - self.iota_client.clone().0 - } - - // Submit tx to IOTA client, also: - // - signs tx - // - calls execute_transaction_block to submit tx (with signatures created here) - async fn sdk_execute_transaction>( - &self, - tx: TransactionData, - signer: &S, - ) -> Result { - let sender_public_key = signer - .public_key() - .await - .map_err(|e| TsSdkError::WasmError(String::from("SecretStorage"), e.to_string()))?; - let sender_address = IotaAddress::from(&sender_public_key); - if sender_address != tx.sender() { - return Err(TsSdkError::WasmError("SDK".to_owned(), format!("transaction data needs to be signed by address {}, but client can only provide signature for address {sender_address}", tx.sender()))); - } - let signature = signer - .sign(&tx) - .await - .map_err(|e| TsSdkError::WasmError("SecretStorage".to_owned(), e.to_string()))?; - - let wasm_response = self - .quorum_driver_api() - .execute_transaction_block( - tx, - vec![signature], - Some(IotaTransactionBlockResponseOptions::full_content()), - Some(ExecuteTransactionRequestType::WaitForLocalExecution), - ) - .await - .unwrap(); - let native = wasm_response.clone_native_response(); - - Ok(IotaTransactionBlockResponseProvider::new(native)) - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/lib.rs b/bindings/wasm/iota_interaction_ts/src/lib.rs deleted file mode 100644 index 2185256574..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/lib.rs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[cfg(target_arch = "wasm32")] -pub mod bindings; - -#[cfg(target_arch = "wasm32")] -pub mod asset_move_calls; -#[cfg(target_arch = "wasm32")] -pub mod common; -#[cfg(target_arch = "wasm32")] -pub mod error; -#[cfg(target_arch = "wasm32")] -pub mod identity_move_calls; -#[cfg(target_arch = "wasm32")] -pub mod iota_client_ts_sdk; -#[cfg(target_arch = "wasm32")] -mod migration_move_calls; -#[cfg(target_arch = "wasm32")] -pub mod transaction_builder; - -cfg_if::cfg_if! { - if #[cfg(target_arch = "wasm32")] { - #[allow(unused_imports)] pub use error::TsSdkError as AdapterError; - #[allow(unused_imports)] pub use asset_move_calls::AssetMoveCallsTsSdk as AssetMoveCallsAdapter; - #[allow(unused_imports)] pub use identity_move_calls::IdentityMoveCallsTsSdk as IdentityMoveCallsAdapter; - #[allow(unused_imports)] pub use iota_client_ts_sdk::IotaClientTsSdk as IotaClientAdapter; - #[allow(unused_imports)] pub use iota_client_ts_sdk::IotaTransactionBlockResponseProvider as IotaTransactionBlockResponseAdapter; - #[allow(unused_imports)] pub use bindings::WasmIotaTransactionBlockResponseWrapper as NativeTransactionBlockResponse; - #[allow(unused_imports)] pub use migration_move_calls::MigrationMoveCallsTsSdk as MigrationMoveCallsAdapter; - #[allow(unused_imports)] pub use transaction_builder::TransactionBuilderTsSdk as TransactionBuilderAdapter; - - #[allow(unused_imports)] pub use iota_client_ts_sdk::IotaTransactionBlockResponseAdaptedT; - #[allow(unused_imports)] pub use iota_client_ts_sdk::IotaTransactionBlockResponseAdaptedTraitObj; - #[allow(unused_imports)] pub use iota_client_ts_sdk::QuorumDriverApiAdaptedT; - #[allow(unused_imports)] pub use iota_client_ts_sdk::QuorumDriverApiAdaptedTraitObj; - #[allow(unused_imports)] pub use iota_client_ts_sdk::ReadApiAdaptedT; - #[allow(unused_imports)] pub use iota_client_ts_sdk::ReadApiAdaptedTraitObj; - #[allow(unused_imports)] pub use iota_client_ts_sdk::CoinReadApiAdaptedT; - #[allow(unused_imports)] pub use iota_client_ts_sdk::CoinReadApiAdaptedTraitObj; - #[allow(unused_imports)] pub use iota_client_ts_sdk::EventApiAdaptedT; - #[allow(unused_imports)] pub use iota_client_ts_sdk::EventApiAdaptedTraitObj; - #[allow(unused_imports)] pub use iota_client_ts_sdk::IotaClientAdaptedT; - #[allow(unused_imports)] pub use iota_client_ts_sdk::IotaClientAdaptedTraitObj; - - #[allow(unused_imports)] pub use bindings::ProgrammableTransaction; - #[allow(unused_imports)] pub use bindings::WasmPublicKey; - #[allow(unused_imports)] pub use bindings::Ed25519PublicKey as WasmEd25519PublicKey; - #[allow(unused_imports)] pub use bindings::Secp256r1PublicKey as WasmSecp256r1PublicKey; - #[allow(unused_imports)] pub use bindings::Secp256k1PublicKey as WasmSecp256k1PublicKey; - #[allow(unused_imports)] pub use bindings::WasmIotaSignature; - #[cfg(feature = "keytool")] - #[allow(unused_imports)] - pub use bindings::keytool::*; - - #[allow(unused_imports)] pub use transaction_builder::NativeTsTransactionBuilderBindingWrapper; - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/migration_move_calls.rs b/bindings/wasm/iota_interaction_ts/src/migration_move_calls.rs deleted file mode 100644 index 5000374fbc..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/migration_move_calls.rs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::MigrationMoveCalls; -use identity_iota_interaction::ProgrammableTransactionBcs; -use js_sys::Uint8Array; -use wasm_bindgen::prelude::wasm_bindgen; -use wasm_bindgen::JsValue; - -use crate::bindings::WasmObjectRef; -use crate::bindings::WasmSharedObjectRef; -use crate::error::TsSdkError; -use crate::error::WasmError; - -#[wasm_bindgen(module = "@iota/iota-interaction-ts/move_calls")] -extern "C" { - #[wasm_bindgen(js_name = "migrateDidOutput", catch)] - async fn migrate_did_output_impl( - did_output: WasmObjectRef, - migration_registry: WasmSharedObjectRef, - package: &str, - creation_timestamp: Option, - ) -> Result; -} - -pub struct MigrationMoveCallsTsSdk {} - -impl MigrationMoveCalls for MigrationMoveCallsTsSdk { - type Error = TsSdkError; - - fn migrate_did_output( - did_output: ObjectRef, - creation_timestamp: Option, - migration_registry: OwnedObjectRef, - package: ObjectID, - ) -> anyhow::Result { - let did_output = did_output.into(); - let package = package.to_string(); - let migration_registry = migration_registry.try_into()?; - - futures::executor::block_on(migrate_did_output_impl( - did_output, - migration_registry, - &package, - creation_timestamp, - )) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(Self::Error::from) - } -} diff --git a/bindings/wasm/iota_interaction_ts/src/transaction_builder.rs b/bindings/wasm/iota_interaction_ts/src/transaction_builder.rs deleted file mode 100644 index 0d95bb7406..0000000000 --- a/bindings/wasm/iota_interaction_ts/src/transaction_builder.rs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::ops::Deref; -use std::ops::DerefMut; - -use crate::bindings::WasmTransactionBuilder; -use crate::error::TsSdkError; -use crate::error::WasmError; -use identity_iota_interaction::ProgrammableTransactionBcs; -use identity_iota_interaction::TransactionBuilderT; - -pub type NativeTsTransactionBuilderBindingWrapper = WasmTransactionBuilder; - -pub struct TransactionBuilderTsSdk { - pub(crate) builder: NativeTsTransactionBuilderBindingWrapper, -} - -impl TransactionBuilderTsSdk { - pub fn new(builder: NativeTsTransactionBuilderBindingWrapper) -> Self { - TransactionBuilderTsSdk { builder } - } -} - -impl TransactionBuilderT for TransactionBuilderTsSdk { - type Error = TsSdkError; - type NativeTxBuilder = NativeTsTransactionBuilderBindingWrapper; - - fn finish(self) -> Result { - futures::executor::block_on(self.builder.build()) - .map(|js_arr| js_arr.to_vec()) - .map_err(WasmError::from) - .map_err(Self::Error::from) - } - - fn as_native_tx_builder(&mut self) -> &mut Self::NativeTxBuilder { - &mut self.builder - } - - fn into_native_tx_builder(self) -> Self::NativeTxBuilder { - self.builder - } -} - -impl Default for TransactionBuilderTsSdk { - fn default() -> Self { - unimplemented!(); - } -} - -impl Deref for TransactionBuilderTsSdk { - type Target = NativeTsTransactionBuilderBindingWrapper; - - fn deref(&self) -> &Self::Target { - &self.builder - } -} - -impl DerefMut for TransactionBuilderTsSdk { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.builder - } -} diff --git a/bindings/wasm/iota_interaction_ts/tsconfig.json b/bindings/wasm/iota_interaction_ts/tsconfig.json deleted file mode 100644 index e8a42d2a39..0000000000 --- a/bindings/wasm/iota_interaction_ts/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../tsconfig.json", - "entryPoints": [ - "./node/" - ], - "out": "./docs/wasm", - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@iota/iota-interaction-ts/*": [ - "./*" - ], - } - } -} diff --git a/bindings/wasm/iota_interaction_ts/tsconfig.node.json b/bindings/wasm/iota_interaction_ts/tsconfig.node.json deleted file mode 100644 index c75065fb27..0000000000 --- a/bindings/wasm/iota_interaction_ts/tsconfig.node.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "target": "ES2020", - "esModuleInterop": true, - "module": "commonjs" - } -} \ No newline at end of file diff --git a/dprint.json b/dprint.json index 9ce73b412d..9f64875743 100644 --- a/dprint.json +++ b/dprint.json @@ -12,8 +12,7 @@ "excludes": [ "documentation", "**/{node_modules,target}", - "bindings/wasm/identity_wasm/{node,web}/**/*.{js,ts}", - "bindings/wasm/iota_interaction_ts/{node,web}/**/*.{js,ts}" + "bindings/wasm/identity_wasm/{node,web}/**/*.{js,ts}" ], "plugins": [ "https://plugins.dprint.dev/toml-0.5.1.wasm", diff --git a/examples/1_advanced/10_zkp_revocation.rs b/examples/1_advanced/10_zkp_revocation.rs index 021725fb3f..b8d4756573 100644 --- a/examples/1_advanced/10_zkp_revocation.rs +++ b/examples/1_advanced/10_zkp_revocation.rs @@ -47,9 +47,7 @@ use identity_iota::document::verifiable::JwsVerificationOptions; use identity_iota::document::Service; use identity_iota::iota::rebased::client::IdentityClient; use identity_iota::iota::rebased::client::IotaKeySignature; -use identity_iota::iota::rebased::transaction::TransactionOutput; use identity_iota::iota::IotaDocument; -use identity_iota::iota::NetworkName; use identity_iota::iota_interaction::OptionalSync; use identity_iota::resolver::Resolver; use identity_iota::storage::JwkDocumentExt; @@ -63,6 +61,8 @@ use identity_iota::verification::jws::JwsAlgorithm; use identity_iota::verification::MethodScope; use identity_storage::Storage; use jsonprooftoken::jpa::algs::ProofAlgorithm; +use product_core::network_name::NetworkName; +use product_core::transaction::TransactionOutput; use secret_storage::Signer; use std::thread; use std::time::Duration as SleepDuration; diff --git a/examples/1_advanced/12_advanced_transactions.rs b/examples/1_advanced/12_advanced_transactions.rs index 49bdbe65ee..50e56d3078 100644 --- a/examples/1_advanced/12_advanced_transactions.rs +++ b/examples/1_advanced/12_advanced_transactions.rs @@ -6,10 +6,7 @@ use examples::get_memstorage; use examples::TEST_GAS_BUDGET; use anyhow::Context as _; -use identity_iota::iota::rebased::client::CoreClient; use identity_iota::iota::rebased::client::IdentityClient; -use identity_iota::iota::rebased::transaction_builder::MutGasDataRef; -use identity_iota::iota::rebased::transaction_builder::Transaction as _; use identity_iota::iota::IotaDocument; use identity_iota::iota_interaction::IotaClientTrait as _; use identity_iota::iota_interaction::IotaKeySignature; @@ -20,6 +17,9 @@ use iota_sdk::types::transaction::GasData; use iota_sdk::types::transaction::Transaction; use iota_sdk::IotaClientBuilder; use iota_sdk::IOTA_COIN_TYPE; +use product_core::core_client::CoreClient; +use product_core::transaction::transaction_builder::MutGasDataRef; +use product_core::transaction::transaction_builder::Transaction as _; use secret_storage::Signer; /// This example demonstrates: @@ -58,9 +58,9 @@ async fn main() -> anyhow::Result<()> { ExecuteTransactionRequestType::WaitForLocalExecution, ) .await?; - let tx_effects = tx_response.effects.as_ref().expect("transaction had effects").clone(); + let mut tx_effects = tx_response.effects.as_ref().expect("transaction had effects").clone(); // Alice's Identity is parsed out of the transaction's effects! - let identity = tx.apply(tx_effects, &alice_client).await.0?; + let identity = tx.apply(&mut tx_effects, &alice_client).await?; println!( "Alice successfully created Identity {}! Thanks for the gas Bob!", diff --git a/examples/1_advanced/9_zkp.rs b/examples/1_advanced/9_zkp.rs index 22ae1e50c1..511616eccc 100644 --- a/examples/1_advanced/9_zkp.rs +++ b/examples/1_advanced/9_zkp.rs @@ -27,7 +27,6 @@ use identity_iota::did::CoreDID; use identity_iota::did::DID; use identity_iota::iota_interaction::OptionalSync; -use identity_iota::iota::rebased::transaction::TransactionOutput; use identity_iota::iota::IotaDocument; use identity_iota::resolver::Resolver; use identity_iota::storage::JwkMemStore; @@ -39,6 +38,7 @@ use identity_iota::iota::rebased::client::IdentityClient; use identity_iota::iota::rebased::client::IotaKeySignature; use identity_storage::Storage; use jsonprooftoken::jpa::algs::ProofAlgorithm; +use product_core::transaction::TransactionOutput; use secret_storage::Signer; // Creates a DID with a JWP verification method. diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 0247f64d3e..4c456d4f6c 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -13,6 +13,7 @@ identity_stronghold = { path = "../identity_stronghold", default-features = fals iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v0.12.0-rc" } iota-sdk-legacy = { package = "iota-sdk", version = "1.0", default-features = false, features = ["tls", "client", "stronghold"] } json-proof-token.workspace = true +product-core = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common", features = ["core-client", "transaction"] } rand = "0.8.5" sd-jwt-payload = { version = "0.2.1", default-features = false, features = ["sha"] } secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", tag = "v0.3.0" } diff --git a/identity_core/Cargo.toml b/identity_core/Cargo.toml index 9c0c5d60e6..0ee936eec0 100644 --- a/identity_core/Cargo.toml +++ b/identity_core/Cargo.toml @@ -15,6 +15,7 @@ description = "The core traits and types for the identity-rs library." # that conflicts with `iota-sdk`s `core` impl, leading to errors in `iota-sdk` crate deranged = { version = ">=0.4.0, <0.4.1", default-features = false } multibase = { version = "0.9", default-features = false, features = ["std"] } +product_common.workspace = true serde = { workspace = true, features = ["std"] } serde_json = { workspace = true, features = ["std"] } strum.workspace = true diff --git a/identity_core/src/common/mod.rs b/identity_core/src/common/mod.rs index 04568e05b5..36a224d618 100644 --- a/identity_core/src/common/mod.rs +++ b/identity_core/src/common/mod.rs @@ -5,8 +5,6 @@ pub use self::context::Context; pub use self::key_comparable::KeyComparable; -pub use self::object::Object; -pub use self::object::Value; pub use self::one_or_many::OneOrMany; pub use self::one_or_set::OneOrSet; pub use self::ordered_set::OrderedSet; @@ -14,11 +12,12 @@ pub use self::single_struct_error::*; pub use self::timestamp::Duration; pub use self::timestamp::Timestamp; pub use self::url::Url; +pub use product_common::object::Object; +pub use product_common::object::Value; pub use string_or_url::StringOrUrl; mod context; mod key_comparable; -mod object; mod one_or_many; mod one_or_set; mod ordered_set; diff --git a/identity_core/src/common/object.rs b/identity_core/src/common/object.rs deleted file mode 100644 index 5808402608..0000000000 --- a/identity_core/src/common/object.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2020-2021 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::BTreeMap; - -#[doc(inline)] -pub use serde_json::Value; - -/// An alias for an ordered map of key-[value][`Value`] pairs. -pub type Object = BTreeMap; diff --git a/identity_credential/src/presentation/jwt_serialization.rs b/identity_credential/src/presentation/jwt_serialization.rs index 89c91731f5..c758b52c69 100644 --- a/identity_credential/src/presentation/jwt_serialization.rs +++ b/identity_credential/src/presentation/jwt_serialization.rs @@ -117,7 +117,7 @@ where types: Cow<'presentation, OneOrMany>, /// Credential(s) expressing the claims of the `Presentation`. #[serde(default = "Default::default", rename = "verifiableCredential")] - pub(crate) verifiable_credential: Cow<'presentation, Vec>, + pub(crate) verifiable_credential: Cow<'presentation, [CRED]>, /// The entity that generated the `Presentation`. #[serde(skip_serializing_if = "Option::is_none")] holder: Option, diff --git a/identity_iota/Cargo.toml b/identity_iota/Cargo.toml index 386b4b5783..260e0ac927 100644 --- a/identity_iota/Cargo.toml +++ b/identity_iota/Cargo.toml @@ -21,10 +21,11 @@ identity_storage = { version = "=1.6.0-alpha", path = "../identity_storage", def identity_verification = { version = "=1.6.0-alpha", path = "../identity_verification", default-features = false } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction" } +iota_interaction.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction", default-features = false } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", default-features = false } +# iota_interaction = { path = "../../product-core/iota_interaction", default-features = false } [dev-dependencies] # required for doc test diff --git a/identity_iota/src/lib.rs b/identity_iota/src/lib.rs index 0d93d605c0..44a494fa47 100644 --- a/identity_iota/src/lib.rs +++ b/identity_iota/src/lib.rs @@ -17,7 +17,7 @@ clippy::missing_errors_doc )] -pub use identity_iota_interaction as iota_interaction; +pub use iota_interaction; pub mod core { //! Core Traits and Types diff --git a/identity_iota_core/Cargo.toml b/identity_iota_core/Cargo.toml index 03439da59c..31630609aa 100644 --- a/identity_iota_core/Cargo.toml +++ b/identity_iota_core/Cargo.toml @@ -24,6 +24,7 @@ num-derive = { version = "0.4", default-features = false } num-traits = { version = "0.2", default-features = false, features = ["std"] } once_cell = { version = "1.18", default-features = false, features = ["std"] } prefix-hex = { version = "0.7", default-features = false } +product-core = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common", default-features = false } ref-cast = { version = "1.0.14", default-features = false } serde.workspace = true serde_json.workspace = true @@ -38,26 +39,29 @@ identity_jose = { version = "=1.6.0-alpha", path = "../identity_jose", optional iota-crypto = { version = "0.23", optional = true } itertools = { version = "0.13.0", optional = true } phf = { version = "0.11.2", features = ["macros"] } + rand = { version = "0.8.5", optional = true } secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", tag = "v0.3.0", default-features = false, optional = true } serde-aux = { version = "4.5.0", optional = true } toml = "0.8.22" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction", optional = true } iota-config = { git = "https://github.com/iotaledger/iota.git", package = "iota-config", tag = "v0.12.0-rc", optional = true } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", optional = true } +iota_interaction_rust = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction_rust", optional = true } iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v0.12.0-rc", optional = true } move-core-types = { git = "https://github.com/iotaledger/iota.git", package = "move-core-types", tag = "v0.12.0-rc", optional = true } shared-crypto = { git = "https://github.com/iotaledger/iota.git", package = "shared-crypto", tag = "v0.12.0-rc", optional = true } tokio = { version = "1.43", default-features = false, features = ["macros", "sync", "rt", "process"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction", default-features = false, optional = true } -tokio = { version = "1.43", default-features = false, features = ["sync"] } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", default-features = false, optional = true } + # Dependency iota_interaction_ts is always used on wasm32 platform. It is not controlled by the "iota-client" feature # because it's unclear how to implement this. wasm32 build will most probably always use the "iota-client" feature # so this seems to be tolerable for now. -iota_interaction_ts = { version = "=1.6.0-alpha", path = "../bindings/wasm/iota_interaction_ts" } +iota_interaction_ts.workspace = true +tokio = { version = "1.43", default-features = false, features = ["sync"] } [dev-dependencies] iota-crypto = { version = "0.23", default-features = false, features = ["bip39", "bip39-en"] } @@ -83,29 +87,36 @@ iota-client = [ "dep:bcs", "dep:fastcrypto", "dep:identity_eddsa_verifier", - "dep:identity_iota_interaction", "dep:identity_jose", "dep:iota-config", "dep:iota-crypto", + "dep:iota_interaction", + "dep:iota_interaction_rust", "dep:iota-sdk", "dep:itertools", "dep:move-core-types", "dep:rand", "dep:secret-storage", "dep:serde-aux", + "product-core/transaction", ] # Enables revocation with `RevocationBitmap2022`. revocation-bitmap = ["identity_credential/revocation-bitmap"] # Enables `Send` + `Sync` bounds for the storage and client interaction traits. -send-sync = ["send-sync-storage", "send-sync-client-ext", "identity_iota_interaction/send-sync-transaction"] +send-sync = [ + "send-sync-storage", + "send-sync-client-ext", + "iota_interaction/send-sync-transaction", + "product-core/send-sync", +] # Enables `Send` + `Sync` bounds for the storage traits. send-sync-storage = ["secret-storage?/send-sync-storage"] # Enables `Send` + `Sync` bounds for IOTA client interaction traits. send-sync-client-ext = [] keytool = [ - "identity_iota_interaction/keytool", + "iota_interaction/keytool", "identity_storage/keytool", "iota_interaction_ts/keytool", "iota-client", diff --git a/identity_iota_core/src/did/iota_did.rs b/identity_iota_core/src/did/iota_did.rs index 14de0f5e40..b322c90493 100644 --- a/identity_iota_core/src/did/iota_did.rs +++ b/identity_iota_core/src/did/iota_did.rs @@ -12,13 +12,12 @@ use identity_did::BaseDIDUrl; use identity_did::CoreDID; use identity_did::Error as DIDError; use identity_did::DID; +use product_core::network_name::NetworkName; use ref_cast::ref_cast_custom; use ref_cast::RefCastCustom; use serde::Deserialize; use serde::Serialize; -use crate::NetworkName; - /// Alias for a `Result` with the error type [`DIDError`]. type Result = std::result::Result; @@ -74,7 +73,7 @@ impl IotaDID { /// /// ``` /// # use identity_did::DID; - /// # use identity_iota_core::NetworkName; + /// # use product_core::network_name::NetworkName; /// # use identity_iota_core::IotaDID; /// # /// let did = IotaDID::new(&[1;32], &NetworkName::try_from("smr").unwrap()); @@ -98,7 +97,7 @@ impl IotaDID { /// /// ``` /// # use identity_did::DID; - /// # use identity_iota_core::NetworkName; + /// # use product_core::network_name::NetworkName; /// # use identity_iota_core::IotaDID; /// # /// let placeholder = IotaDID::placeholder(&NetworkName::try_from("smr").unwrap()); @@ -114,7 +113,7 @@ impl IotaDID { /// /// ``` /// # use identity_did::DID; - /// # use identity_iota_core::NetworkName; + /// # use product_core::network_name::NetworkName; /// # use identity_iota_core::IotaDID; /// # /// let placeholder = IotaDID::placeholder(&NetworkName::try_from("smr").unwrap()); diff --git a/identity_iota_core/src/document/iota_document.rs b/identity_iota_core/src/document/iota_document.rs index b1cad01c9a..b4beb06c61 100644 --- a/identity_iota_core/src/document/iota_document.rs +++ b/identity_iota_core/src/document/iota_document.rs @@ -10,6 +10,7 @@ use identity_did::DIDUrl; use identity_document::verifiable::JwsVerificationOptions; use identity_verification::jose::jws::DecodedJws; use identity_verification::jose::jws::JwsVerifier; +use product_core::network_name::NetworkName; use serde::Deserialize; use serde::Serialize; @@ -29,7 +30,6 @@ use crate::error::Result; use crate::Error; use crate::IotaDID; use crate::IotaDocumentMetadata; -use crate::NetworkName; use crate::StateMetadataDocument; use crate::StateMetadataEncoding; @@ -398,7 +398,7 @@ impl IotaDocument { mod client_document { use identity_core::common::Timestamp; use identity_did::DID; - use identity_iota_interaction::rpc_types::IotaObjectData; + use iota_interaction::rpc_types::IotaObjectData; use crate::rebased::migration::unpack_identity_data; use crate::rebased::migration::IdentityData; diff --git a/identity_iota_core/src/iota_interaction_adapter.rs b/identity_iota_core/src/iota_interaction_adapter.rs index c0b97a4e38..5647e12107 100644 --- a/identity_iota_core/src/iota_interaction_adapter.rs +++ b/identity_iota_core/src/iota_interaction_adapter.rs @@ -10,6 +10,6 @@ cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { pub(crate) use iota_interaction_ts::*; } else { - pub(crate) use crate::iota_interaction_rust::*; + pub(crate) use iota_interaction_rust::*; } } diff --git a/identity_iota_core/src/iota_interaction_rust/asset_move_calls.rs b/identity_iota_core/src/iota_interaction_rust/asset_move_calls.rs deleted file mode 100644 index 1c95de138f..0000000000 --- a/identity_iota_core/src/iota_interaction_rust/asset_move_calls.rs +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::Serialize; - -use crate::rebased::Error; -use identity_iota_interaction::ident_str; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::Command; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableMoveCall; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::AssetMoveCalls; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::ProgrammableTransactionBcs; -use identity_iota_interaction::TypedValue; - -fn try_to_argument( - content: &T, - ptb: &mut ProgrammableTransactionBuilder, - package: ObjectID, -) -> Result { - match content.get_typed_value(package) { - TypedValue::IotaVerifiableCredential(value) => { - let values = ptb - .pure(value.data()) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - Ok(ptb.command(Command::MoveCall(Box::new(ProgrammableMoveCall { - package, - module: ident_str!("public_vc").into(), - function: ident_str!("new").into(), - type_arguments: vec![], - arguments: vec![values], - })))) - } - TypedValue::Other(value) => ptb.pure(value).map_err(|e| Error::InvalidArgument(e.to_string())), - } -} - -pub(crate) struct AssetMoveCallsRustSdk {} - -impl AssetMoveCalls for AssetMoveCallsRustSdk { - type Error = Error; - - fn new_asset( - inner: &T, - mutable: bool, - transferable: bool, - deletable: bool, - package: ObjectID, - ) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let inner = try_to_argument(inner, &mut ptb, package)?; - let mutable = ptb.pure(mutable).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let transferable = ptb - .pure(transferable) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let deletable = ptb.pure(deletable).map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::MoveCall(Box::new(ProgrammableMoveCall { - package, - module: ident_str!("asset").into(), - function: ident_str!("new_with_config").into(), - type_arguments: vec![T::move_type(package)], - arguments: vec![inner, mutable, transferable, deletable], - }))); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn delete(asset: ObjectRef, package: ObjectID) -> Result - where - T: MoveType, - { - let mut ptb = ProgrammableTransactionBuilder::new(); - - let asset = ptb - .obj(ObjectArg::ImmOrOwnedObject(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!("delete").into(), - vec![T::move_type(package)], - vec![asset], - )); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn transfer( - asset: ObjectRef, - recipient: IotaAddress, - package: ObjectID, - ) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let asset = ptb - .obj(ObjectArg::ImmOrOwnedObject(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let recipient = ptb.pure(recipient).map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!("transfer").into(), - vec![T::move_type(package)], - vec![asset, recipient], - )); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn make_tx( - proposal: (ObjectID, SequenceNumber), - cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, - function_name: &'static str, - ) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let proposal = ptb - .obj(ObjectArg::SharedObject { - id: proposal.0, - initial_shared_version: proposal.1, - mutable: true, - }) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let cap = ptb - .obj(ObjectArg::ImmOrOwnedObject(cap)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let asset = ptb - .obj(ObjectArg::Receiving(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!(function_name).into(), - vec![asset_type_param], - vec![proposal, cap, asset], - )); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn accept_proposal( - proposal: (ObjectID, SequenceNumber), - recipient_cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, - ) -> Result { - Self::make_tx(proposal, recipient_cap, asset, asset_type_param, package, "accept") - } - - fn conclude_or_cancel( - proposal: (ObjectID, SequenceNumber), - sender_cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, - ) -> Result { - Self::make_tx( - proposal, - sender_cap, - asset, - asset_type_param, - package, - "conclude_or_cancel", - ) - } - - fn update(asset: ObjectRef, new_content: &T, package: ObjectID) -> Result - where - T: MoveType + Serialize, - { - let mut ptb = ProgrammableTransactionBuilder::new(); - - let asset = ptb - .obj(ObjectArg::ImmOrOwnedObject(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let new_content = ptb - .pure(new_content) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!("set_content").into(), - vec![T::move_type(package)], - vec![asset, new_content], - )); - - Ok(bcs::to_bytes(&ptb.finish())?) - } -} diff --git a/identity_iota_core/src/iota_interaction_rust/identity_move_calls.rs b/identity_iota_core/src/iota_interaction_rust/identity_move_calls.rs deleted file mode 100644 index 4c661ac98e..0000000000 --- a/identity_iota_core/src/iota_interaction_rust/identity_move_calls.rs +++ /dev/null @@ -1,953 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use async_trait::async_trait; -use identity_iota_interaction::ControllerTokenRef; -use identity_iota_interaction::OptionalSend; -use itertools::Itertools; - -use std::collections::HashSet; -use std::str::FromStr; - -use identity_iota_interaction::ident_str; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::ObjectType; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as PrgrTxBuilder; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::BorrowIntentFnInternalT; -use identity_iota_interaction::ControllerIntentFnInternalT; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::ProgrammableTransactionBcs; -use identity_iota_interaction::TransactionBuilderT; - -use super::transaction_builder::TransactionBuilderRustSdk; -use super::utils; - -use crate::rebased::proposals::BorrowAction; -use crate::rebased::proposals::ControllerExecution; -use crate::rebased::proposals::SendAction; -use crate::rebased::rebased_err; -use crate::rebased::Error; - -enum ControllerTokenArg { - Controller { - cap: Argument, - token: Argument, - borrow: Argument, - }, - Delegate(Argument), -} - -impl ControllerTokenArg { - fn from_ref(controller_ref: ControllerTokenRef, ptb: &mut PrgrTxBuilder, package: ObjectID) -> Result { - let token_arg = ptb - .obj(ObjectArg::ImmOrOwnedObject(controller_ref.object_ref())) - .map_err(rebased_err)?; - match controller_ref { - ControllerTokenRef::Delegate(_) => Ok(ControllerTokenArg::Delegate(token_arg)), - ControllerTokenRef::Controller(_) => { - let cap = token_arg; - let (token, borrow) = utils::get_controller_delegation(ptb, cap, package); - - Ok(Self::Controller { cap, token, borrow }) - } - } - } - - fn arg(&self) -> Argument { - match self { - Self::Controller { token, .. } => *token, - Self::Delegate(token) => *token, - } - } - - fn put_back(self, ptb: &mut PrgrTxBuilder, package_id: ObjectID) { - if let Self::Controller { cap, token, borrow } = self { - utils::put_back_delegation_token(ptb, cap, token, borrow, package_id); - } - } -} - -struct ProposalContext { - ptb: PrgrTxBuilder, - capability: ControllerTokenArg, - identity: Argument, - proposal_id: Argument, -} - -fn borrow_proposal_impl( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - objects: Vec, - expiration: Option, - package_id: ObjectID, -) -> anyhow::Result { - let mut ptb = PrgrTxBuilder::new(); - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - let objects_arg = ptb.pure(objects)?; - - let proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_borrow").into(), - vec![], - vec![identity_arg, capability.arg(), exp_arg, objects_arg], - ); - - Ok(ProposalContext { - ptb, - identity: identity_arg, - capability, - proposal_id, - }) -} - -fn execute_borrow_impl>( - ptb: &mut PrgrTxBuilder, - identity: Argument, - delegation_token: Argument, - proposal_id: Argument, - objects: Vec, - intent_fn: F, - package: ObjectID, -) -> anyhow::Result<()> { - // Get the proposal's action as argument. - let borrow_action = ptb.programmable_move_call( - package, - move_core_types::ident_str!("identity").into(), - move_core_types::ident_str!("execute_proposal").into(), - vec![BorrowAction::move_type(package)], - vec![identity, delegation_token, proposal_id], - ); - - // Borrow all the objects specified in the action. - let obj_arg_map = objects - .into_iter() - .map(|obj_data| { - let obj_ref = obj_data.object_ref(); - let ObjectType::Struct(obj_type) = obj_data.object_type()? else { - unreachable!("move packages cannot be borrowed to begin with"); - }; - let recv_obj = ptb.obj(ObjectArg::Receiving(obj_ref))?; - - let obj_arg = ptb.programmable_move_call( - package, - move_core_types::ident_str!("identity").into(), - move_core_types::ident_str!("execute_borrow").into(), - vec![obj_type.into()], - vec![identity, borrow_action, recv_obj], - ); - - Ok((obj_ref.0, (obj_arg, obj_data))) - }) - .collect::>()?; - - // Apply the user-defined operation. - intent_fn(ptb, &obj_arg_map); - - // Put back all the objects. - obj_arg_map.into_values().for_each(|(obj_arg, obj_data)| { - let ObjectType::Struct(obj_type) = obj_data.object_type().expect("checked above") else { - unreachable!("move packages cannot be borrowed to begin with"); - }; - ptb.programmable_move_call( - package, - move_core_types::ident_str!("borrow_proposal").into(), - move_core_types::ident_str!("put_back").into(), - vec![obj_type.into()], - vec![borrow_action, obj_arg], - ); - }); - - // Consume the now empty borrow_action - ptb.programmable_move_call( - package, - move_core_types::ident_str!("borrow_proposal").into(), - move_core_types::ident_str!("conclude_borrow").into(), - vec![], - vec![borrow_action], - ); - - Ok(()) -} - -fn controller_execution_impl( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - controller_cap_id: ObjectID, - expiration: Option, - package_id: ObjectID, -) -> anyhow::Result { - let mut ptb = PrgrTxBuilder::new(); - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let controller_cap_id = ptb.pure(controller_cap_id)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - - let proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_controller_execution").into(), - vec![], - vec![identity_arg, capability.arg(), controller_cap_id, exp_arg], - ); - - Ok(ProposalContext { - ptb, - capability, - identity: identity_arg, - proposal_id, - }) -} - -fn execute_controller_execution_impl>( - ptb: &mut PrgrTxBuilder, - identity: Argument, - proposal_id: Argument, - delegation_token: Argument, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package: ObjectID, -) -> anyhow::Result<()> { - // Get the proposal's action as argument. - let controller_execution_action = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_proposal").into(), - vec![ControllerExecution::move_type(package)], - vec![identity, delegation_token, proposal_id], - ); - - // Borrow the controller cap into this transaction. - let receiving = ptb.obj(ObjectArg::Receiving(borrowing_controller_cap_ref))?; - let borrowed_controller_cap = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("borrow_controller_cap").into(), - vec![], - vec![identity, controller_execution_action, receiving], - ); - - // Apply the user-defined operation. - intent_fn(ptb, &borrowed_controller_cap); - - // Put back the borrowed controller cap. - ptb.programmable_move_call( - package, - ident_str!("controller_proposal").into(), - ident_str!("put_back").into(), - vec![], - vec![controller_execution_action, borrowed_controller_cap], - ); - - Ok(()) -} - -fn send_proposal_impl( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - package_id: ObjectID, -) -> anyhow::Result { - let mut ptb = PrgrTxBuilder::new(); - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - let (objects, recipients) = { - let (objects, recipients): (Vec<_>, Vec<_>) = transfer_map.into_iter().unzip(); - let objects = ptb.pure(objects)?; - let recipients = ptb.pure(recipients)?; - - (objects, recipients) - }; - - let proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_send").into(), - vec![], - vec![identity_arg, capability.arg(), exp_arg, objects, recipients], - ); - - Ok(ProposalContext { - ptb, - identity: identity_arg, - capability, - proposal_id, - }) -} - -fn execute_send_impl( - ptb: &mut PrgrTxBuilder, - identity: Argument, - delegation_token: Argument, - proposal_id: Argument, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, -) -> anyhow::Result<()> { - // Get the proposal's action as argument. - let send_action = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_proposal").into(), - vec![SendAction::move_type(package)], - vec![identity, delegation_token, proposal_id], - ); - - // Send each object in this send action. - // Traversing the map in reverse reduces the number of operations on the move side. - for (obj, obj_type) in objects.into_iter().rev() { - let recv_obj = ptb.obj(ObjectArg::Receiving(obj))?; - - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_send").into(), - vec![obj_type], - vec![identity, send_action, recv_obj], - ); - } - - // Consume the now empty send_action - ptb.programmable_move_call( - package, - ident_str!("transfer_proposal").into(), - ident_str!("complete_send").into(), - vec![], - vec![send_action], - ); - - Ok(()) -} - -#[derive(Clone)] -pub(crate) struct IdentityMoveCallsRustSdk {} - -#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -#[cfg_attr(not(target_arch = "wasm32"), async_trait)] -impl IdentityMoveCalls for IdentityMoveCallsRustSdk { - type Error = Error; - type NativeTxBuilder = PrgrTxBuilder; - - fn propose_borrow( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - objects: Vec, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let ProposalContext { - mut ptb, capability, .. - } = borrow_proposal_impl(identity, capability, objects, expiration, package_id)?; - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn execute_borrow>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - objects: Vec, - intent_fn: F, - package: ObjectID, - ) -> Result { - let mut internal_ptb = TransactionBuilderRustSdk::new(PrgrTxBuilder::new()); - let ptb = internal_ptb.as_native_tx_builder(); - let identity = utils::owned_ref_to_shared_object_arg(identity, ptb, true)?; - let capability = ControllerTokenArg::from_ref(capability, ptb, package)?; - let proposal_id = ptb.pure(proposal_id)?; - - execute_borrow_impl( - ptb, - identity, - capability.arg(), - proposal_id, - objects, - intent_fn, - package, - )?; - - capability.put_back(ptb, package); - - internal_ptb.finish() - } - - fn create_and_execute_borrow>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - objects: Vec, - intent_fn: F, - expiration: Option, - package_id: ObjectID, - ) -> anyhow::Result { - let ProposalContext { - mut ptb, - capability, - identity, - proposal_id, - } = borrow_proposal_impl( - identity, - capability, - objects.iter().map(|obj_data| obj_data.object_id).collect_vec(), - expiration, - package_id, - )?; - - execute_borrow_impl( - &mut ptb, - identity, - capability.arg(), - proposal_id, - objects, - intent_fn, - package_id, - )?; - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn propose_config_change( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - expiration: Option, - threshold: Option, - controllers_to_add: I1, - controllers_to_remove: HashSet, - controllers_to_update: I2, - package: ObjectID, - ) -> Result - where - I1: IntoIterator, - I2: IntoIterator, - { - let mut ptb = PrgrTxBuilder::new(); - - let controllers_to_add = { - let (addresses, vps): (Vec, Vec) = controllers_to_add.into_iter().unzip(); - let addresses = ptb.pure(addresses).map_err(rebased_err)?; - let vps = ptb.pure(vps).map_err(rebased_err)?; - - ptb.programmable_move_call( - package, - ident_str!("utils").into(), - ident_str!("vec_map_from_keys_values").into(), - vec![TypeTag::Address, TypeTag::U64], - vec![addresses, vps], - ) - }; - let controllers_to_update = { - let (ids, vps): (Vec, Vec) = controllers_to_update.into_iter().unzip(); - let ids = ptb.pure(ids).map_err(rebased_err)?; - let vps = ptb.pure(vps).map_err(rebased_err)?; - - ptb.programmable_move_call( - package, - ident_str!("utils").into(), - ident_str!("vec_map_from_keys_values").into(), - vec![TypeTag::from_str("0x2::object::ID").expect("valid utf8"), TypeTag::U64], - vec![ids, vps], - ) - }; - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; - let capability = ControllerTokenArg::from_ref(controller_cap, &mut ptb, package)?; - let expiration = utils::option_to_move(expiration, &mut ptb, package).map_err(rebased_err)?; - let threshold = utils::option_to_move(threshold, &mut ptb, package).map_err(rebased_err)?; - let controllers_to_remove = ptb.pure(controllers_to_remove).map_err(rebased_err)?; - - let _proposal_id = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("propose_config_change").into(), - vec![], - vec![ - identity, - capability.arg(), - expiration, - threshold, - controllers_to_add, - controllers_to_remove, - controllers_to_update, - ], - ); - - capability.put_back(&mut ptb, package); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn execute_config_change( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - proposal_id: ObjectID, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; - let capability = ControllerTokenArg::from_ref(controller_cap, &mut ptb, package)?; - let proposal_id = ptb.pure(proposal_id).map_err(rebased_err)?; - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_config_change").into(), - vec![], - vec![identity, capability.arg(), proposal_id], - ); - - capability.put_back(&mut ptb, package); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn propose_controller_execution( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - controller_cap_id: ObjectID, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let ProposalContext { - mut ptb, capability, .. - } = controller_execution_impl(identity, capability, controller_cap_id, expiration, package_id)?; - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn execute_controller_execution>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package)?; - let proposal_id = ptb.pure(proposal_id)?; - - execute_controller_execution_impl( - &mut ptb, - identity, - proposal_id, - capability.arg(), - borrowing_controller_cap_ref, - intent_fn, - package, - )?; - - capability.put_back(&mut ptb, package); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn create_and_execute_controller_execution>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - expiration: Option, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package_id: ObjectID, - ) -> Result { - let ProposalContext { - mut ptb, - capability, - proposal_id, - identity, - } = controller_execution_impl( - identity, - capability, - borrowing_controller_cap_ref.0, - expiration, - package_id, - )?; - - execute_controller_execution_impl( - &mut ptb, - identity, - proposal_id, - capability.arg(), - borrowing_controller_cap_ref, - intent_fn, - package_id, - )?; - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn new_identity( - did_doc: Option<&[u8]>, - package_id: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let doc_arg = utils::ptb_pure(&mut ptb, "did_doc", did_doc)?; - let clock = utils::get_clock_ref(&mut ptb); - - // Create a new identity, sending its capability to the tx's sender. - let _identity_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("new").into(), - vec![], - vec![doc_arg, clock], - ); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn new_with_controllers( - did_doc: Option<&[u8]>, - controllers: C, - threshold: u64, - package_id: ObjectID, - ) -> Result - where - C: IntoIterator + OptionalSend, - { - use itertools::Either; - use itertools::Itertools as _; - - let mut ptb = PrgrTxBuilder::new(); - - let (controllers_that_can_delegate, controllers): (Vec<_>, Vec<_>) = - controllers.into_iter().partition_map(|(address, vp, can_delegate)| { - if can_delegate { - Either::Left((address, vp)) - } else { - Either::Right((address, vp)) - } - }); - - let mut make_vec_map = |controllers: Vec<(IotaAddress, u64)>| -> Result { - let (ids, vps): (Vec<_>, Vec<_>) = controllers.into_iter().unzip(); - let ids = ptb.pure(ids).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let vps = ptb.pure(vps).map_err(|e| Error::InvalidArgument(e.to_string()))?; - Ok(ptb.programmable_move_call( - package_id, - ident_str!("utils").into(), - ident_str!("vec_map_from_keys_values").into(), - vec![TypeTag::Address, TypeTag::U64], - vec![ids, vps], - )) - }; - - let controllers = make_vec_map(controllers)?; - let controllers_that_can_delegate = make_vec_map(controllers_that_can_delegate)?; - let doc_arg = ptb.pure(did_doc).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let threshold_arg = ptb.pure(threshold).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let clock = utils::get_clock_ref(&mut ptb); - - // Create a new identity, sending its capabilities to the specified controllers. - let _identity_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("new_with_controllers").into(), - vec![], - vec![ - doc_arg, - controllers, - controllers_that_can_delegate, - threshold_arg, - clock, - ], - ); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn approve_proposal( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - proposal_id: ObjectID, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true) - .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; - let capability = ControllerTokenArg::from_ref(controller_cap, &mut ptb, package)?; - let proposal_id = ptb - .pure(proposal_id) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("approve_proposal").into(), - vec![T::move_type(package)], - vec![identity, capability.arg(), proposal_id], - ); - - capability.put_back(&mut ptb, package); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn propose_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let ProposalContext { - mut ptb, capability, .. - } = send_proposal_impl(identity, capability, transfer_map, expiration, package_id)?; - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn execute_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package)?; - let proposal_id = ptb.pure(proposal_id)?; - - execute_send_impl(&mut ptb, identity, capability.arg(), proposal_id, objects, package)?; - - capability.put_back(&mut ptb, package); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn create_and_execute_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, - ) -> anyhow::Result { - let ProposalContext { - mut ptb, - identity, - capability, - proposal_id, - } = send_proposal_impl(identity, capability, transfer_map, expiration, package)?; - - execute_send_impl(&mut ptb, identity, capability.arg(), proposal_id, objects, package)?; - - capability.put_back(&mut ptb, package); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn propose_update( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - did_doc: Option<&[u8]>, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id).map_err(rebased_err)?; - let doc_arg = ptb.pure(did_doc).map_err(rebased_err)?; - let clock = utils::get_clock_ref(&mut ptb); - - let _proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_update").into(), - vec![], - vec![identity_arg, capability.arg(), doc_arg, exp_arg, clock], - ); - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn execute_update( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - package_id: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; - let proposal_id = ptb.pure(proposal_id).map_err(rebased_err)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; - let clock = utils::get_clock_ref(&mut ptb); - - let _ = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("execute_update").into(), - vec![], - vec![identity_arg, capability.arg(), proposal_id, clock], - ); - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn propose_upgrade( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - expiration: Option, - package_id: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id).map_err(rebased_err)?; - - let _proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_upgrade").into(), - vec![], - vec![identity_arg, capability.arg(), exp_arg], - ); - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - fn execute_upgrade( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - package_id: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; - let proposal_id = ptb.pure(proposal_id).map_err(rebased_err)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; - - let _ = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("execute_upgrade").into(), - vec![], - vec![identity_arg, capability.arg(), proposal_id], - ); - - capability.put_back(&mut ptb, package_id); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn delegate_controller_cap( - controller_cap: ObjectRef, - recipient: IotaAddress, - permissions: u32, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let cap = ptb - .obj(ObjectArg::ImmOrOwnedObject(controller_cap)) - .map_err(rebased_err)?; - let permissions = ptb.pure(permissions).map_err(rebased_err)?; - - let delegation_token = ptb.programmable_move_call( - package, - ident_str!("controller").into(), - ident_str!("delegate_with_permissions").into(), - vec![], - vec![cap, permissions], - ); - - ptb.transfer_arg(recipient, delegation_token); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn revoke_delegation_token( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - delegation_token_id: ObjectID, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let cap = ptb - .obj(ObjectArg::ImmOrOwnedObject(controller_cap)) - .map_err(rebased_err)?; - let delegation_token_id = ptb.pure(delegation_token_id).map_err(rebased_err)?; - - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("revoke_token").into(), - vec![], - vec![identity, cap, delegation_token_id], - ); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn unrevoke_delegation_token( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - delegation_token_id: ObjectID, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let cap = ptb - .obj(ObjectArg::ImmOrOwnedObject(controller_cap)) - .map_err(rebased_err)?; - let delegation_token_id = ptb.pure(delegation_token_id).map_err(rebased_err)?; - - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("unrevoke_token").into(), - vec![], - vec![identity, cap, delegation_token_id], - ); - - Ok(bcs::to_bytes(&ptb.finish())?) - } - - async fn destroy_delegation_token( - identity: OwnedObjectRef, - delegation_token: ObjectRef, - package: ObjectID, - ) -> Result { - let mut ptb = PrgrTxBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let delegation_token = ptb - .obj(ObjectArg::ImmOrOwnedObject(delegation_token)) - .map_err(rebased_err)?; - - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("destroy_delegation_token").into(), - vec![], - vec![identity, delegation_token], - ); - - Ok(bcs::to_bytes(&ptb.finish())?) - } -} diff --git a/identity_iota_core/src/iota_interaction_rust/iota_client_rust_sdk.rs b/identity_iota_core/src/iota_interaction_rust/iota_client_rust_sdk.rs deleted file mode 100644 index 210c53097f..0000000000 --- a/identity_iota_core/src/iota_interaction_rust/iota_client_rust_sdk.rs +++ /dev/null @@ -1,537 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use async_trait::async_trait; -use std::boxed::Box; -use std::marker::Send; -use std::option::Option; -use std::result::Result; - -use secret_storage::Signer; - -use crate::rebased::Error; -use identity_iota_interaction::apis::CoinReadApi; -use identity_iota_interaction::apis::EventApi; -use identity_iota_interaction::apis::QuorumDriverApi; -use identity_iota_interaction::apis::ReadApi; -use identity_iota_interaction::error::IotaRpcResult; -use identity_iota_interaction::rpc_types::Coin; -use identity_iota_interaction::rpc_types::CoinPage; -use identity_iota_interaction::rpc_types::EventFilter; -use identity_iota_interaction::rpc_types::EventPage; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaObjectResponse; -use identity_iota_interaction::rpc_types::IotaObjectResponseQuery; -use identity_iota_interaction::rpc_types::IotaPastObjectResponse; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsV1; -use identity_iota_interaction::rpc_types::IotaTransactionBlockResponse; -use identity_iota_interaction::rpc_types::IotaTransactionBlockResponseOptions; -use identity_iota_interaction::rpc_types::ObjectChange; -use identity_iota_interaction::rpc_types::ObjectsPage; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::crypto::Signature; -use identity_iota_interaction::types::digests::TransactionDigest; -use identity_iota_interaction::types::dynamic_field::DynamicFieldName; -use identity_iota_interaction::types::event::EventID; -use identity_iota_interaction::types::quorum_driver_types::ExecuteTransactionRequestType; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::transaction::Transaction; -use identity_iota_interaction::types::transaction::TransactionData; -use identity_iota_interaction::types::transaction::TransactionDataAPI as _; -use identity_iota_interaction::CoinReadTrait; -use identity_iota_interaction::EventTrait; -use identity_iota_interaction::IotaClient; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::IotaTransactionBlockResponseT; -use identity_iota_interaction::OptionalSync; -use identity_iota_interaction::QuorumDriverTrait; -use identity_iota_interaction::ReadTrait; - -/// The minimum balance required to execute a transaction. -pub(crate) const MINIMUM_BALANCE: u64 = 1_000_000_000; - -#[allow(unreachable_pub, dead_code)] -pub trait IotaTransactionBlockResponseAdaptedT: - IotaTransactionBlockResponseT -{ -} -impl IotaTransactionBlockResponseAdaptedT for T where - T: IotaTransactionBlockResponseT -{ -} -#[allow(unreachable_pub, dead_code)] -pub type IotaTransactionBlockResponseAdaptedTraitObj = - Box>; - -#[allow(unreachable_pub, dead_code)] -pub trait QuorumDriverApiAdaptedT: - QuorumDriverTrait -{ -} -impl QuorumDriverApiAdaptedT for T where - T: QuorumDriverTrait -{ -} -#[allow(unreachable_pub, dead_code)] -pub type QuorumDriverApiAdaptedTraitObj = - Box>; - -#[allow(unreachable_pub, dead_code)] -pub trait ReadApiAdaptedT: ReadTrait {} -impl ReadApiAdaptedT for T where T: ReadTrait {} -#[allow(unreachable_pub, dead_code)] -pub type ReadApiAdaptedTraitObj = Box>; - -#[allow(unreachable_pub, dead_code)] -pub trait CoinReadApiAdaptedT: CoinReadTrait {} -impl CoinReadApiAdaptedT for T where T: CoinReadTrait {} -#[allow(unreachable_pub, dead_code)] -pub type CoinReadApiAdaptedTraitObj = Box>; - -#[allow(unreachable_pub, dead_code)] -pub trait EventApiAdaptedT: EventTrait {} -impl EventApiAdaptedT for T where T: EventTrait {} -#[allow(unreachable_pub, dead_code)] -pub type EventApiAdaptedTraitObj = Box>; - -#[allow(unreachable_pub, dead_code)] -pub trait IotaClientAdaptedT: IotaClientTrait {} -impl IotaClientAdaptedT for T where T: IotaClientTrait {} -#[allow(unreachable_pub, dead_code)] -pub type IotaClientAdaptedTraitObj = - Box>; - -pub(crate) struct IotaTransactionBlockResponseProvider { - response: IotaTransactionBlockResponse, -} - -impl IotaTransactionBlockResponseProvider { - pub(crate) fn new(response: IotaTransactionBlockResponse) -> Self { - IotaTransactionBlockResponseProvider { response } - } -} - -impl IotaTransactionBlockResponseT for IotaTransactionBlockResponseProvider { - type Error = Error; - type NativeResponse = IotaTransactionBlockResponse; - - fn effects(&self) -> Option<&IotaTransactionBlockEffects> { - self.response.effects.as_ref() - } - - fn to_string(&self) -> String { - format!("{:?}", self.response) - } - - fn as_native_response(&self) -> &Self::NativeResponse { - &self.response - } - - fn as_mut_native_response(&mut self) -> &mut Self::NativeResponse { - &mut self.response - } - - fn clone_native_response(&self) -> Self::NativeResponse { - self.response.clone() - } - - fn digest(&self) -> Result { - Ok(self.response.digest) - } -} - -pub(crate) struct QuorumDriverAdapter<'a> { - api: &'a QuorumDriverApi, -} - -#[async_trait::async_trait()] -impl QuorumDriverTrait for QuorumDriverAdapter<'_> { - type Error = Error; - type NativeResponse = IotaTransactionBlockResponse; - - async fn execute_transaction_block( - &self, - tx_data: TransactionData, - signatures: Vec, - options: Option, - request_type: Option, - ) -> IotaRpcResult { - let tx = Transaction::from_data(tx_data, signatures); - let response = self - .api - .execute_transaction_block(tx, options.unwrap_or_default(), request_type) - .await?; - Ok(Box::new(IotaTransactionBlockResponseProvider::new(response))) - } -} - -pub(crate) struct ReadAdapter<'a> { - api: &'a ReadApi, -} - -#[async_trait::async_trait()] -impl ReadTrait for ReadAdapter<'_> { - type Error = Error; - type NativeResponse = IotaTransactionBlockResponse; - - async fn get_chain_identifier(&self) -> Result { - self - .api - .get_chain_identifier() - .await - .map_err(|e| Error::Network("SDK get_chain_identifier() call failed".to_string(), e)) - } - - async fn get_dynamic_field_object( - &self, - parent_object_id: ObjectID, - name: DynamicFieldName, - ) -> IotaRpcResult { - self.api.get_dynamic_field_object(parent_object_id, name).await - } - - async fn get_object_with_options( - &self, - object_id: ObjectID, - options: IotaObjectDataOptions, - ) -> IotaRpcResult { - self.api.get_object_with_options(object_id, options).await - } - - async fn get_owned_objects( - &self, - address: IotaAddress, - query: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult { - self.api.get_owned_objects(address, query, cursor, limit).await - } - - async fn get_reference_gas_price(&self) -> IotaRpcResult { - self.api.get_reference_gas_price().await - } - - async fn get_transaction_with_options( - &self, - digest: TransactionDigest, - options: IotaTransactionBlockResponseOptions, - ) -> IotaRpcResult { - let response = self.api.get_transaction_with_options(digest, options).await?; - Ok(Box::new(IotaTransactionBlockResponseProvider::new(response))) - } - - async fn try_get_parsed_past_object( - &self, - object_id: ObjectID, - version: SequenceNumber, - options: IotaObjectDataOptions, - ) -> IotaRpcResult { - self.api.try_get_parsed_past_object(object_id, version, options).await - } -} - -pub(crate) struct CoinReadAdapter<'a> { - api: &'a CoinReadApi, -} - -#[async_trait::async_trait()] -impl CoinReadTrait for CoinReadAdapter<'_> { - type Error = Error; - - async fn get_coins( - &self, - owner: IotaAddress, - coin_type: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult { - self.api.get_coins(owner, coin_type, cursor, limit).await - } -} - -pub(crate) struct EventAdapter<'a> { - api: &'a EventApi, -} - -#[async_trait::async_trait()] -impl EventTrait for EventAdapter<'_> { - type Error = Error; - - async fn query_events( - &self, - query: EventFilter, - cursor: Option, - limit: Option, - descending_order: bool, - ) -> IotaRpcResult { - self.api.query_events(query, cursor, limit, descending_order).await - } -} - -/// Wraps the IotaClient to implement the IotaClientTrait. -#[derive(Clone)] -pub struct IotaClientRustSdk { - iota_client: IotaClient, -} - -#[async_trait] -impl IotaClientTrait for IotaClientRustSdk { - type Error = Error; - type NativeResponse = IotaTransactionBlockResponse; - - fn quorum_driver_api( - &self, - ) -> Box + Send + '_> { - Box::new(QuorumDriverAdapter { - api: self.iota_client.quorum_driver_api(), - }) - } - - fn read_api(&self) -> Box + Send + '_> { - Box::new(ReadAdapter { - api: self.iota_client.read_api(), - }) - } - - fn coin_read_api(&self) -> Box + Send + '_> { - Box::new(CoinReadAdapter { - api: self.iota_client.coin_read_api(), - }) - } - - fn event_api(&self) -> Box + Send + '_> { - Box::new(EventAdapter { - api: self.iota_client.event_api(), - }) - } - - async fn execute_transaction( - &self, - tx_data: TransactionData, - signer: &S, - ) -> Result - where - S: Signer + OptionalSync, - { - let response = self.sdk_execute_transaction(tx_data, signer).await?; - Ok(Box::new(IotaTransactionBlockResponseProvider::new(response))) - } - - async fn default_gas_budget(&self, sender_address: IotaAddress, tx: &ProgrammableTransaction) -> Result { - self.sdk_default_gas_budget(sender_address, tx).await - } - - async fn get_previous_version(&self, iod: IotaObjectData) -> Result, Error> { - // try to get digest of previous tx - // if we requested the prev tx and it isn't returned, this should be the oldest state - let prev_tx_digest = if let Some(value) = iod.previous_transaction { - value - } else { - return Ok(None); - }; - - // resolve previous tx - let prev_tx_response = self - .iota_client - .read_api() - .get_transaction_with_options( - prev_tx_digest, - IotaTransactionBlockResponseOptions::new().with_object_changes(), - ) - .await - .map_err(|err| { - Error::InvalidIdentityHistory(format!("could not get previous transaction {prev_tx_digest}; {err}")) - })?; - - // check for updated/created changes - let (created, other_changes): (Vec, _) = prev_tx_response - .clone() - .object_changes - .ok_or_else(|| { - Error::InvalidIdentityHistory(format!( - "could not find object changes for object {} in transaction {prev_tx_digest}", - iod.object_id - )) - })? - .into_iter() - .filter(|elem| iod.object_id.eq(&elem.object_id())) - .partition(|elem| matches!(elem, ObjectChange::Created { .. })); - - // previous tx contain create tx, so there is no previous version - if created.len() == 1 { - return Ok(None); - } - - let mut previous_versions: Vec = other_changes - .iter() - .filter_map(|elem| match elem { - ObjectChange::Mutated { previous_version, .. } => Some(*previous_version), - _ => None, - }) - .collect(); - - previous_versions.sort(); - - let earliest_previous = if let Some(value) = previous_versions.first() { - value - } else { - return Ok(None); // no mutations in prev tx, so no more versions can be found - }; - - let past_obj_response = self.get_past_object(iod.object_id, *earliest_previous).await?; - match past_obj_response { - IotaPastObjectResponse::VersionFound(value) => Ok(Some(value)), - _ => Err(Error::InvalidIdentityHistory(format!( - "could not find previous version, past object response: {past_obj_response:?}" - ))), - } - } - - async fn get_past_object( - &self, - object_id: ObjectID, - version: SequenceNumber, - ) -> Result { - self - .iota_client - .read_api() - .try_get_parsed_past_object(object_id, version, IotaObjectDataOptions::full_content()) - .await - .map_err(|err| { - Error::InvalidIdentityHistory(format!("could not look up object {object_id} version {version}; {err}")) - }) - } -} - -impl IotaClientRustSdk { - /// Creates a new IotaClientRustSdk instance. - pub fn new(iota_client: IotaClient) -> Self { - Self { iota_client } - } - - async fn sdk_execute_transaction>( - &self, - tx: TransactionData, - signer: &S, - ) -> Result { - let public_key = signer - .public_key() - .await - .map_err(|e| Error::TransactionSigningFailed(e.to_string()))?; - let sender_address = IotaAddress::from(&public_key); - - if sender_address != tx.sender() { - return Err(Error::TransactionSigningFailed(format!("transaction data needs to be signed by address {}, but client can only provide signature for address {sender_address}", tx.sender()))); - } - - let signature = signer - .sign(&tx) - .await - .map_err(|e| Error::TransactionSigningFailed(e.to_string()))?; - - // execute tx - let response = self - .iota_client - .quorum_driver_api() - .execute_transaction_block( - Transaction::from_data(tx, vec![signature]), - IotaTransactionBlockResponseOptions::full_content(), - Some(ExecuteTransactionRequestType::WaitForLocalExecution), - ) - .await - .map_err(Error::TransactionExecutionFailed)?; - - if let Some(IotaTransactionBlockEffects::V1(IotaTransactionBlockEffectsV1 { - status: IotaExecutionStatus::Failure { error }, - .. - })) = &response.effects - { - Err(Error::TransactionUnexpectedResponse(error.to_string())) - } else { - Ok(response) - } - } - - async fn sdk_default_gas_budget( - &self, - sender_address: IotaAddress, - tx: &ProgrammableTransaction, - ) -> Result { - let gas_price = self - .iota_client - .read_api() - .get_reference_gas_price() - .await - .map_err(|e| Error::RpcError(e.to_string()))?; - let gas_coin = self.get_coin_for_transaction(sender_address).await?; - let tx_data = TransactionData::new_programmable( - sender_address, - vec![gas_coin.object_ref()], - tx.clone(), - 50_000_000, - gas_price, - ); - let dry_run_gas_result = self - .iota_client - .read_api() - .dry_run_transaction_block(tx_data) - .await? - .effects; - if dry_run_gas_result.status().is_err() { - let IotaExecutionStatus::Failure { error } = dry_run_gas_result.into_status() else { - unreachable!(); - }; - return Err(Error::TransactionUnexpectedResponse(error)); - } - let gas_summary = dry_run_gas_result.gas_cost_summary(); - let overhead = gas_price * 1000; - let net_used = gas_summary.net_gas_usage(); - let computation = gas_summary.computation_cost; - - let budget = overhead + (net_used.max(0) as u64).max(computation); - Ok(budget) - } - - async fn get_coin_for_transaction(&self, sender_address: IotaAddress) -> Result { - const LIMIT: usize = 10; - let mut cursor = None; - - loop { - let coins = self - .iota_client - .coin_read_api() - .get_coins(sender_address, None, cursor, Some(LIMIT)) - .await?; - - let Some(coin) = coins.data.into_iter().max_by_key(|coin| coin.balance) else { - return Err(Error::GasIssue(format!( - "no coin found with minimum required balance of {} for address {}", - MINIMUM_BALANCE, sender_address - ))); - }; - - if coin.balance >= MINIMUM_BALANCE { - return Ok(coin); - } - - if !coins.has_next_page { - break; - } - - cursor = coins.next_cursor; - } - - Err(Error::GasIssue(format!( - "no coin found with minimum required balance of {} for address {}", - MINIMUM_BALANCE, sender_address - ))) - } -} diff --git a/identity_iota_core/src/iota_interaction_rust/migration_move_calls.rs b/identity_iota_core/src/iota_interaction_rust/migration_move_calls.rs deleted file mode 100644 index eaeb087cec..0000000000 --- a/identity_iota_core/src/iota_interaction_rust/migration_move_calls.rs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; - -use identity_iota_interaction::ident_str; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::IOTA_FRAMEWORK_PACKAGE_ID; -use identity_iota_interaction::MigrationMoveCalls; -use identity_iota_interaction::ProgrammableTransactionBcs; - -use crate::rebased::Error; - -use super::utils; - -pub(crate) struct MigrationMoveCallsRustSdk {} - -impl MigrationMoveCalls for MigrationMoveCallsRustSdk { - type Error = Error; - - fn migrate_did_output( - did_output: ObjectRef, - creation_timestamp: Option, - migration_registry: OwnedObjectRef, - package: ObjectID, - ) -> anyhow::Result { - let mut ptb = Ptb::new(); - let did_output = ptb.obj(ObjectArg::ImmOrOwnedObject(did_output))?; - let migration_registry = utils::owned_ref_to_shared_object_arg(migration_registry, &mut ptb, true)?; - let clock = utils::get_clock_ref(&mut ptb); - - let creation_timestamp = match creation_timestamp { - Some(timestamp) => ptb.pure(timestamp)?, - _ => ptb.programmable_move_call( - IOTA_FRAMEWORK_PACKAGE_ID, - ident_str!("clock").into(), - ident_str!("timestamp_ms").into(), - vec![], - vec![clock], - ), - }; - - ptb.programmable_move_call( - package, - ident_str!("migration").into(), - ident_str!("migrate_alias_output").into(), - vec![], - vec![did_output, migration_registry, creation_timestamp, clock], - ); - - Ok(bcs::to_bytes(&ptb.finish())?) - } -} diff --git a/identity_iota_core/src/iota_interaction_rust/mod.rs b/identity_iota_core/src/iota_interaction_rust/mod.rs deleted file mode 100644 index 1cebd00be3..0000000000 --- a/identity_iota_core/src/iota_interaction_rust/mod.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub(crate) mod asset_move_calls; -pub(crate) mod identity_move_calls; -pub(crate) mod iota_client_rust_sdk; -pub(crate) mod migration_move_calls; -pub(crate) mod transaction_builder; -mod utils; - -pub(crate) use asset_move_calls::AssetMoveCallsRustSdk as AssetMoveCallsAdapter; -pub(crate) use identity_move_calls::IdentityMoveCallsRustSdk as IdentityMoveCallsAdapter; -pub use iota_client_rust_sdk::IotaClientRustSdk as IotaClientAdapter; -pub(crate) use migration_move_calls::MigrationMoveCallsRustSdk as MigrationMoveCallsAdapter; -#[allow(unused_imports)] -pub(crate) use transaction_builder::TransactionBuilderRustSdk as TransactionBuilderAdapter; - -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::CoinReadApiAdaptedT; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::CoinReadApiAdaptedTraitObj; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::EventApiAdaptedT; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::EventApiAdaptedTraitObj; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::IotaClientAdaptedT; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::IotaClientAdaptedTraitObj; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::IotaTransactionBlockResponseAdaptedT; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::IotaTransactionBlockResponseAdaptedTraitObj; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::QuorumDriverApiAdaptedT; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::QuorumDriverApiAdaptedTraitObj; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::ReadApiAdaptedT; -#[allow(unused_imports)] -pub(crate) use iota_client_rust_sdk::ReadApiAdaptedTraitObj; diff --git a/identity_iota_core/src/iota_interaction_rust/transaction_builder.rs b/identity_iota_core/src/iota_interaction_rust/transaction_builder.rs deleted file mode 100644 index 9854e1893a..0000000000 --- a/identity_iota_core/src/iota_interaction_rust/transaction_builder.rs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::ops::Deref; -use std::ops::DerefMut; - -use crate::rebased::Error; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::ProgrammableTransactionBcs; -use identity_iota_interaction::TransactionBuilderT; - -#[derive(Default)] -pub(crate) struct TransactionBuilderRustSdk { - pub(crate) builder: ProgrammableTransactionBuilder, -} - -impl TransactionBuilderRustSdk { - pub(crate) fn new(builder: ProgrammableTransactionBuilder) -> Self { - TransactionBuilderRustSdk { builder } - } -} - -impl TransactionBuilderT for TransactionBuilderRustSdk { - type Error = Error; - type NativeTxBuilder = ProgrammableTransactionBuilder; - - fn finish(self) -> Result { - let tx = self.builder.finish(); - Ok(bcs::to_bytes(&tx)?) - } - - fn as_native_tx_builder(&mut self) -> &mut Self::NativeTxBuilder { - &mut self.builder - } - - fn into_native_tx_builder(self) -> Self::NativeTxBuilder { - self.builder - } -} - -impl Deref for TransactionBuilderRustSdk { - type Target = ProgrammableTransactionBuilder; - - fn deref(&self) -> &Self::Target { - &self.builder - } -} - -impl DerefMut for TransactionBuilderRustSdk { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.builder - } -} diff --git a/identity_iota_core/src/iota_interaction_rust/utils.rs b/identity_iota_core/src/iota_interaction_rust/utils.rs deleted file mode 100644 index 357d3647a3..0000000000 --- a/identity_iota_core/src/iota_interaction_rust/utils.rs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::rebased::Error; -use identity_iota_interaction::move_types::ident_str; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::STD_OPTION_MODULE_NAME; -use identity_iota_interaction::types::object::Owner; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::IOTA_CLOCK_OBJECT_ID; -use identity_iota_interaction::types::IOTA_CLOCK_OBJECT_SHARED_VERSION; -use identity_iota_interaction::types::MOVE_STDLIB_PACKAGE_ID; -use identity_iota_interaction::MoveType; -use serde::Serialize; - -/// Adds a reference to the on-chain clock to `ptb`'s arguments. -pub(crate) fn get_clock_ref(ptb: &mut Ptb) -> Argument { - ptb - .obj(ObjectArg::SharedObject { - id: IOTA_CLOCK_OBJECT_ID, - initial_shared_version: IOTA_CLOCK_OBJECT_SHARED_VERSION, - mutable: false, - }) - .expect("network has a singleton clock instantiated") -} - -pub(crate) fn get_controller_delegation( - ptb: &mut Ptb, - controller_cap: Argument, - package: ObjectID, -) -> (Argument, Argument) { - let Argument::Result(idx) = ptb.programmable_move_call( - package, - ident_str!("controller").into(), - ident_str!("borrow").into(), - vec![], - vec![controller_cap], - ) else { - unreachable!("making move calls always return a result variant"); - }; - - (Argument::NestedResult(idx, 0), Argument::NestedResult(idx, 1)) -} - -pub(crate) fn put_back_delegation_token( - ptb: &mut Ptb, - controller_cap: Argument, - delegation_token: Argument, - borrow: Argument, - package: ObjectID, -) { - ptb.programmable_move_call( - package, - ident_str!("controller").into(), - ident_str!("put_back").into(), - vec![], - vec![controller_cap, delegation_token, borrow], - ); -} - -pub(crate) fn owned_ref_to_shared_object_arg( - owned_ref: OwnedObjectRef, - ptb: &mut Ptb, - mutable: bool, -) -> anyhow::Result { - let Owner::Shared { initial_shared_version } = owned_ref.owner else { - anyhow::bail!("Identity \"{}\" is not a shared object", owned_ref.object_id()); - }; - ptb.obj(ObjectArg::SharedObject { - id: owned_ref.object_id(), - initial_shared_version, - mutable, - }) -} - -pub(crate) fn option_to_move( - option: Option, - ptb: &mut Ptb, - package: ObjectID, -) -> Result { - let arg = if let Some(t) = option { - let t = ptb.pure(t)?; - ptb.programmable_move_call( - MOVE_STDLIB_PACKAGE_ID, - STD_OPTION_MODULE_NAME.into(), - ident_str!("some").into(), - vec![T::move_type(package)], - vec![t], - ) - } else { - ptb.programmable_move_call( - MOVE_STDLIB_PACKAGE_ID, - STD_OPTION_MODULE_NAME.into(), - ident_str!("none").into(), - vec![T::move_type(package)], - vec![], - ) - }; - - Ok(arg) -} - -pub(crate) fn ptb_pure(ptb: &mut Ptb, name: &str, value: T) -> Result -where - T: Serialize + core::fmt::Debug, -{ - ptb.pure(&value).map_err(|err| { - Error::InvalidArgument(format!( - r"could not serialize pure value {name} with value {value:?}; {err}" - )) - }) -} - -#[allow(dead_code)] -pub(crate) fn ptb_obj(ptb: &mut Ptb, name: &str, value: ObjectArg) -> Result { - ptb - .obj(value) - .map_err(|err| Error::InvalidArgument(format!("could not serialize object {name} {value:?}; {err}"))) -} diff --git a/identity_iota_core/src/lib.rs b/identity_iota_core/src/lib.rs index 24d25e23a1..ed96253ce8 100644 --- a/identity_iota_core/src/lib.rs +++ b/identity_iota_core/src/lib.rs @@ -18,7 +18,6 @@ pub use did::IotaDID; #[cfg(feature = "iota-client")] pub use did_resolution::DidResolutionHandler; pub use document::*; -pub use network::NetworkName; pub use state_metadata::*; pub use self::error::Error; @@ -27,16 +26,13 @@ pub use self::error::Result; mod did; mod document; mod error; -mod network; mod state_metadata; #[cfg(feature = "iota-client")] mod did_resolution; #[cfg(feature = "iota-client")] mod iota_interaction_adapter; -#[cfg(all(feature = "iota-client", not(target_arch = "wasm32")))] -/// IOTA Rust SDK based implementation of the identity_iota_interaction interface for non wasm targets. -pub mod iota_interaction_rust; + #[cfg(feature = "iota-client")] /// Contains the rebased Identity and the interaction with the IOTA Client. pub mod rebased; diff --git a/identity_iota_core/src/network/mod.rs b/identity_iota_core/src/network/mod.rs deleted file mode 100644 index 2058f736d7..0000000000 --- a/identity_iota_core/src/network/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2020-2022 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -mod network_name; -pub use network_name::NetworkName; diff --git a/identity_iota_core/src/network/network_name.rs b/identity_iota_core/src/network/network_name.rs deleted file mode 100644 index 10ae03039d..0000000000 --- a/identity_iota_core/src/network/network_name.rs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020-2022 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use core::convert::TryFrom; -use core::fmt::Display; -use core::fmt::Formatter; -use core::ops::Deref; -use std::fmt::Debug; -use std::str::FromStr; - -use serde::Deserialize; -use serde::Serialize; - -use crate::error::Error; -use crate::error::Result; - -/// Network name compliant with the [`crate::IotaDID`] method specification. -#[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)] -#[repr(transparent)] -pub struct NetworkName(String); - -impl NetworkName { - /// The maximum length of a network name. - pub const MAX_LENGTH: usize = 8; - - /// Validates whether a string is a spec-compliant IOTA DID [`NetworkName`]. - pub fn validate_network_name(name: &str) -> Result<()> { - Some(()) - .filter(|_| { - !name.is_empty() - && (name.len() <= Self::MAX_LENGTH) - && name.chars().all(|ch| ch.is_ascii_lowercase() || ch.is_ascii_digit()) - }) - .ok_or_else(|| Error::InvalidNetworkName(name.to_owned())) - } -} - -impl AsRef for NetworkName { - fn as_ref(&self) -> &str { - self.0.as_ref() - } -} - -impl Deref for NetworkName { - type Target = str; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl TryFrom for NetworkName { - type Error = Error; - fn try_from(value: String) -> Result { - Self::validate_network_name(&value)?; - Ok(Self(value)) - } -} - -impl<'a> TryFrom<&'a str> for NetworkName { - type Error = Error; - fn try_from(value: &'a str) -> Result { - value.to_string().try_into() - } -} - -impl FromStr for NetworkName { - type Err = Error; - fn from_str(name: &str) -> Result { - Self::validate_network_name(name)?; - Ok(Self(name.to_string())) - } -} - -impl Debug for NetworkName { - fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { - f.write_str(self.as_ref()) - } -} - -impl Display for NetworkName { - fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { - f.write_str(self.as_ref()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - // Rules are: at least one character, at most eight characters and may only contain digits and/or lowercase ascii - // characters. - const VALID_NETWORK_NAMES: &[&str] = &[ - "main", "dev", "smr", "rms", "test", "foo", "foobar", "123456", "0", "foo42", "bar123", "42foo", "1234567", - "foobar0", - ]; - - const INVALID_NETWORK_NAMES: &[&str] = &["Main", "fOo", "deV", "féta", "", " ", "foo ", " foo"]; - - #[test] - fn valid_validate_network_name() { - for name in VALID_NETWORK_NAMES { - assert!(NetworkName::validate_network_name(name).is_ok()); - } - } - - #[test] - fn invalid_validate_network_name() { - for name in INVALID_NETWORK_NAMES { - assert!(NetworkName::validate_network_name(name).is_err()); - } - } -} diff --git a/identity_iota_core/src/rebased/assets/asset.rs b/identity_iota_core/src/rebased/assets/asset.rs index 0eda51d5d7..1ee9889489 100644 --- a/identity_iota_core/src/rebased/assets/asset.rs +++ b/identity_iota_core/src/rebased/assets/asset.rs @@ -3,36 +3,36 @@ use std::str::FromStr as _; -use crate::iota_interaction_adapter::AssetMoveCallsAdapter; - -use crate::rebased::client::CoreClientReadOnly; use crate::rebased::client::IdentityClientReadOnly; -use crate::rebased::transaction_builder::Transaction; -use crate::rebased::transaction_builder::TransactionBuilder; +use crate::rebased::iota::move_calls; + use crate::rebased::Error; use anyhow::anyhow; use anyhow::Context; use async_trait::async_trait; -use identity_iota_interaction::ident_str; -use identity_iota_interaction::move_types::language_storage::StructTag; -use identity_iota_interaction::rpc_types::IotaData as _; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::id::UID; -use identity_iota_interaction::types::object::Owner; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::AssetMoveCalls; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::IotaTransactionBlockEffectsMutAPI as _; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::OptionalSync; + +use iota_interaction::ident_str; +use iota_interaction::move_types::language_storage::StructTag; +use iota_interaction::rpc_types::IotaData as _; +use iota_interaction::rpc_types::IotaExecutionStatus; +use iota_interaction::rpc_types::IotaObjectDataOptions; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectRef; +use iota_interaction::types::base_types::SequenceNumber; +use iota_interaction::types::id::UID; +use iota_interaction::types::object::Owner; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::types::TypeTag; +use iota_interaction::IotaClientTrait; +use iota_interaction::IotaTransactionBlockEffectsMutAPI as _; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; use serde::de::DeserializeOwned; use serde::Deserialize; use serde::Deserializer; @@ -416,7 +416,7 @@ impl<'a, T: MoveType + Send + Sync> UpdateContent<'a, T> { } async fn make_ptb(&self, client: &impl CoreClientReadOnly) -> Result { - let tx_bcs = AssetMoveCallsAdapter::update(self.asset.object_ref(client).await?, &self.new_content, self.package)?; + let tx_bcs = move_calls::asset::update(self.asset.object_ref(client).await?, &self.new_content, self.package)?; Ok(bcs::from_bytes(&tx_bcs)?) } @@ -429,23 +429,20 @@ where T: MoveType + Send + Sync, { type Output = (); + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } if let Some(asset_pos) = effects @@ -459,7 +456,7 @@ where self.asset.inner = self.new_content; } - (Ok(()), effects) + Ok(()) } } @@ -483,7 +480,7 @@ impl DeleteAsset { async fn make_ptb(&self, client: &impl CoreClientReadOnly) -> Result { let asset_ref = self.asset.object_ref(client).await?; - let tx_bcs = AssetMoveCallsAdapter::delete::(asset_ref, self.package)?; + let tx_bcs = move_calls::asset::delete::(asset_ref, self.package)?; Ok(bcs::from_bytes(&tx_bcs)?) } @@ -496,23 +493,20 @@ where T: MoveType + Send + Sync, { type Output = (); + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } if let Some(asset_pos) = effects @@ -522,15 +516,12 @@ where .find_map(|(i, obj)| (obj.object_id == self.asset.id()).then_some(i)) { effects.deleted_mut().swap_remove(asset_pos); - (Ok(()), effects) + Ok(()) } else { - ( - Err(Error::TransactionUnexpectedResponse(format!( - "cannot find asset {} in the list of delete objects", - self.asset.id() - ))), - effects, - ) + Err(Error::TransactionUnexpectedResponse(format!( + "cannot find asset {} in the list of delete objects", + self.asset.id() + ))) } } } @@ -559,7 +550,7 @@ impl CreateAsset { transferable, deletable, } = self.builder; - let pt_bcs = AssetMoveCallsAdapter::new_asset(inner, mutable, transferable, deletable, self.package)?; + let pt_bcs = move_calls::asset::new_asset(inner, mutable, transferable, deletable, self.package)?; Ok(bcs::from_bytes(&pt_bcs)?) } } @@ -571,24 +562,21 @@ where T: MoveType + DeserializeOwned + PartialEq + Send + Sync, { type Output = AuthenticatedAsset; + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } let created_objects = effects @@ -619,17 +607,14 @@ where } let (Some(pos), Some(asset)) = (target_asset_pos, target_asset) else { - return ( - Err(Error::TransactionUnexpectedResponse( - "failed to find the asset created by this operation in transaction's effects".to_owned(), - )), - effects, - ); + return Err(Error::TransactionUnexpectedResponse( + "failed to find the asset created by this operation in transaction's effects".to_owned(), + )); }; effects.created_mut().swap_remove(pos); - (Ok(asset), effects) + Ok(asset) } } @@ -654,7 +639,7 @@ impl TransferAsset { } async fn make_ptb(&self, client: &impl CoreClientReadOnly) -> Result { - let bcs = AssetMoveCallsAdapter::transfer::(self.asset.object_ref(client).await?, self.recipient, self.package)?; + let bcs = move_calls::asset::transfer::(self.asset.object_ref(client).await?, self.recipient, self.package)?; Ok(bcs::from_bytes(&bcs)?) } @@ -667,23 +652,20 @@ where T: MoveType + Send + Sync, { type Output = TransferProposal; + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } let created_objects = effects @@ -711,17 +693,14 @@ where } let (Some(pos), Some(proposal)) = (target_proposal_pos, target_proposal) else { - return ( - Err(Error::TransactionUnexpectedResponse( - "failed to find the TransferProposal created by this operation in transaction's effects".to_owned(), - )), - effects, - ); + return Err(Error::TransactionUnexpectedResponse( + "failed to find the TransferProposal created by this operation in transaction's effects".to_owned(), + )); }; effects.created_mut().swap_remove(pos); - (Ok(proposal), effects) + Ok(proposal) } } @@ -764,7 +743,7 @@ impl AcceptTransfer { .initial_shared_version(client) .await .map_err(|e| Error::ObjectLookup(e.to_string()))?; - let bcs = AssetMoveCallsAdapter::accept_proposal( + let bcs = move_calls::asset::accept_proposal( (self.proposal.id(), initial_shared_version), cap, asset_ref, @@ -780,24 +759,21 @@ impl AcceptTransfer { #[cfg_attr(feature = "send-sync", async_trait)] impl Transaction for AcceptTransfer { type Output = (); + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } if let Some(i) = effects @@ -808,16 +784,13 @@ impl Transaction for AcceptTransfer { .find_map(|(i, obj)| (obj.object_id == self.proposal.recipient_cap_id).then_some(i)) { effects.deleted_mut().swap_remove(i); - (Ok(()), effects) + Ok(()) } else { - ( - Err(Error::TransactionUnexpectedResponse(format!( - "transfer of asset {} through proposal {} wasn't successful", - self.proposal.asset_id, - self.proposal.id.object_id() - ))), - effects, - ) + Err(Error::TransactionUnexpectedResponse(format!( + "transfer of asset {} through proposal {} wasn't successful", + self.proposal.asset_id, + self.proposal.id.object_id() + ))) } } } @@ -856,7 +829,7 @@ impl ConcludeTransfer { .await .map_err(|e| Error::ObjectLookup(e.to_string()))?; - let tx_bcs = AssetMoveCallsAdapter::conclude_or_cancel( + let tx_bcs = move_calls::asset::conclude_or_cancel( (self.proposal.id(), initial_shared_version), cap, asset_ref, @@ -872,24 +845,21 @@ impl ConcludeTransfer { #[cfg_attr(feature = "send-sync", async_trait)] impl Transaction for ConcludeTransfer { type Output = (); + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } let mut idx_to_remove = effects @@ -902,13 +872,10 @@ impl Transaction for ConcludeTransfer { .collect::>(); if idx_to_remove.len() < 2 { - return ( - Err(Error::TransactionUnexpectedResponse(format!( - "conclusion or canceling of proposal {} wasn't successful", - self.proposal.id.object_id() - ))), - effects, - ); + return Err(Error::TransactionUnexpectedResponse(format!( + "conclusion or canceling of proposal {} wasn't successful", + self.proposal.id.object_id() + ))); } // Ordering the list of indexis to remove is important to avoid invalidating the positions @@ -919,6 +886,6 @@ impl Transaction for ConcludeTransfer { effects.deleted_mut().swap_remove(i); } - (Ok(()), effects) + Ok(()) } } diff --git a/identity_iota_core/src/rebased/assets/public_available_vc.rs b/identity_iota_core/src/rebased/assets/public_available_vc.rs index 7ade0ec9b6..876d823d78 100644 --- a/identity_iota_core/src/rebased/assets/public_available_vc.rs +++ b/identity_iota_core/src/rebased/assets/public_available_vc.rs @@ -7,16 +7,16 @@ use anyhow::Context as _; use identity_credential::credential::Credential; use identity_credential::credential::Jwt; use identity_credential::credential::JwtCredential; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::IotaVerifiableCredential; -use identity_iota_interaction::OptionalSync; use identity_jose::jwt::JwtHeader; use identity_jose::jwu; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::IotaKeySignature; +use iota_interaction::IotaVerifiableCredential; +use iota_interaction::OptionalSync; use itertools::Itertools; +use product_core::core_client::CoreClientReadOnly; use secret_storage::Signer; -use crate::rebased::client::CoreClientReadOnly; use crate::rebased::client::IdentityClient; use crate::rebased::client::IdentityClientReadOnly; diff --git a/identity_iota_core/src/rebased/client/full_client.rs b/identity_iota_core/src/rebased/client/full_client.rs index 5596b4f6de..3b5b94bc95 100644 --- a/identity_iota_core/src/rebased/client/full_client.rs +++ b/identity_iota_core/src/rebased/client/full_client.rs @@ -3,46 +3,45 @@ use std::ops::Deref; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; use crate::iota_interaction_adapter::IotaClientAdapter; +use crate::rebased::iota::move_calls; use crate::rebased::iota::package::identity_package_id; use crate::rebased::migration::CreateIdentity; -use crate::rebased::transaction_builder::Transaction; -use crate::rebased::transaction_builder::TransactionBuilder; use crate::IotaDID; use crate::IotaDocument; -use crate::NetworkName; use crate::StateMetadataDocument; use crate::StateMetadataEncoding; use async_trait::async_trait; -use identity_iota_interaction::move_types::language_storage::StructTag; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::IotaObjectDataFilter; -use identity_iota_interaction::rpc_types::IotaObjectResponseQuery; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::crypto::PublicKey; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::IdentityMoveCalls as _; use identity_verification::jwk::Jwk; +use iota_interaction::move_types::language_storage::StructTag; +use iota_interaction::rpc_types::IotaObjectData; +use iota_interaction::rpc_types::IotaObjectDataFilter; +use iota_interaction::rpc_types::IotaObjectResponseQuery; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectRef; +use iota_interaction::types::crypto::PublicKey; +use iota_interaction::types::transaction::ProgrammableTransaction; +use product_core::core_client::CoreClient; +use product_core::core_client::CoreClientReadOnly; +use product_core::network_name::NetworkName; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; use secret_storage::Signer; use serde::de::DeserializeOwned; use tokio::sync::OnceCell; +use super::get_object_id_from_did; use crate::rebased::assets::AuthenticatedAssetBuilder; use crate::rebased::migration::Identity; use crate::rebased::migration::IdentityBuilder; use crate::rebased::Error; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::OptionalSync; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::IotaClientTrait; +use iota_interaction::IotaKeySignature; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; -use super::get_object_id_from_did; -use super::CoreClient; -use super::CoreClientReadOnly; use super::IdentityClientReadOnly; /// Mirrored types from identity_storage::KeyId @@ -162,7 +161,8 @@ where .await? .with_gas_budget(gas_budget) .build_and_execute(self) - .await?; + .await + .map_err(|e| Error::TransactionUnexpectedResponse(e.to_string()))?; Ok(document) } @@ -189,7 +189,8 @@ where .await? .with_gas_budget(gas_budget) .build_and_execute(self) - .await?; + .await + .map_err(|e| Error::TransactionUnexpectedResponse(e.to_string()))?; Ok(()) } @@ -296,8 +297,9 @@ impl PublishDidDocument { let did_doc = StateMetadataDocument::from(self.did_document.clone()) .pack(StateMetadataEncoding::Json) .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; + let programmable_tx_bcs = - IdentityMoveCallsAdapter::new_with_controllers(Some(&did_doc), [(self.controller, 1, false)], 1, package).await?; + move_calls::identity::new_with_controllers(Some(&did_doc), [(self.controller, 1, false)], 1, package).await?; Ok(bcs::from_bytes(&programmable_tx_bcs)?) } } @@ -306,19 +308,16 @@ impl PublishDidDocument { #[cfg_attr(feature = "send-sync", async_trait)] impl Transaction for PublishDidDocument { type Output = IotaDocument; + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { @@ -329,7 +328,6 @@ impl Transaction for PublishDidDocument { CreateIdentity::new(builder) }; - let (application_result, remaining_effects) = tx.apply(effects, client).await; - (application_result.map(IotaDocument::from), remaining_effects) + tx.apply(effects, client).await.map(IotaDocument::from) } } diff --git a/identity_iota_core/src/rebased/client/mod.rs b/identity_iota_core/src/rebased/client/mod.rs index 38bc901d07..f2040ac3a2 100644 --- a/identity_iota_core/src/rebased/client/mod.rs +++ b/identity_iota_core/src/rebased/client/mod.rs @@ -4,261 +4,8 @@ mod full_client; mod read_only; -use anyhow::anyhow; -use anyhow::Context; pub use full_client::*; -use identity_iota_interaction::move_types::language_storage::StructTag; -use identity_iota_interaction::rpc_types::IotaData; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::IotaObjectDataFilter; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaObjectResponseQuery; -use identity_iota_interaction::rpc_types::IotaParsedData; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::crypto::PublicKey; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::OptionalSync; -pub use read_only::*; - -pub use identity_iota_interaction::IotaKeySignature; -use secret_storage::Signer; -use serde::de::DeserializeOwned; - -use crate::iota_interaction_adapter::IotaClientAdapter; -use crate::NetworkName; -use async_trait::async_trait; - -#[cfg_attr(not(feature = "send-sync"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync", async_trait)] -/// A trait that defines the core read-only operations for core clients. -pub trait CoreClientReadOnly { - /// Returns the package ID associated with the Client. - /// - /// The package ID uniquely identifies the deployed Contract on the - /// IOTA network. - fn package_id(&self) -> ObjectID; - - /// Returns the name of the network the client is connected to. - /// - /// This is typically a human-readable alias or identifier for the IOTA network. - fn network_name(&self) -> &NetworkName; - - /// Returns the underlying [`IotaClientAdapter`] used by this client. - /// - /// This allows access to lower-level client operations if needed. - fn client_adapter(&self) -> &IotaClientAdapter; - - /// Retrieves a _Move_ Object by its ID. - /// - /// This function parses the object ID and returns the corresponding object - /// - /// # Arguments - /// - /// * `object_id` - The unique identifier of the object to retrieve. - /// - /// # Returns - /// - /// Returns `Ok(Some(T))` if the object is found, `Ok(None)` if not found, - /// or an error if the operation fails. - async fn get_object_by_id(&self, object_id: ObjectID) -> anyhow::Result { - self - .client_adapter() - .read_api() - .get_object_with_options(object_id, IotaObjectDataOptions::new().with_content()) - .await - .context("lookup request failed") - .and_then(|res| res.data.context("missing data in response")) - .and_then(|data| data.content.context("missing object content in data")) - .and_then(|content| content.try_into_move().context("not a move object")) - .and_then(|obj| { - serde_json::from_value(obj.fields.to_json_value()) - .map_err(|err| anyhow!("failed to deserialize move object; {err}")) - }) - .context("failed to get object by id") - } - - /// Retrieves an object's [`OwnedObjectRef`], if any. - /// - /// # Arguments - /// - /// * `object_id` - The unique identifier of the object to retrieve. - /// - /// # Returns - /// - /// Returns `Ok(Some(OwnedObjectRef))` if the object is found, `Ok(None)` if not found, - /// or an error if the operation fails. - async fn get_object_ref_by_id(&self, object_id: ObjectID) -> anyhow::Result> { - self - .client_adapter() - .read_api() - .get_object_with_options(object_id, IotaObjectDataOptions::default().with_owner()) - .await - .map(|response| { - response.data.map(|obj_data| OwnedObjectRef { - owner: obj_data.owner.expect("requested data"), - reference: obj_data.object_ref().into(), - }) - }) - .context("failed to get object ref by id") - } - - /// Retrieves an object owned by the specified address that matches the given predicate. - /// - /// # Arguments - /// - /// * `address` - The address of the owner of the object. - /// * `predicate` - A closure that takes a reference to the object and returns a boolean indicating whether the object - /// matches the desired criteria. - /// - /// # Returns - /// - /// Returns `Ok(Some(T))` if the object is found, `Ok(None)` if not found, - async fn find_object_for_address(&self, address: IotaAddress, predicate: P) -> anyhow::Result> - where - T: MoveType + DeserializeOwned, - P: Fn(&T) -> bool + Send, - { - let tag = T::move_type(self.package_id()) - .to_string() - .parse() - .expect("type tag is a valid struct tag"); - let filter = IotaObjectResponseQuery::new( - Some(IotaObjectDataFilter::StructType(tag)), - Some(IotaObjectDataOptions::default().with_content()), - ); - let mut cursor = None; - loop { - let mut page = self - .client_adapter() - .read_api() - .get_owned_objects(address, Some(filter.clone()), cursor, Some(25)) - .await?; - let maybe_obj = std::mem::take(&mut page.data) - .into_iter() - .filter_map(|res| res.data) - .filter_map(|data| data.content) - .filter_map(|obj_data| { - let IotaParsedData::MoveObject(move_object) = obj_data else { - unreachable!() - }; - serde_json::from_value(move_object.fields.to_json_value()).ok() - }) - .find(&predicate); - cursor = page.next_cursor; - - if maybe_obj.is_some() { - return Ok(maybe_obj); - } - if !page.has_next_page { - break; - } - } - - Ok(None) - } - /// Retrieves coins owned by the specified address with a balance of at least `balance`. - /// - /// # Arguments - /// - /// * `owner` - The address of the owner of the coins. - /// * `balance` - The minimum balance required for the coins. - /// - /// # Returns - /// - /// Returns `Ok(Vec)` if the coins are found, or an error if the operation fails. - async fn get_iota_coins_with_at_least_balance( - &self, - owner: IotaAddress, - balance: u64, - ) -> anyhow::Result> { - let mut coins = self - .client_adapter() - .coin_read_api() - .get_coins(owner, Some(String::from("0x2::iota::IOTA")), None, None) - .await? - .data; - coins.sort_unstable_by_key(|coin| coin.balance); - - let mut needed_coins = vec![]; - let mut needed_coins_balance = 0; - while let Some(coin) = coins.pop() { - needed_coins_balance += coin.balance; - needed_coins.push(coin.object_ref()); - - if needed_coins_balance >= balance { - return Ok(needed_coins); - } - } - - anyhow::bail!("address {owner} does not have enough coins to form a balance of {balance}"); - } - - /// Retrieves an object owned by the specified address that matches the given predicate and tag. - /// - /// # Arguments - /// - /// * `address` - The address of the owner of the object. - /// * `tag` - The tag of the object to retrieve. - /// * `predicate` - A closure that takes a reference to the object and returns a boolean indicating whether the object - /// matches the desired criteria. - /// - /// # Returns - /// - /// - /// Returns `Ok(Some(ObjectRef))` if the object is found, `Ok(None)` if not found, - /// or an error if the operation fails. - async fn find_owned_ref_for_address

( - &self, - address: IotaAddress, - tag: StructTag, - predicate: P, - ) -> Result, anyhow::Error> - where - P: Fn(&IotaObjectData) -> bool + Send, - { - let filter = IotaObjectResponseQuery::new_with_filter(IotaObjectDataFilter::StructType(tag)); - - let mut cursor = None; - loop { - let mut page = self - .client_adapter() - .read_api() - .get_owned_objects(address, Some(filter.clone()), cursor, None) - .await?; - let obj_ref = std::mem::take(&mut page.data) - .into_iter() - .filter_map(|res| res.data) - .find(|obj| predicate(obj)) - .map(|obj_data| obj_data.object_ref()); - cursor = page.next_cursor; - - if obj_ref.is_some() { - return Ok(obj_ref); - } - if !page.has_next_page { - break; - } - } - - Ok(None) - } -} - -#[cfg_attr(not(feature = "send-sync"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync", async_trait)] -/// A trait that defines the core read-write operations for core clients. -pub trait CoreClient + OptionalSync>: CoreClientReadOnly { - /// Returns the signer of the client. - fn signer(&self) -> &S; - - /// Returns this Client's sender address - fn sender_address(&self) -> IotaAddress; +pub use read_only::*; - /// Returns the bytes of the sender's public key. - fn sender_public_key(&self) -> &PublicKey; -} +pub use iota_interaction::IotaKeySignature; diff --git a/identity_iota_core/src/rebased/client/read_only.rs b/identity_iota_core/src/rebased/client/read_only.rs index 72301009e9..c74e75347c 100644 --- a/identity_iota_core/src/rebased/client/read_only.rs +++ b/identity_iota_core/src/rebased/client/read_only.rs @@ -9,14 +9,17 @@ use std::str::FromStr; use crate::rebased::iota; use crate::rebased::iota::package::Env; use crate::rebased::iota::package::Metadata; -use crate::rebased::iota::package::PackageRegistry; + use crate::rebased::iota::package::MAINNET_CHAIN_ID; use crate::IotaDID; use crate::IotaDocument; -use crate::NetworkName; use futures::stream::FuturesUnordered; -use identity_iota_interaction::IotaClientTrait; + +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::IotaClientTrait; +use product_core::core_client::CoreClientReadOnly; +use product_core::network_name::NetworkName; use crate::iota_interaction_adapter::IotaClientAdapter; use crate::rebased::migration::get_alias; @@ -28,16 +31,12 @@ use futures::StreamExt as _; use identity_core::common::Url; use identity_did::DID; -use identity_iota_interaction::types::base_types::ObjectID; - #[cfg(not(target_arch = "wasm32"))] -use identity_iota_interaction::IotaClient; +use iota_interaction::IotaClient; #[cfg(target_arch = "wasm32")] use iota_interaction_ts::bindings::WasmIotaClient; -use super::CoreClientReadOnly; - /// An [`IotaClient`] enriched with identity-related /// functionalities. #[derive(Clone)] @@ -144,26 +143,6 @@ impl IdentityClientReadOnly { Self::new_internal(client, network).await } - /// Attempts to create a new [`IdentityClientReadOnly`] from the given IOTA client - /// and IotaIdentity package's Move.lock file. - pub async fn new_with_move_lock( - #[cfg(target_arch = "wasm32")] iota_client: WasmIotaClient, - #[cfg(not(target_arch = "wasm32"))] iota_client: IotaClient, - move_lock: &str, - ) -> Result { - let client = IotaClientAdapter::new(iota_client); - let network = network_id(&client).await?; - - let custom_registry = PackageRegistry::from_move_lock_content(move_lock)?; - // Update the package's registry with the information coming from the given Move.lock. - { - let mut registry = iota::package::identity_package_registry_mut().await; - registry.join(custom_registry); - } - - Self::new_internal(client, network).await - } - /// Sets the migration registry ID for the current network. /// # Notes /// This is only needed when automatic retrival of MigrationRegistry's ID fails. diff --git a/identity_iota_core/src/rebased/error.rs b/identity_iota_core/src/rebased/error.rs index e3a7175a29..c35dbde198 100644 --- a/identity_iota_core/src/rebased/error.rs +++ b/identity_iota_core/src/rebased/error.rs @@ -3,8 +3,7 @@ //! Errors that may occur for the rebased logic. -#[cfg(target_arch = "wasm32")] -use iota_interaction_ts::error::TsSdkError; +use crate::iota_interaction_adapter::AdapterError; /// This type represents all possible errors that can occur in the library. #[derive(Debug, thiserror::Error, strum::IntoStaticStr)] @@ -12,7 +11,7 @@ use iota_interaction_ts::error::TsSdkError; pub enum Error { /// failed to connect to network. #[error("failed to connect to iota network node; {0:?}")] - Network(String, #[source] identity_iota_interaction::error::Error), + Network(String, #[source] iota_interaction::error::Error), /// could not lookup an object ID. #[error("failed to lookup an object; {0}")] ObjectLookup(String), @@ -42,7 +41,7 @@ pub enum Error { TransactionSigningFailed(String), /// Could not execute transaction. #[error("transaction execution failed; {0}")] - TransactionExecutionFailed(#[from] identity_iota_interaction::error::Error), + TransactionExecutionFailed(#[from] iota_interaction::error::Error), /// Transaction yielded invalid response. This usually means that the transaction was executed but did not produce /// the expected result. #[error("transaction returned an unexpected response; {0}")] @@ -56,7 +55,7 @@ pub enum Error { /// The raw RPC response, as received by the client. // Dev-comment: Neeeded to box this to avoid clippy complaining about the size of this variant. #[cfg(not(target_arch = "wasm32"))] - response: Box, + response: Box, /// JSON-encoded string representation for the actual execution's RPC response. #[cfg(target_arch = "wasm32")] response: String, @@ -91,10 +90,12 @@ pub enum Error { /// An error caused by a foreign function interface call. #[error("FFI error: {0}")] FfiError(String), - #[cfg(target_arch = "wasm32")] - /// An error originating from IOTA typescript SDK import bindings + /// Caused by an interaction with the IOTA protocol. + #[error("IOTA interaction error")] + IotaInteractionError(#[source] iota_interaction::interaction_error::Error), + /// Caused by a platform-specific adapter to interact with the IOTA protocol. #[error("TsSdkError: {0}")] - TsSdkError(#[from] TsSdkError), + IotaInteractionAdapterError(#[from] AdapterError), } /// Can be used for example like `map_err(rebased_err)` to convert other error diff --git a/identity_iota_core/src/rebased/iota/mod.rs b/identity_iota_core/src/rebased/iota/mod.rs index ccf46423c4..6a471c9b44 100644 --- a/identity_iota_core/src/rebased/iota/mod.rs +++ b/identity_iota_core/src/rebased/iota/mod.rs @@ -1,5 +1,6 @@ // Copyright 2020-2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +pub(crate) mod move_calls; pub(crate) mod package; pub(crate) mod types; diff --git a/identity_iota_core/src/rebased/iota/move_calls/asset.rs b/identity_iota_core/src/rebased/iota/move_calls/asset.rs new file mode 100644 index 0000000000..3174db4a1f --- /dev/null +++ b/identity_iota_core/src/rebased/iota/move_calls/asset.rs @@ -0,0 +1,200 @@ +// Copyright 2020-2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +use serde::Serialize; + +use crate::rebased::Error; +use iota_interaction::ident_str; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectRef; +use iota_interaction::types::base_types::SequenceNumber; +use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; +use iota_interaction::types::transaction::Argument; +use iota_interaction::types::transaction::Command; +use iota_interaction::types::transaction::ObjectArg; +use iota_interaction::types::transaction::ProgrammableMoveCall; +use iota_interaction::types::TypeTag; +use iota_interaction::MoveType; +use iota_interaction::ProgrammableTransactionBcs; +use iota_interaction::TypedValue; + +fn try_to_argument( + content: &T, + ptb: &mut ProgrammableTransactionBuilder, + package: ObjectID, +) -> Result { + match content.get_typed_value(package) { + TypedValue::IotaVerifiableCredential(value) => { + let values = ptb + .pure(value.data()) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + Ok(ptb.command(Command::MoveCall(Box::new(ProgrammableMoveCall { + package, + module: ident_str!("public_vc").into(), + function: ident_str!("new").into(), + type_arguments: vec![], + arguments: vec![values], + })))) + } + TypedValue::Other(value) => ptb.pure(value).map_err(|e| Error::InvalidArgument(e.to_string())), + } +} + +pub(crate) fn new_asset( + inner: &T, + mutable: bool, + transferable: bool, + deletable: bool, + package: ObjectID, +) -> Result { + let mut ptb = ProgrammableTransactionBuilder::new(); + let inner = try_to_argument(inner, &mut ptb, package)?; + let mutable = ptb.pure(mutable).map_err(|e| Error::InvalidArgument(e.to_string()))?; + let transferable = ptb + .pure(transferable) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + let deletable = ptb.pure(deletable).map_err(|e| Error::InvalidArgument(e.to_string()))?; + + ptb.command(Command::MoveCall(Box::new(ProgrammableMoveCall { + package, + module: ident_str!("asset").into(), + function: ident_str!("new_with_config").into(), + type_arguments: vec![T::move_type(package)], + arguments: vec![inner, mutable, transferable, deletable], + }))); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn delete(asset: ObjectRef, package: ObjectID) -> Result +where + T: MoveType, +{ + let mut ptb = ProgrammableTransactionBuilder::new(); + + let asset = ptb + .obj(ObjectArg::ImmOrOwnedObject(asset)) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + + ptb.command(Command::move_call( + package, + ident_str!("asset").into(), + ident_str!("delete").into(), + vec![T::move_type(package)], + vec![asset], + )); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn transfer( + asset: ObjectRef, + recipient: IotaAddress, + package: ObjectID, +) -> Result { + let mut ptb = ProgrammableTransactionBuilder::new(); + let asset = ptb + .obj(ObjectArg::ImmOrOwnedObject(asset)) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + let recipient = ptb.pure(recipient).map_err(|e| Error::InvalidArgument(e.to_string()))?; + + ptb.command(Command::move_call( + package, + ident_str!("asset").into(), + ident_str!("transfer").into(), + vec![T::move_type(package)], + vec![asset, recipient], + )); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn make_tx( + proposal: (ObjectID, SequenceNumber), + cap: ObjectRef, + asset: ObjectRef, + asset_type_param: TypeTag, + package: ObjectID, + function_name: &'static str, +) -> Result { + let mut ptb = ProgrammableTransactionBuilder::new(); + let proposal = ptb + .obj(ObjectArg::SharedObject { + id: proposal.0, + initial_shared_version: proposal.1, + mutable: true, + }) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + let cap = ptb + .obj(ObjectArg::ImmOrOwnedObject(cap)) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + let asset = ptb + .obj(ObjectArg::Receiving(asset)) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + + ptb.command(Command::move_call( + package, + ident_str!("asset").into(), + ident_str!(function_name).into(), + vec![asset_type_param], + vec![proposal, cap, asset], + )); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn accept_proposal( + proposal: (ObjectID, SequenceNumber), + recipient_cap: ObjectRef, + asset: ObjectRef, + asset_type_param: TypeTag, + package: ObjectID, +) -> Result { + make_tx(proposal, recipient_cap, asset, asset_type_param, package, "accept") +} + +pub(crate) fn conclude_or_cancel( + proposal: (ObjectID, SequenceNumber), + sender_cap: ObjectRef, + asset: ObjectRef, + asset_type_param: TypeTag, + package: ObjectID, +) -> Result { + make_tx( + proposal, + sender_cap, + asset, + asset_type_param, + package, + "conclude_or_cancel", + ) +} + +pub(crate) fn update( + asset: ObjectRef, + new_content: &T, + package: ObjectID, +) -> Result +where + T: MoveType + Serialize, +{ + let mut ptb = ProgrammableTransactionBuilder::new(); + + let asset = ptb + .obj(ObjectArg::ImmOrOwnedObject(asset)) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + let new_content = ptb + .pure(new_content) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + + ptb.command(Command::move_call( + package, + ident_str!("asset").into(), + ident_str!("set_content").into(), + vec![T::move_type(package)], + vec![asset, new_content], + )); + + Ok(bcs::to_bytes(&ptb.finish())?) +} diff --git a/identity_iota_core/src/rebased/iota/move_calls/asset/create.rs b/identity_iota_core/src/rebased/iota/move_calls/asset/create.rs deleted file mode 100644 index 63c402debc..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/asset/create.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Command; -use identity_iota_interaction::types::transaction::ProgrammableMoveCall; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; -use serde::Serialize; - -use identity_iota_interaction::MoveType; -use crate::rebased::Error; -use super::try_to_argument; - -pub(crate) fn new( - inner: T, - mutable: bool, - transferable: bool, - deletable: bool, - package: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let inner = try_to_argument(&inner, &mut ptb, package)?; - let mutable = ptb.pure(mutable).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let transferable = ptb - .pure(transferable) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let deletable = ptb.pure(deletable).map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::MoveCall(Box::new(ProgrammableMoveCall { - package, - module: ident_str!("asset").into(), - function: ident_str!("new_with_config").into(), - type_arguments: vec![T::move_type(package)], - arguments: vec![inner, mutable, transferable, deletable], - }))); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/asset/delete.rs b/identity_iota_core/src/rebased/iota/move_calls/asset/delete.rs deleted file mode 100644 index 5a2adc0538..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/asset/delete.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Command; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; - -use identity_iota_interaction::MoveType; -use crate::rebased::Error; - -pub(crate) fn delete(asset: ObjectRef, package: ObjectID) -> Result -where - T: MoveType, -{ - let mut ptb = ProgrammableTransactionBuilder::new(); - - let asset = ptb - .obj(ObjectArg::ImmOrOwnedObject(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!("delete").into(), - vec![T::move_type(package)], - vec![asset], - )); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/asset/mod.rs b/identity_iota_core/src/rebased/iota/move_calls/asset/mod.rs deleted file mode 100644 index dc0271ad8b..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/asset/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -mod create; -mod delete; -mod transfer; -mod update; -mod try_to_argument; - -pub(crate) use create::*; -pub(crate) use delete::*; -pub(crate) use transfer::*; -pub(crate) use update::*; -pub(crate) use try_to_argument::try_to_argument; \ No newline at end of file diff --git a/identity_iota_core/src/rebased/iota/move_calls/asset/transfer.rs b/identity_iota_core/src/rebased/iota/move_calls/asset/transfer.rs deleted file mode 100644 index 2505905a7c..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/asset/transfer.rs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::SequenceNumber; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Command; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::ident_str; - -use identity_iota_interaction::MoveType; -use crate::rebased::Error; - -pub(crate) fn transfer( - asset: ObjectRef, - recipient: IotaAddress, - package: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let asset = ptb - .obj(ObjectArg::ImmOrOwnedObject(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let recipient = ptb.pure(recipient).map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!("transfer").into(), - vec![T::move_type(package)], - vec![asset, recipient], - )); - - Ok(ptb.finish()) -} - -fn make_tx( - proposal: (ObjectID, SequenceNumber), - cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, - function_name: &'static str, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let proposal = ptb - .obj(ObjectArg::SharedObject { - id: proposal.0, - initial_shared_version: proposal.1, - mutable: true, - }) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let cap = ptb - .obj(ObjectArg::ImmOrOwnedObject(cap)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let asset = ptb - .obj(ObjectArg::Receiving(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!(function_name).into(), - vec![asset_type_param], - vec![proposal, cap, asset], - )); - - Ok(ptb.finish()) -} - -pub(crate) fn accept_proposal( - proposal: (ObjectID, SequenceNumber), - recipient_cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, -) -> Result { - make_tx(proposal, recipient_cap, asset, asset_type_param, package, "accept") -} - -pub(crate) fn conclude_or_cancel( - proposal: (ObjectID, SequenceNumber), - sender_cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, -) -> Result { - make_tx( - proposal, - sender_cap, - asset, - asset_type_param, - package, - "conclude_or_cancel", - ) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/asset/try_to_argument.rs b/identity_iota_core/src/rebased/iota/move_calls/asset/try_to_argument.rs deleted file mode 100644 index 31ce4134d7..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/asset/try_to_argument.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::Serialize; -use identity_iota_interaction::{ident_str, MoveType, TypedValue}; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::transaction::{Argument, Command, ProgrammableMoveCall}; -use crate::rebased::Error; - -pub(crate) fn try_to_argument( - content: &T, - ptb: &mut ProgrammableTransactionBuilder, - package: ObjectID, -) -> Result { - match content.get_typed_value(package) { - TypedValue::IotaVerifiableCredential(value) => { - let values = ptb - .pure(value.data()) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - Ok(ptb.command(Command::MoveCall(Box::new(ProgrammableMoveCall { - package, - module: ident_str!("public_vc").into(), - function: ident_str!("new").into(), - type_arguments: vec![], - arguments: vec![values], - })))) - }, - TypedValue::Other(value) => { - ptb.pure(value).map_err(|e| Error::InvalidArgument(e.to_string())) - }, - } -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/asset/update.rs b/identity_iota_core/src/rebased/iota/move_calls/asset/update.rs deleted file mode 100644 index c94575e8b5..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/asset/update.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Command; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; -use serde::Serialize; - -use identity_iota_interaction::MoveType; -use crate::rebased::Error; - -pub(crate) fn update(asset: ObjectRef, new_content: T, package: ObjectID) -> Result -where - T: MoveType + Serialize, -{ - let mut ptb = ProgrammableTransactionBuilder::new(); - - let asset = ptb - .obj(ObjectArg::ImmOrOwnedObject(asset)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let new_content = ptb - .pure(new_content) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.command(Command::move_call( - package, - ident_str!("asset").into(), - ident_str!("set_content").into(), - vec![T::move_type(package)], - vec![asset, new_content], - )); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity.rs b/identity_iota_core/src/rebased/iota/move_calls/identity.rs new file mode 100644 index 0000000000..f3c030e489 --- /dev/null +++ b/identity_iota_core/src/rebased/iota/move_calls/identity.rs @@ -0,0 +1,956 @@ +// Copyright 2020-2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +use itertools::Itertools; + +use std::collections::HashMap; +use std::collections::HashSet; +use std::str::FromStr; + +use iota_interaction::ident_str; +use iota_interaction::rpc_types::IotaObjectData; +use iota_interaction::rpc_types::OwnedObjectRef; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectRef; +use iota_interaction::types::base_types::ObjectType; +use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; +use iota_interaction::types::transaction::Argument; +use iota_interaction::types::transaction::ObjectArg; +use iota_interaction::types::TypeTag; +use iota_interaction::MoveType; +use iota_interaction::OptionalSend; +use iota_interaction::ProgrammableTransactionBcs; + +use crate::rebased::proposals::BorrowAction; +use crate::rebased::proposals::ControllerExecution; +use crate::rebased::proposals::SendAction; +use crate::rebased::rebased_err; +use crate::rebased::Error; + +use super::utils; +use super::ControllerTokenRef; + +enum ControllerTokenArg { + Controller { + cap: Argument, + token: Argument, + borrow: Argument, + }, + Delegate(Argument), +} + +impl ControllerTokenArg { + fn from_ref(controller_ref: ControllerTokenRef, ptb: &mut Ptb, package: ObjectID) -> Result { + let token_arg = ptb + .obj(ObjectArg::ImmOrOwnedObject(controller_ref.object_ref())) + .map_err(rebased_err)?; + match controller_ref { + ControllerTokenRef::Delegate(_) => Ok(ControllerTokenArg::Delegate(token_arg)), + ControllerTokenRef::Controller(_) => { + let cap = token_arg; + let (token, borrow) = utils::get_controller_delegation(ptb, cap, package); + + Ok(Self::Controller { cap, token, borrow }) + } + } + } + + fn arg(&self) -> Argument { + match self { + Self::Controller { token, .. } => *token, + Self::Delegate(token) => *token, + } + } + + fn put_back(self, ptb: &mut Ptb, package_id: ObjectID) { + if let Self::Controller { cap, token, borrow } = self { + utils::put_back_delegation_token(ptb, cap, token, borrow, package_id); + } + } +} + +struct ProposalContext { + ptb: Ptb, + capability: ControllerTokenArg, + identity: Argument, + proposal_id: Argument, +} + +fn borrow_proposal_impl( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + objects: Vec, + expiration: Option, + package_id: ObjectID, +) -> anyhow::Result { + let mut ptb = Ptb::new(); + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; + let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; + let objects_arg = ptb.pure(objects)?; + + let proposal_id = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("propose_borrow").into(), + vec![], + vec![identity_arg, capability.arg(), exp_arg, objects_arg], + ); + + Ok(ProposalContext { + ptb, + identity: identity_arg, + capability, + proposal_id, + }) +} + +pub(crate) fn execute_borrow_impl( + ptb: &mut Ptb, + identity: Argument, + delegation_token: Argument, + proposal_id: Argument, + objects: Vec, + intent_fn: F, + package: ObjectID, +) -> anyhow::Result<()> +where + F: FnOnce(&mut Ptb, &HashMap), +{ + // Get the proposal's action as argument. + let borrow_action = ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("execute_proposal").into(), + vec![BorrowAction::move_type(package)], + vec![identity, delegation_token, proposal_id], + ); + + // Borrow all the objects specified in the action. + let obj_arg_map = objects + .into_iter() + .map(|obj_data| { + let obj_ref = obj_data.object_ref(); + let ObjectType::Struct(obj_type) = obj_data.object_type()? else { + unreachable!("move packages cannot be borrowed to begin with"); + }; + let recv_obj = ptb.obj(ObjectArg::Receiving(obj_ref))?; + + let obj_arg = ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("execute_borrow").into(), + vec![obj_type.into()], + vec![identity, borrow_action, recv_obj], + ); + + Ok((obj_ref.0, (obj_arg, obj_data))) + }) + .collect::>()?; + + // Apply the user-defined operation. + intent_fn(ptb, &obj_arg_map); + + // Put back all the objects. + obj_arg_map.into_values().for_each(|(obj_arg, obj_data)| { + let ObjectType::Struct(obj_type) = obj_data.object_type().expect("checked above") else { + unreachable!("move packages cannot be borrowed to begin with"); + }; + ptb.programmable_move_call( + package, + ident_str!("borrow_proposal").into(), + ident_str!("put_back").into(), + vec![obj_type.into()], + vec![borrow_action, obj_arg], + ); + }); + + // Consume the now empty borrow_action + ptb.programmable_move_call( + package, + ident_str!("borrow_proposal").into(), + ident_str!("conclude_borrow").into(), + vec![], + vec![borrow_action], + ); + + Ok(()) +} + +fn controller_execution_impl( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + controller_cap_id: ObjectID, + expiration: Option, + package_id: ObjectID, +) -> anyhow::Result { + let mut ptb = Ptb::new(); + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; + let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let controller_cap_id = ptb.pure(controller_cap_id)?; + let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; + + let proposal_id = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("propose_controller_execution").into(), + vec![], + vec![identity_arg, capability.arg(), controller_cap_id, exp_arg], + ); + + Ok(ProposalContext { + ptb, + capability, + identity: identity_arg, + proposal_id, + }) +} + +pub(crate) fn execute_controller_execution_impl( + ptb: &mut Ptb, + identity: Argument, + proposal_id: Argument, + delegation_token: Argument, + borrowing_controller_cap_ref: ObjectRef, + intent_fn: F, + package: ObjectID, +) -> anyhow::Result<()> +where + F: FnOnce(&mut Ptb, &Argument), +{ + // Get the proposal's action as argument. + let controller_execution_action = ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("execute_proposal").into(), + vec![ControllerExecution::move_type(package)], + vec![identity, delegation_token, proposal_id], + ); + + // Borrow the controller cap into this transaction. + let receiving = ptb.obj(ObjectArg::Receiving(borrowing_controller_cap_ref))?; + let borrowed_controller_cap = ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("borrow_controller_cap").into(), + vec![], + vec![identity, controller_execution_action, receiving], + ); + + // Apply the user-defined operation. + intent_fn(ptb, &borrowed_controller_cap); + + // Put back the borrowed controller cap. + ptb.programmable_move_call( + package, + ident_str!("controller_proposal").into(), + ident_str!("put_back").into(), + vec![], + vec![controller_execution_action, borrowed_controller_cap], + ); + + Ok(()) +} + +fn send_proposal_impl( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + transfer_map: Vec<(ObjectID, IotaAddress)>, + expiration: Option, + package_id: ObjectID, +) -> anyhow::Result { + let mut ptb = Ptb::new(); + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; + let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; + let (objects, recipients) = { + let (objects, recipients): (Vec<_>, Vec<_>) = transfer_map.into_iter().unzip(); + let objects = ptb.pure(objects)?; + let recipients = ptb.pure(recipients)?; + + (objects, recipients) + }; + + let proposal_id = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("propose_send").into(), + vec![], + vec![identity_arg, capability.arg(), exp_arg, objects, recipients], + ); + + Ok(ProposalContext { + ptb, + identity: identity_arg, + capability, + proposal_id, + }) +} + +pub(crate) fn execute_send_impl( + ptb: &mut Ptb, + identity: Argument, + delegation_token: Argument, + proposal_id: Argument, + objects: Vec<(ObjectRef, TypeTag)>, + package: ObjectID, +) -> anyhow::Result<()> { + // Get the proposal's action as argument. + let send_action = ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("execute_proposal").into(), + vec![SendAction::move_type(package)], + vec![identity, delegation_token, proposal_id], + ); + + // Send each object in this send action. + // Traversing the map in reverse reduces the number of operations on the move side. + for (obj, obj_type) in objects.into_iter().rev() { + let recv_obj = ptb.obj(ObjectArg::Receiving(obj))?; + + ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("execute_send").into(), + vec![obj_type], + vec![identity, send_action, recv_obj], + ); + } + + // Consume the now empty send_action + ptb.programmable_move_call( + package, + ident_str!("transfer_proposal").into(), + ident_str!("complete_send").into(), + vec![], + vec![send_action], + ); + + Ok(()) +} + +pub(crate) fn propose_borrow( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + objects: Vec, + expiration: Option, + package_id: ObjectID, +) -> Result { + let ProposalContext { + mut ptb, capability, .. + } = borrow_proposal_impl(identity, capability, objects, expiration, package_id)?; + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn execute_borrow( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + proposal_id: ObjectID, + objects: Vec, + intent_fn: F, + package: ObjectID, +) -> Result +where + F: FnOnce(&mut Ptb, &HashMap), +{ + let mut ptb = Ptb::new(); + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package)?; + let proposal_id = ptb.pure(proposal_id)?; + + execute_borrow_impl( + &mut ptb, + identity, + capability.arg(), + proposal_id, + objects, + intent_fn, + package, + )?; + + capability.put_back(&mut ptb, package); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn create_and_execute_borrow( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + objects: Vec, + intent_fn: F, + expiration: Option, + package_id: ObjectID, +) -> anyhow::Result +where + F: FnOnce(&mut Ptb, &HashMap), +{ + let ProposalContext { + mut ptb, + capability, + identity, + proposal_id, + } = borrow_proposal_impl( + identity, + capability, + objects.iter().map(|obj_data| obj_data.object_id).collect_vec(), + expiration, + package_id, + )?; + + execute_borrow_impl( + &mut ptb, + identity, + capability.arg(), + proposal_id, + objects, + intent_fn, + package_id, + )?; + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +#[allow(clippy::too_many_arguments)] +pub(crate) fn propose_config_change( + identity: OwnedObjectRef, + controller_cap: ControllerTokenRef, + expiration: Option, + threshold: Option, + controllers_to_add: I1, + controllers_to_remove: HashSet, + controllers_to_update: I2, + package: ObjectID, +) -> Result +where + I1: IntoIterator, + I2: IntoIterator, +{ + let mut ptb = Ptb::new(); + + let controllers_to_add = { + let (addresses, vps): (Vec, Vec) = controllers_to_add.into_iter().unzip(); + let addresses = ptb.pure(addresses).map_err(rebased_err)?; + let vps = ptb.pure(vps).map_err(rebased_err)?; + + ptb.programmable_move_call( + package, + ident_str!("utils").into(), + ident_str!("vec_map_from_keys_values").into(), + vec![TypeTag::Address, TypeTag::U64], + vec![addresses, vps], + ) + }; + let controllers_to_update = { + let (ids, vps): (Vec, Vec) = controllers_to_update.into_iter().unzip(); + let ids = ptb.pure(ids).map_err(rebased_err)?; + let vps = ptb.pure(vps).map_err(rebased_err)?; + + ptb.programmable_move_call( + package, + ident_str!("utils").into(), + ident_str!("vec_map_from_keys_values").into(), + vec![TypeTag::from_str("0x2::object::ID").expect("valid utf8"), TypeTag::U64], + vec![ids, vps], + ) + }; + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; + let capability = ControllerTokenArg::from_ref(controller_cap, &mut ptb, package)?; + let expiration = utils::option_to_move(expiration, &mut ptb, package).map_err(rebased_err)?; + let threshold = utils::option_to_move(threshold, &mut ptb, package).map_err(rebased_err)?; + let controllers_to_remove = ptb.pure(controllers_to_remove).map_err(rebased_err)?; + + let _proposal_id = ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("propose_config_change").into(), + vec![], + vec![ + identity, + capability.arg(), + expiration, + threshold, + controllers_to_add, + controllers_to_remove, + controllers_to_update, + ], + ); + + capability.put_back(&mut ptb, package); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn execute_config_change( + identity: OwnedObjectRef, + controller_cap: ControllerTokenRef, + proposal_id: ObjectID, + package: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; + let capability = ControllerTokenArg::from_ref(controller_cap, &mut ptb, package)?; + let proposal_id = ptb.pure(proposal_id).map_err(rebased_err)?; + ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("execute_config_change").into(), + vec![], + vec![identity, capability.arg(), proposal_id], + ); + + capability.put_back(&mut ptb, package); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn propose_controller_execution( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + controller_cap_id: ObjectID, + expiration: Option, + package_id: ObjectID, +) -> Result { + let ProposalContext { + mut ptb, capability, .. + } = controller_execution_impl(identity, capability, controller_cap_id, expiration, package_id)?; + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn execute_controller_execution( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + proposal_id: ObjectID, + borrowing_controller_cap_ref: ObjectRef, + intent_fn: F, + package: ObjectID, +) -> Result +where + F: FnOnce(&mut Ptb, &Argument), +{ + let mut ptb = Ptb::new(); + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package)?; + let proposal_id = ptb.pure(proposal_id)?; + + execute_controller_execution_impl( + &mut ptb, + identity, + proposal_id, + capability.arg(), + borrowing_controller_cap_ref, + intent_fn, + package, + )?; + + capability.put_back(&mut ptb, package); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn create_and_execute_controller_execution( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + expiration: Option, + borrowing_controller_cap_ref: ObjectRef, + intent_fn: F, + package_id: ObjectID, +) -> Result +where + F: FnOnce(&mut Ptb, &Argument), +{ + let ProposalContext { + mut ptb, + capability, + proposal_id, + identity, + } = controller_execution_impl( + identity, + capability, + borrowing_controller_cap_ref.0, + expiration, + package_id, + )?; + + execute_controller_execution_impl( + &mut ptb, + identity, + proposal_id, + capability.arg(), + borrowing_controller_cap_ref, + intent_fn, + package_id, + )?; + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) async fn new_identity( + did_doc: Option<&[u8]>, + package_id: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let doc_arg = utils::ptb_pure(&mut ptb, "did_doc", did_doc)?; + let clock = utils::get_clock_ref(&mut ptb); + + // Create a new identity, sending its capability to the tx's sender. + let _identity_id = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("new").into(), + vec![], + vec![doc_arg, clock], + ); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) async fn new_with_controllers( + did_doc: Option<&[u8]>, + controllers: C, + threshold: u64, + package_id: ObjectID, +) -> Result +where + C: IntoIterator + OptionalSend, +{ + use itertools::Either; + use itertools::Itertools as _; + + let mut ptb = Ptb::new(); + + let (controllers_that_can_delegate, controllers): (Vec<_>, Vec<_>) = + controllers.into_iter().partition_map(|(address, vp, can_delegate)| { + if can_delegate { + Either::Left((address, vp)) + } else { + Either::Right((address, vp)) + } + }); + + let mut make_vec_map = |controllers: Vec<(IotaAddress, u64)>| -> Result { + let (ids, vps): (Vec<_>, Vec<_>) = controllers.into_iter().unzip(); + let ids = ptb.pure(ids).map_err(|e| Error::InvalidArgument(e.to_string()))?; + let vps = ptb.pure(vps).map_err(|e| Error::InvalidArgument(e.to_string()))?; + Ok(ptb.programmable_move_call( + package_id, + ident_str!("utils").into(), + ident_str!("vec_map_from_keys_values").into(), + vec![TypeTag::Address, TypeTag::U64], + vec![ids, vps], + )) + }; + + let controllers = make_vec_map(controllers)?; + let controllers_that_can_delegate = make_vec_map(controllers_that_can_delegate)?; + let doc_arg = ptb.pure(did_doc).map_err(|e| Error::InvalidArgument(e.to_string()))?; + let threshold_arg = ptb.pure(threshold).map_err(|e| Error::InvalidArgument(e.to_string()))?; + let clock = utils::get_clock_ref(&mut ptb); + + // Create a new identity, sending its capabilities to the specified controllers. + let _identity_id = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("new_with_controllers").into(), + vec![], + vec![ + doc_arg, + controllers, + controllers_that_can_delegate, + threshold_arg, + clock, + ], + ); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn approve_proposal( + identity: OwnedObjectRef, + controller_cap: ControllerTokenRef, + proposal_id: ObjectID, + package: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true) + .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; + let capability = ControllerTokenArg::from_ref(controller_cap, &mut ptb, package)?; + let proposal_id = ptb + .pure(proposal_id) + .map_err(|e| Error::InvalidArgument(e.to_string()))?; + + ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("approve_proposal").into(), + vec![T::move_type(package)], + vec![identity, capability.arg(), proposal_id], + ); + + capability.put_back(&mut ptb, package); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn propose_send( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + transfer_map: Vec<(ObjectID, IotaAddress)>, + expiration: Option, + package_id: ObjectID, +) -> Result { + let ProposalContext { + mut ptb, capability, .. + } = send_proposal_impl(identity, capability, transfer_map, expiration, package_id)?; + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn execute_send( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + proposal_id: ObjectID, + objects: Vec<(ObjectRef, TypeTag)>, + package: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package)?; + let proposal_id = ptb.pure(proposal_id)?; + + execute_send_impl(&mut ptb, identity, capability.arg(), proposal_id, objects, package)?; + + capability.put_back(&mut ptb, package); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn create_and_execute_send( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + transfer_map: Vec<(ObjectID, IotaAddress)>, + expiration: Option, + objects: Vec<(ObjectRef, TypeTag)>, + package: ObjectID, +) -> anyhow::Result { + let ProposalContext { + mut ptb, + identity, + capability, + proposal_id, + } = send_proposal_impl(identity, capability, transfer_map, expiration, package)?; + + execute_send_impl(&mut ptb, identity, capability.arg(), proposal_id, objects, package)?; + + capability.put_back(&mut ptb, package); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) async fn propose_update( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + did_doc: Option<&[u8]>, + expiration: Option, + package_id: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; + let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; + let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id).map_err(rebased_err)?; + let doc_arg = ptb.pure(did_doc).map_err(rebased_err)?; + let clock = utils::get_clock_ref(&mut ptb); + + let _proposal_id = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("propose_update").into(), + vec![], + vec![identity_arg, capability.arg(), doc_arg, exp_arg, clock], + ); + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) async fn execute_update( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + proposal_id: ObjectID, + package_id: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; + let proposal_id = ptb.pure(proposal_id).map_err(rebased_err)?; + let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; + let clock = utils::get_clock_ref(&mut ptb); + + let _ = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("execute_update").into(), + vec![], + vec![identity_arg, capability.arg(), proposal_id, clock], + ); + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn propose_upgrade( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + expiration: Option, + package_id: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; + let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id).map_err(rebased_err)?; + + let _proposal_id = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("propose_upgrade").into(), + vec![], + vec![identity_arg, capability.arg(), exp_arg], + ); + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn execute_upgrade( + identity: OwnedObjectRef, + capability: ControllerTokenRef, + proposal_id: ObjectID, + package_id: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let capability = ControllerTokenArg::from_ref(capability, &mut ptb, package_id)?; + let proposal_id = ptb.pure(proposal_id).map_err(rebased_err)?; + let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true).map_err(rebased_err)?; + + let _ = ptb.programmable_move_call( + package_id, + ident_str!("identity").into(), + ident_str!("execute_upgrade").into(), + vec![], + vec![identity_arg, capability.arg(), proposal_id], + ); + + capability.put_back(&mut ptb, package_id); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) async fn delegate_controller_cap( + controller_cap: ObjectRef, + recipient: IotaAddress, + permissions: u32, + package: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let cap = ptb + .obj(ObjectArg::ImmOrOwnedObject(controller_cap)) + .map_err(rebased_err)?; + let permissions = ptb.pure(permissions).map_err(rebased_err)?; + + let delegation_token = ptb.programmable_move_call( + package, + ident_str!("controller").into(), + ident_str!("delegate_with_permissions").into(), + vec![], + vec![cap, permissions], + ); + + ptb.transfer_arg(recipient, delegation_token); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn revoke_delegation_token( + identity: OwnedObjectRef, + controller_cap: ObjectRef, + delegation_token_id: ObjectID, + package: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let cap = ptb + .obj(ObjectArg::ImmOrOwnedObject(controller_cap)) + .map_err(rebased_err)?; + let delegation_token_id = ptb.pure(delegation_token_id).map_err(rebased_err)?; + + ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("revoke_token").into(), + vec![], + vec![identity, cap, delegation_token_id], + ); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) fn unrevoke_delegation_token( + identity: OwnedObjectRef, + controller_cap: ObjectRef, + delegation_token_id: ObjectID, + package: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let cap = ptb + .obj(ObjectArg::ImmOrOwnedObject(controller_cap)) + .map_err(rebased_err)?; + let delegation_token_id = ptb.pure(delegation_token_id).map_err(rebased_err)?; + + ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("unrevoke_token").into(), + vec![], + vec![identity, cap, delegation_token_id], + ); + + Ok(bcs::to_bytes(&ptb.finish())?) +} + +pub(crate) async fn destroy_delegation_token( + identity: OwnedObjectRef, + delegation_token: ObjectRef, + package: ObjectID, +) -> Result { + let mut ptb = Ptb::new(); + let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; + let delegation_token = ptb + .obj(ObjectArg::ImmOrOwnedObject(delegation_token)) + .map_err(rebased_err)?; + + ptb.programmable_move_call( + package, + ident_str!("identity").into(), + ident_str!("destroy_delegation_token").into(), + vec![], + vec![identity, delegation_token], + ); + + Ok(bcs::to_bytes(&ptb.finish())?) +} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/borrow_asset.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/borrow_asset.rs deleted file mode 100644 index 2071a5754c..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/borrow_asset.rs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::HashMap; - -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::ObjectType; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; -use itertools::Itertools; - -use crate::rebased::iota::move_calls::utils; -use crate::rebased::proposals::BorrowAction; -use identity_iota_interaction::MoveType; - -use super::ProposalContext; - -fn borrow_proposal_impl( - identity: OwnedObjectRef, - capability: ObjectRef, - objects: Vec, - expiration: Option, - package_id: ObjectID, -) -> anyhow::Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, cap_arg, package_id); - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - let objects_arg = ptb.pure(objects)?; - - let proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_borrow").into(), - vec![], - vec![identity_arg, delegation_token, exp_arg, objects_arg], - ); - - Ok(ProposalContext { - ptb, - identity: identity_arg, - controller_cap: cap_arg, - delegation_token, - borrow, - proposal_id, - }) -} - -pub(crate) fn propose_borrow( - identity: OwnedObjectRef, - capability: ObjectRef, - objects: Vec, - expiration: Option, - package_id: ObjectID, -) -> Result { - let ProposalContext { - mut ptb, - controller_cap, - delegation_token, - borrow, - .. - } = borrow_proposal_impl(identity, capability, objects, expiration, package_id)?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} - -fn execute_borrow_impl( - ptb: &mut ProgrammableTransactionBuilder, - identity: Argument, - delegation_token: Argument, - proposal_id: Argument, - objects: Vec, - intent_fn: F, - package: ObjectID, -) -> anyhow::Result<()> -where - F: FnOnce(&mut ProgrammableTransactionBuilder, &HashMap), -{ - // Get the proposal's action as argument. - let borrow_action = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_proposal").into(), - vec![BorrowAction::move_type(package)], - vec![identity, delegation_token, proposal_id], - ); - - // Borrow all the objects specified in the action. - let obj_arg_map = objects - .into_iter() - .map(|obj_data| { - let obj_ref = obj_data.object_ref(); - let ObjectType::Struct(obj_type) = obj_data.object_type()? else { - unreachable!("move packages cannot be borrowed to begin with"); - }; - let recv_obj = ptb.obj(ObjectArg::Receiving(obj_ref))?; - - let obj_arg = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_borrow").into(), - vec![obj_type.into()], - vec![identity, borrow_action, recv_obj], - ); - - Ok((obj_ref.0, (obj_arg, obj_data))) - }) - .collect::>()?; - - // Apply the user-defined operation. - intent_fn(ptb, &obj_arg_map); - - // Put back all the objects. - obj_arg_map.into_values().for_each(|(obj_arg, obj_data)| { - let ObjectType::Struct(obj_type) = obj_data.object_type().expect("checked above") else { - unreachable!("move packages cannot be borrowed to begin with"); - }; - ptb.programmable_move_call( - package, - ident_str!("borrow_proposal").into(), - ident_str!("put_back").into(), - vec![obj_type.into()], - vec![borrow_action, obj_arg], - ); - }); - - // Consume the now empty borrow_action - ptb.programmable_move_call( - package, - ident_str!("borrow_proposal").into(), - ident_str!("conclude_borrow").into(), - vec![], - vec![borrow_action], - ); - - Ok(()) -} - -pub(crate) fn execute_borrow( - identity: OwnedObjectRef, - capability: ObjectRef, - proposal_id: ObjectID, - objects: Vec, - intent_fn: F, - package: ObjectID, -) -> Result -where - F: FnOnce(&mut ProgrammableTransactionBuilder, &HashMap), -{ - let mut ptb = ProgrammableTransactionBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let controller_cap = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, controller_cap, package); - let proposal_id = ptb.pure(proposal_id)?; - - execute_borrow_impl( - &mut ptb, - identity, - delegation_token, - proposal_id, - objects, - intent_fn, - package, - )?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package); - - Ok(ptb.finish()) -} - -pub(crate) fn create_and_execute_borrow( - identity: OwnedObjectRef, - capability: ObjectRef, - objects: Vec, - intent_fn: F, - expiration: Option, - package_id: ObjectID, -) -> anyhow::Result -where - F: FnOnce(&mut ProgrammableTransactionBuilder, &HashMap), -{ - let ProposalContext { - mut ptb, - controller_cap, - delegation_token, - borrow, - identity, - proposal_id, - } = borrow_proposal_impl( - identity, - capability, - objects.iter().map(|obj_data| obj_data.object_id).collect_vec(), - expiration, - package_id, - )?; - - execute_borrow_impl( - &mut ptb, - identity, - delegation_token, - proposal_id, - objects, - intent_fn, - package_id, - )?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/config.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/config.rs deleted file mode 100644 index dd560718d2..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/config.rs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::HashSet; -use std::str::FromStr; - -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::ident_str; - -use super::super::utils; - -#[allow(clippy::too_many_arguments)] -pub(crate) fn propose_config_change( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - expiration: Option, - threshold: Option, - controllers_to_add: I1, - controllers_to_remove: HashSet, - controllers_to_update: I2, - package: ObjectID, -) -> anyhow::Result -where - I1: IntoIterator, - I2: IntoIterator, -{ - let mut ptb = ProgrammableTransactionBuilder::new(); - - let controllers_to_add = { - let (addresses, vps): (Vec, Vec) = controllers_to_add.into_iter().unzip(); - let addresses = ptb.pure(addresses)?; - let vps = ptb.pure(vps)?; - - ptb.programmable_move_call( - package, - ident_str!("utils").into(), - ident_str!("vec_map_from_keys_values").into(), - vec![TypeTag::Address, TypeTag::U64], - vec![addresses, vps], - ) - }; - let controllers_to_update = { - let (ids, vps): (Vec, Vec) = controllers_to_update.into_iter().unzip(); - let ids = ptb.pure(ids)?; - let vps = ptb.pure(vps)?; - - ptb.programmable_move_call( - package, - ident_str!("utils").into(), - ident_str!("vec_map_from_keys_values").into(), - vec![TypeTag::from_str("0x2::object::ID").expect("valid utf8"), TypeTag::U64], - vec![ids, vps], - ) - }; - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let controller_cap = ptb.obj(ObjectArg::ImmOrOwnedObject(controller_cap))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, controller_cap, package); - let expiration = utils::option_to_move(expiration, &mut ptb, package)?; - let threshold = utils::option_to_move(threshold, &mut ptb, package)?; - let controllers_to_remove = ptb.pure(controllers_to_remove)?; - - let _proposal_id = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("propose_config_change").into(), - vec![], - vec![ - identity, - delegation_token, - expiration, - threshold, - controllers_to_add, - controllers_to_remove, - controllers_to_update, - ], - ); - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package); - - Ok(ptb.finish()) -} - -pub(crate) fn execute_config_change( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - proposal_id: ObjectID, - package: ObjectID, -) -> anyhow::Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let controller_cap = ptb.obj(ObjectArg::ImmOrOwnedObject(controller_cap))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, controller_cap, package); - let proposal_id = ptb.pure(proposal_id)?; - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_config_change").into(), - vec![], - vec![identity, delegation_token, proposal_id], - ); - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/controller_execution.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/controller_execution.rs deleted file mode 100644 index efde7e4da6..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/controller_execution.rs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; - -use crate::rebased::iota::move_calls::utils; -use crate::rebased::proposals::ControllerExecution; -use identity_iota_interaction::MoveType; - -use super::ProposalContext; - -fn controller_execution_impl( - identity: OwnedObjectRef, - capability: ObjectRef, - controller_cap_id: ObjectID, - expiration: Option, - package_id: ObjectID, -) -> anyhow::Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, cap_arg, package_id); - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let controller_cap_id = ptb.pure(controller_cap_id)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - - let proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_controller_execution").into(), - vec![], - vec![identity_arg, delegation_token, controller_cap_id, exp_arg], - ); - - Ok(ProposalContext { - ptb, - controller_cap: cap_arg, - delegation_token, - borrow, - identity: identity_arg, - proposal_id, - }) -} - -pub(crate) fn propose_controller_execution( - identity: OwnedObjectRef, - capability: ObjectRef, - controller_cap_id: ObjectID, - expiration: Option, - package_id: ObjectID, -) -> Result { - let ProposalContext { - mut ptb, - controller_cap, - delegation_token, - borrow, - .. - } = controller_execution_impl(identity, capability, controller_cap_id, expiration, package_id)?; - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} - -fn execute_controller_execution_impl( - ptb: &mut ProgrammableTransactionBuilder, - identity: Argument, - proposal_id: Argument, - delegation_token: Argument, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package: ObjectID, -) -> anyhow::Result<()> -where - F: FnOnce(&mut ProgrammableTransactionBuilder, &Argument), -{ - // Get the proposal's action as argument. - let controller_execution_action = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_proposal").into(), - vec![ControllerExecution::move_type(package)], - vec![identity, delegation_token, proposal_id], - ); - - // Borrow the controller cap into this transaction. - let receiving = ptb.obj(ObjectArg::Receiving(borrowing_controller_cap_ref))?; - let borrowed_controller_cap = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("borrow_controller_cap").into(), - vec![], - vec![identity, controller_execution_action, receiving], - ); - - // Apply the user-defined operation. - intent_fn(ptb, &borrowed_controller_cap); - - // Put back the borrowed controller cap. - ptb.programmable_move_call( - package, - ident_str!("controller_proposal").into(), - ident_str!("put_back").into(), - vec![], - vec![controller_execution_action, borrowed_controller_cap], - ); - - Ok(()) -} - -pub(crate) fn execute_controller_execution( - identity: OwnedObjectRef, - capability: ObjectRef, - proposal_id: ObjectID, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package: ObjectID, -) -> Result -where - F: FnOnce(&mut ProgrammableTransactionBuilder, &Argument), -{ - let mut ptb = ProgrammableTransactionBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let controller_cap = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, controller_cap, package); - let proposal_id = ptb.pure(proposal_id)?; - - execute_controller_execution_impl( - &mut ptb, - identity, - proposal_id, - delegation_token, - borrowing_controller_cap_ref, - intent_fn, - package, - )?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package); - - Ok(ptb.finish()) -} - -pub(crate) fn create_and_execute_controller_execution( - identity: OwnedObjectRef, - capability: ObjectRef, - expiration: Option, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package_id: ObjectID, -) -> anyhow::Result -where - F: FnOnce(&mut ProgrammableTransactionBuilder, &Argument), -{ - let ProposalContext { - mut ptb, - controller_cap, - delegation_token, - borrow, - proposal_id, - identity, - } = controller_execution_impl( - identity, - capability, - borrowing_controller_cap_ref.0, - expiration, - package_id, - )?; - - execute_controller_execution_impl( - &mut ptb, - identity, - proposal_id, - delegation_token, - borrowing_controller_cap_ref, - intent_fn, - package_id, - )?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/create.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/create.rs deleted file mode 100644 index 2d2d29b6c2..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/create.rs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::types::IOTA_FRAMEWORK_PACKAGE_ID; -use identity_iota_interaction::ident_str; - -use crate::rebased::iota::move_calls::utils; -use crate::rebased::Error; - -/// Build a transaction that creates a new on-chain Identity containing `did_doc`. -pub(crate) fn new(did_doc: &[u8], package_id: ObjectID) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let doc_arg = utils::ptb_pure(&mut ptb, "did_doc", did_doc)?; - let clock = utils::get_clock_ref(&mut ptb); - - // Create a new identity, sending its capability to the tx's sender. - let _identity_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("new").into(), - vec![], - vec![doc_arg, clock], - ); - - Ok(ptb.finish()) -} - -pub(crate) fn new_with_controllers( - did_doc: &[u8], - controllers: C, - threshold: u64, - package_id: ObjectID, -) -> Result -where - C: IntoIterator, -{ - let mut ptb = ProgrammableTransactionBuilder::new(); - - let controllers = { - let (ids, vps): (Vec, Vec) = controllers.into_iter().unzip(); - let ids = ptb.pure(ids).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let vps = ptb.pure(vps).map_err(|e| Error::InvalidArgument(e.to_string()))?; - ptb.programmable_move_call( - package_id, - ident_str!("utils").into(), - ident_str!("vec_map_from_keys_values").into(), - vec![TypeTag::Address, TypeTag::U64], - vec![ids, vps], - ) - }; - - let controllers_that_can_delegate = ptb.programmable_move_call( - IOTA_FRAMEWORK_PACKAGE_ID, - ident_str!("vec_map").into(), - ident_str!("empty").into(), - vec![TypeTag::Address, TypeTag::U64], - vec![], - ); - let doc_arg = ptb.pure(did_doc).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let threshold_arg = ptb.pure(threshold).map_err(|e| Error::InvalidArgument(e.to_string()))?; - let clock = utils::get_clock_ref(&mut ptb); - - // Create a new identity, sending its capabilities to the specified controllers. - let _identity_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("new_with_controllers").into(), - vec![], - vec![ - doc_arg, - controllers, - controllers_that_can_delegate, - threshold_arg, - clock, - ], - ); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/deactivate.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/deactivate.rs deleted file mode 100644 index bb7ddb9189..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/deactivate.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; - -use crate::rebased::iota::move_calls::utils; - -pub(crate) fn propose_deactivation( - identity: OwnedObjectRef, - capability: ObjectRef, - expiration: Option, - package_id: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, cap_arg, package_id); - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - let clock = utils::get_clock_ref(&mut ptb); - - let _proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_deactivation").into(), - vec![], - vec![identity_arg, delegation_token, exp_arg, clock], - ); - - utils::put_back_delegation_token(&mut ptb, cap_arg, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} - -pub(crate) fn execute_deactivation( - identity: OwnedObjectRef, - capability: ObjectRef, - proposal_id: ObjectID, - package_id: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, cap_arg, package_id); - let proposal_id = ptb.pure(proposal_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let clock = utils::get_clock_ref(&mut ptb); - - let _ = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("execute_deactivation").into(), - vec![], - vec![identity_arg, delegation_token, proposal_id, clock], - ); - - utils::put_back_delegation_token(&mut ptb, cap_arg, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/mod.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/mod.rs deleted file mode 100644 index fa85ae61d0..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/mod.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -mod borrow_asset; -mod config; -mod controller_execution; -mod create; -mod deactivate; -pub(crate) mod proposal; -mod send_asset; -mod update; -mod upgrade; - -pub(crate) use borrow_asset::*; -pub(crate) use config::*; -pub(crate) use controller_execution::*; -pub(crate) use create::*; -pub(crate) use deactivate::*; -use iota_sdk::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; -use iota_sdk::types::transaction::Argument; -pub(crate) use send_asset::*; -pub(crate) use update::*; -pub(crate) use upgrade::*; - -struct ProposalContext { - ptb: Ptb, - controller_cap: Argument, - delegation_token: Argument, - borrow: Argument, - identity: Argument, - proposal_id: Argument, -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/proposal.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/proposal.rs deleted file mode 100644 index 64b4d32e40..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/proposal.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::rebased::iota::move_calls::utils; -use identity_iota_interaction::MoveType; -use crate::rebased::Error; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; - -pub(crate) fn approve( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - proposal_id: ObjectID, - package: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let identity = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true) - .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; - let controller_cap = ptb - .obj(ObjectArg::ImmOrOwnedObject(controller_cap)) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, controller_cap, package); - let proposal_id = ptb - .pure(proposal_id) - .map_err(|e| Error::InvalidArgument(e.to_string()))?; - - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("approve_proposal").into(), - vec![T::move_type(package)], - vec![identity, delegation_token, proposal_id], - ); - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/send_asset.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/send_asset.rs deleted file mode 100644 index 9fd39d6a9a..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/send_asset.rs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::ident_str; - -use crate::rebased::iota::move_calls; -use crate::rebased::proposals::SendAction; -use identity_iota_interaction::MoveType; - -use self::move_calls::utils; -use super::ProposalContext; - -fn send_proposal_impl( - identity: OwnedObjectRef, - capability: ObjectRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - package_id: ObjectID, -) -> anyhow::Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = move_calls::utils::get_controller_delegation(&mut ptb, cap_arg, package_id); - let identity_arg = move_calls::utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = move_calls::utils::option_to_move(expiration, &mut ptb, package_id)?; - let (objects, recipients) = { - let (objects, recipients): (Vec<_>, Vec<_>) = transfer_map.into_iter().unzip(); - let objects = ptb.pure(objects)?; - let recipients = ptb.pure(recipients)?; - - (objects, recipients) - }; - - let proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_send").into(), - vec![], - vec![identity_arg, delegation_token, exp_arg, objects, recipients], - ); - - Ok(ProposalContext { - ptb, - identity: identity_arg, - controller_cap: cap_arg, - delegation_token, - borrow, - proposal_id, - }) -} - -pub(crate) fn propose_send( - identity: OwnedObjectRef, - capability: ObjectRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - package_id: ObjectID, -) -> Result { - let ProposalContext { - mut ptb, - controller_cap, - delegation_token, - borrow, - .. - } = send_proposal_impl(identity, capability, transfer_map, expiration, package_id)?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} - -fn execute_send_impl( - ptb: &mut ProgrammableTransactionBuilder, - identity: Argument, - delegation_token: Argument, - proposal_id: Argument, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, -) -> anyhow::Result<()> { - // Get the proposal's action as argument. - let send_action = ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_proposal").into(), - vec![SendAction::move_type(package)], - vec![identity, delegation_token, proposal_id], - ); - - // Send each object in this send action. - // Traversing the map in reverse reduces the number of operations on the move side. - for (obj, obj_type) in objects.into_iter().rev() { - let recv_obj = ptb.obj(ObjectArg::Receiving(obj))?; - - ptb.programmable_move_call( - package, - ident_str!("identity").into(), - ident_str!("execute_send").into(), - vec![obj_type], - vec![identity, send_action, recv_obj], - ); - } - - // Consume the now empty send_action - ptb.programmable_move_call( - package, - ident_str!("transfer_proposal").into(), - ident_str!("complete_send").into(), - vec![], - vec![send_action], - ); - - Ok(()) -} - -pub(crate) fn execute_send( - identity: OwnedObjectRef, - capability: ObjectRef, - proposal_id: ObjectID, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let identity = move_calls::utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let controller_cap = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = move_calls::utils::get_controller_delegation(&mut ptb, controller_cap, package); - let proposal_id = ptb.pure(proposal_id)?; - - execute_send_impl(&mut ptb, identity, delegation_token, proposal_id, objects, package)?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package); - - Ok(ptb.finish()) -} - -pub(crate) fn create_and_execute_send( - identity: OwnedObjectRef, - capability: ObjectRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, -) -> anyhow::Result { - let ProposalContext { - mut ptb, - identity, - controller_cap, - delegation_token, - borrow, - proposal_id, - } = send_proposal_impl(identity, capability, transfer_map, expiration, package)?; - - execute_send_impl(&mut ptb, identity, delegation_token, proposal_id, objects, package)?; - - utils::put_back_delegation_token(&mut ptb, controller_cap, delegation_token, borrow, package); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/update.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/update.rs deleted file mode 100644 index 59f7560e08..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/update.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; - -use crate::rebased::iota::move_calls::utils; - -pub(crate) fn propose_update( - identity: OwnedObjectRef, - capability: ObjectRef, - did_doc: impl AsRef<[u8]>, - expiration: Option, - package_id: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, cap_arg, package_id); - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - let doc_arg = ptb.pure(did_doc.as_ref())?; - let clock = utils::get_clock_ref(&mut ptb); - - let _proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_update").into(), - vec![], - vec![identity_arg, delegation_token, doc_arg, exp_arg, clock], - ); - - utils::put_back_delegation_token(&mut ptb, cap_arg, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} - -pub(crate) fn execute_update( - identity: OwnedObjectRef, - capability: ObjectRef, - proposal_id: ObjectID, - package_id: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let (delegation_token, borrow) = utils::get_controller_delegation(&mut ptb, cap_arg, package_id); - let proposal_id = ptb.pure(proposal_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let clock = utils::get_clock_ref(&mut ptb); - - let _ = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("execute_update").into(), - vec![], - vec![identity_arg, delegation_token, proposal_id, clock], - ); - - utils::put_back_delegation_token(&mut ptb, cap_arg, delegation_token, borrow, package_id); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/identity/upgrade.rs b/identity_iota_core/src/rebased/iota/move_calls/identity/upgrade.rs deleted file mode 100644 index 636e0d0a14..0000000000 --- a/identity_iota_core/src/rebased/iota/move_calls/identity/upgrade.rs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::ident_str; - -use crate::rebased::iota::move_calls::utils; - -pub(crate) fn propose_upgrade( - identity: OwnedObjectRef, - capability: ObjectRef, - expiration: Option, - package_id: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - let exp_arg = utils::option_to_move(expiration, &mut ptb, package_id)?; - - let _proposal_id = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("propose_upgrade").into(), - vec![], - vec![identity_arg, cap_arg, exp_arg], - ); - - Ok(ptb.finish()) -} - -pub(crate) fn execute_upgrade( - identity: OwnedObjectRef, - capability: ObjectRef, - proposal_id: ObjectID, - package_id: ObjectID, -) -> Result { - let mut ptb = ProgrammableTransactionBuilder::new(); - let cap_arg = ptb.obj(ObjectArg::ImmOrOwnedObject(capability))?; - let proposal_id = ptb.pure(proposal_id)?; - let identity_arg = utils::owned_ref_to_shared_object_arg(identity, &mut ptb, true)?; - - let _ = ptb.programmable_move_call( - package_id, - ident_str!("identity").into(), - ident_str!("execute_upgrade").into(), - vec![], - vec![identity_arg, cap_arg, proposal_id], - ); - - Ok(ptb.finish()) -} diff --git a/identity_iota_core/src/rebased/iota/move_calls/migration.rs b/identity_iota_core/src/rebased/iota/move_calls/migration.rs index 6605ac0256..fa20824a82 100644 --- a/identity_iota_core/src/rebased/iota/move_calls/migration.rs +++ b/identity_iota_core/src/rebased/iota/move_calls/migration.rs @@ -1,22 +1,25 @@ -// Copyright 2020-2024 IOTA Stiftung +// Copyright 2020-2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use iota_interaction::ident_str; +use iota_interaction::rpc_types::OwnedObjectRef; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectRef; +use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; +use iota_interaction::types::transaction::ObjectArg; +use iota_interaction::types::IOTA_FRAMEWORK_PACKAGE_ID; +use iota_interaction::ProgrammableTransactionBcs; + +use crate::rebased::Error; + use super::utils; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::IOTA_FRAMEWORK_PACKAGE_ID; -use identity_iota_interaction::ident_str; pub(crate) fn migrate_did_output( did_output: ObjectRef, creation_timestamp: Option, migration_registry: OwnedObjectRef, package: ObjectID, -) -> anyhow::Result { +) -> anyhow::Result { let mut ptb = Ptb::new(); let did_output = ptb.obj(ObjectArg::ImmOrOwnedObject(did_output))?; let migration_registry = utils::owned_ref_to_shared_object_arg(migration_registry, &mut ptb, true)?; @@ -41,5 +44,5 @@ pub(crate) fn migrate_did_output( vec![did_output, migration_registry, creation_timestamp, clock], ); - Ok(ptb.finish()) + Ok(bcs::to_bytes(&ptb.finish())?) } diff --git a/identity_iota_core/src/rebased/iota/move_calls/mod.rs b/identity_iota_core/src/rebased/iota/move_calls/mod.rs index 761fffa132..35ac48b3fe 100644 --- a/identity_iota_core/src/rebased/iota/move_calls/mod.rs +++ b/identity_iota_core/src/rebased/iota/move_calls/mod.rs @@ -1,12 +1,24 @@ // Copyright 2020-2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -/// Predefined `AuthenticatedAsset`-related PTBs. +use iota_interaction::types::base_types::ObjectRef; + pub(crate) mod asset; -/// Predefined `OnChainIdentity`-related PTBs. pub(crate) mod identity; -/// Predefined PTBs used to migrate a legacy Stardust's AliasOutput -/// to an `OnChainIdentity`. pub(crate) mod migration; - mod utils; + +#[derive(Debug, Clone, Copy)] +pub(crate) enum ControllerTokenRef { + Controller(ObjectRef), + Delegate(ObjectRef), +} + +impl ControllerTokenRef { + pub(crate) fn object_ref(&self) -> ObjectRef { + match self { + Self::Controller(obj_ref) => *obj_ref, + Self::Delegate(obj_ref) => *obj_ref, + } + } +} diff --git a/identity_iota_core/src/rebased/iota/move_calls/utils.rs b/identity_iota_core/src/rebased/iota/move_calls/utils.rs index a186236876..e97a663780 100644 --- a/identity_iota_core/src/rebased/iota/move_calls/utils.rs +++ b/identity_iota_core/src/rebased/iota/move_calls/utils.rs @@ -1,21 +1,22 @@ // Copyright 2020-2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use identity_iota_interaction::MoveType; -use crate::rebased::Error; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::STD_OPTION_MODULE_NAME; -use identity_iota_interaction::types::object::Owner; -use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::ObjectArg; -use identity_iota_interaction::types::IOTA_CLOCK_OBJECT_ID; -use identity_iota_interaction::types::IOTA_CLOCK_OBJECT_SHARED_VERSION; -use identity_iota_interaction::types::MOVE_STDLIB_PACKAGE_ID; -use identity_iota_interaction::ident_str; +use iota_interaction::ident_str; +use iota_interaction::rpc_types::OwnedObjectRef; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::STD_OPTION_MODULE_NAME; +use iota_interaction::types::object::Owner; +use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; +use iota_interaction::types::transaction::Argument; +use iota_interaction::types::transaction::ObjectArg; +use iota_interaction::types::IOTA_CLOCK_OBJECT_ID; +use iota_interaction::types::IOTA_CLOCK_OBJECT_SHARED_VERSION; +use iota_interaction::types::MOVE_STDLIB_PACKAGE_ID; +use iota_interaction::MoveType; use serde::Serialize; +use crate::rebased::Error; + /// Adds a reference to the on-chain clock to `ptb`'s arguments. pub(crate) fn get_clock_ref(ptb: &mut Ptb) -> Argument { ptb @@ -67,7 +68,7 @@ pub(crate) fn owned_ref_to_shared_object_arg( mutable: bool, ) -> anyhow::Result { let Owner::Shared { initial_shared_version } = owned_ref.owner else { - anyhow::bail!("Identity \"{}\" is not a shared object", owned_ref.object_id()); + anyhow::bail!("Object \"{}\" is not a shared object", owned_ref.object_id()); }; ptb.obj(ObjectArg::SharedObject { id: owned_ref.object_id(), diff --git a/identity_iota_core/src/rebased/iota/package.rs b/identity_iota_core/src/rebased/iota/package.rs index 7da9147b57..b8a45d0896 100644 --- a/identity_iota_core/src/rebased/iota/package.rs +++ b/identity_iota_core/src/rebased/iota/package.rs @@ -7,7 +7,8 @@ use std::collections::HashMap; use std::sync::LazyLock; use anyhow::Context; -use identity_iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectID; +use product_core::core_client::CoreClientReadOnly; use serde::Deserialize; use serde::Deserializer; use serde::Serialize; @@ -16,7 +17,6 @@ use tokio::sync::RwLockReadGuard; use tokio::sync::RwLockWriteGuard; use tokio::sync::TryLockError; -use crate::rebased::client::CoreClientReadOnly; use crate::rebased::Error; pub(crate) const MAINNET_CHAIN_ID: &str = "6364aad5"; diff --git a/identity_iota_core/src/rebased/iota/types/mod.rs b/identity_iota_core/src/rebased/iota/types/mod.rs index fdf352f8ff..b2fe842d05 100644 --- a/identity_iota_core/src/rebased/iota/types/mod.rs +++ b/identity_iota_core/src/rebased/iota/types/mod.rs @@ -3,8 +3,8 @@ mod number; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::id::UID; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::id::UID; pub(crate) use number::*; use serde::Deserialize; use serde::Serialize; diff --git a/identity_iota_core/src/rebased/migration/alias.rs b/identity_iota_core/src/rebased/migration/alias.rs index 2022db4447..2fa395c1f5 100644 --- a/identity_iota_core/src/rebased/migration/alias.rs +++ b/identity_iota_core/src/rebased/migration/alias.rs @@ -4,33 +4,34 @@ use async_trait::async_trait; use identity_core::common::Url; use identity_did::DID as _; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::id::UID; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::types::STARDUST_PACKAGE_ID; -use identity_iota_interaction::IotaTransactionBlockEffectsMutAPI as _; -use identity_iota_interaction::OptionalSync; +use iota_interaction::rpc_types::IotaExecutionStatus; +use iota_interaction::rpc_types::IotaObjectDataOptions; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::id::UID; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::types::TypeTag; +use iota_interaction::types::STARDUST_PACKAGE_ID; +use iota_interaction::IotaTransactionBlockEffectsMutAPI as _; +use iota_interaction::OptionalSync; + +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::Transaction; use serde; use serde::Deserialize; use serde::Serialize; use tokio::sync::OnceCell; -use crate::iota_interaction_adapter::MigrationMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; use crate::rebased::client::IdentityClientReadOnly; + +use crate::rebased::iota::move_calls; use crate::rebased::iota::package::identity_package_id; -use crate::rebased::transaction_builder::Transaction; use crate::rebased::Error; use crate::IotaDID; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::MigrationMoveCalls; -use identity_iota_interaction::MoveType; +use iota_interaction::IotaClientTrait; +use iota_interaction::MoveType; use super::get_identity; use super::migration_registry_id; @@ -154,7 +155,7 @@ impl MigrateLegacyIdentity { let package = identity_package_id(client).await?; // Build migration tx. - let tx = MigrationMoveCallsAdapter::migrate_did_output(alias_output_ref, created, migration_registry_ref, package) + let tx = move_calls::migration::migrate_did_output(alias_output_ref, created, migration_registry_ref, package) .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; Ok(bcs::from_bytes(&tx)?) @@ -165,24 +166,21 @@ impl MigrateLegacyIdentity { #[cfg_attr(feature = "send-sync", async_trait)] impl Transaction for MigrateLegacyIdentity { type Output = OnChainIdentity; + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.to_string())), effects); + return Err(Error::TransactionUnexpectedResponse(error.to_string())); } let legacy_did: Url = IotaDID::new(&self.alias.id.object_id().into_bytes(), client.network_name()) @@ -212,16 +210,13 @@ impl Transaction for MigrateLegacyIdentity { } let (Some(i), Some(identity)) = (target_identity_pos, target_identity) else { - return ( - Err(Error::TransactionUnexpectedResponse( - "failed to find the correct identity in this transaction's effects".to_owned(), - )), - effects, - ); + return Err(Error::TransactionUnexpectedResponse( + "failed to find the correct identity in this transaction's effects".to_owned(), + )); }; effects.created_mut().swap_remove(i); - (Ok(identity), effects) + Ok(identity) } } diff --git a/identity_iota_core/src/rebased/migration/controller_token.rs b/identity_iota_core/src/rebased/migration/controller_token.rs index 660a8bee81..dd6bad4c0b 100644 --- a/identity_iota_core/src/rebased/migration/controller_token.rs +++ b/identity_iota_core/src/rebased/migration/controller_token.rs @@ -1,6 +1,33 @@ // Copyright 2020-2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use super::OnChainIdentity; + +use crate::rebased::iota::move_calls; + +use crate::rebased::iota::move_calls::ControllerTokenRef; +use crate::rebased::iota::package::identity_package_id; +use crate::rebased::Error; +use async_trait::async_trait; +use iota_interaction::move_types::language_storage::TypeTag; +use iota_interaction::rpc_types::IotaExecutionStatus; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::id::UID; +use iota_interaction::types::object::Owner; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::IotaTransactionBlockEffectsMutAPI; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; +use itertools::Itertools as _; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; +use serde::Deserialize; +use serde::Deserializer; +use serde::Serialize; use std::ops::BitAnd; use std::ops::BitAndAssign; use std::ops::BitOr; @@ -8,36 +35,6 @@ use std::ops::BitOrAssign; use std::ops::BitXor; use std::ops::BitXorAssign; use std::ops::Not; - -use async_trait::async_trait; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::id::UID; -use identity_iota_interaction::types::object::Owner; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::ControllerTokenRef; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::IotaTransactionBlockEffectsMutAPI as _; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::OptionalSync; -use itertools::Itertools as _; -use serde::Deserialize; -use serde::Deserializer; -use serde::Serialize; - -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; -use crate::rebased::iota::package::identity_package_id; -use crate::rebased::transaction_builder::Transaction; -use crate::rebased::transaction_builder::TransactionBuilder; -use crate::rebased::Error; - -use super::OnChainIdentity; - /// A token that proves ownership over an object. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -385,8 +382,8 @@ impl DelegateToken { #[cfg_attr(not(feature = "send-sync"), async_trait(?Send))] impl Transaction for DelegateToken { type Output = DelegationToken; - - async fn build_programmable_transaction(&self, client: &C) -> Result + type Error = Error; + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { @@ -398,26 +395,18 @@ impl Transaction for DelegateToken { .reference .to_object_ref(); - let ptb_bcs = IdentityMoveCallsAdapter::delegate_controller_cap( - controller_cap_ref, - self.recipient, - self.permissions.0, - package, - ) - .await?; + let ptb_bcs = + move_calls::identity::delegate_controller_cap(controller_cap_ref, self.recipient, self.permissions.0, package) + .await?; Ok(bcs::from_bytes(&ptb_bcs)?) } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } let created_objects = effects @@ -444,17 +433,14 @@ impl Transaction for DelegateToken { } let (Some(i), Some(token)) = (target_token_pos, target_token) else { - return ( - Err(Error::TransactionUnexpectedResponse( - "failed to find the correct identity in this transaction's effects".to_owned(), - )), - effects, - ); + return Err(Error::TransactionUnexpectedResponse( + "failed to find the correct identity in this transaction's effects".to_owned(), + )); }; effects.created_mut().swap_remove(i); - (Ok(token), effects) + Ok(token) } } @@ -523,8 +509,9 @@ impl DelegationTokenRevocation { #[cfg_attr(not(feature = "send-sync"), async_trait(?Send))] impl Transaction for DelegationTokenRevocation { type Output = (); + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { @@ -541,38 +528,28 @@ impl Transaction for DelegationTokenRevocation { .to_object_ref(); let tx_bytes = if self.is_revocation() { - IdentityMoveCallsAdapter::revoke_delegation_token( - identity_ref, - controller_cap_ref, - self.delegation_token_id, - package, - ) + move_calls::identity::revoke_delegation_token(identity_ref, controller_cap_ref, self.delegation_token_id, package) } else { - IdentityMoveCallsAdapter::unrevoke_delegation_token( + move_calls::identity::unrevoke_delegation_token( identity_ref, controller_cap_ref, self.delegation_token_id, package, ) - } - .await?; + }?; Ok(bcs::from_bytes(&tx_bytes)?) } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } - (Ok(()), effects) + Ok(()) } } @@ -610,8 +587,9 @@ impl DeleteDelegationToken { #[cfg_attr(not(feature = "send-sync"), async_trait(?Send))] impl Transaction for DeleteDelegationToken { type Output = (); + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { @@ -632,22 +610,17 @@ impl Transaction for DeleteDelegationToken { .reference .to_object_ref(); - let tx_bytes = - IdentityMoveCallsAdapter::destroy_delegation_token(identity_ref, delegation_token_ref, package).await?; + let tx_bytes = move_calls::identity::destroy_delegation_token(identity_ref, delegation_token_ref, package).await?; Ok(bcs::from_bytes(&tx_bytes)?) } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } let Some(deleted_token_pos) = effects @@ -656,17 +629,14 @@ impl Transaction for DeleteDelegationToken { .find_position(|obj_ref| obj_ref.object_id == self.delegation_token_id) .map(|(pos, _)| pos) else { - return ( - Err(Error::TransactionUnexpectedResponse(format!( - "DelegationToken {} wasn't deleted in this transaction", - self.delegation_token_id, - ))), - effects, - ); + return Err(Error::TransactionUnexpectedResponse(format!( + "DelegationToken {} wasn't deleted in this transaction", + self.delegation_token_id, + ))); }; effects.deleted_mut().swap_remove(deleted_token_pos); - (Ok(()), effects) + Ok(()) } } diff --git a/identity_iota_core/src/rebased/migration/identity.rs b/identity_iota_core/src/rebased/migration/identity.rs index 0502b387ae..9cf8016076 100644 --- a/identity_iota_core/src/rebased/migration/identity.rs +++ b/identity_iota_core/src/rebased/migration/identity.rs @@ -4,15 +4,18 @@ use std::collections::HashMap; use std::collections::HashSet; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; +use crate::rebased::iota::move_calls; + use crate::rebased::iota::package::identity_package_id; -use crate::rebased::transaction_builder::Transaction; -use crate::rebased::transaction_builder::TransactionBuilder; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::IotaTransactionBlockEffectsMutAPI as _; -use identity_iota_interaction::OptionalSync; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::IotaKeySignature; +use iota_interaction::IotaTransactionBlockEffectsMutAPI as _; +use iota_interaction::OptionalSync; +use product_core::core_client::CoreClient; +use product_core::core_client::CoreClientReadOnly; +use product_core::network_name::NetworkName; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; use secret_storage::Signer; use tokio::sync::OnceCell; @@ -20,32 +23,30 @@ use crate::rebased::iota::types::Number; use crate::rebased::proposals::Upgrade; use crate::IotaDID; use crate::IotaDocument; -use crate::NetworkName; + use crate::StateMetadataDocument; use crate::StateMetadataEncoding; use async_trait::async_trait; use identity_core::common::Timestamp; -use identity_iota_interaction::ident_str; -use identity_iota_interaction::move_types::language_storage::StructTag; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaParsedData; -use identity_iota_interaction::rpc_types::IotaParsedMoveObject; -use identity_iota_interaction::rpc_types::IotaPastObjectResponse; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::id::UID; -use identity_iota_interaction::types::object::Owner; -use identity_iota_interaction::types::TypeTag; +use iota_interaction::ident_str; +use iota_interaction::move_types::language_storage::StructTag; +use iota_interaction::rpc_types::IotaExecutionStatus; +use iota_interaction::rpc_types::IotaObjectData; +use iota_interaction::rpc_types::IotaObjectDataOptions; +use iota_interaction::rpc_types::IotaParsedData; +use iota_interaction::rpc_types::IotaParsedMoveObject; +use iota_interaction::rpc_types::IotaPastObjectResponse; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::id::UID; +use iota_interaction::types::object::Owner; +use iota_interaction::types::TypeTag; use serde; use serde::Deserialize; use serde::Serialize; -use crate::rebased::client::CoreClient; -use crate::rebased::client::CoreClientReadOnly; use crate::rebased::client::IdentityClient; use crate::rebased::client::IdentityClientReadOnly; use crate::rebased::proposals::BorrowAction; @@ -56,8 +57,8 @@ use crate::rebased::proposals::SendAction; use crate::rebased::proposals::UpdateDidDocument; use crate::rebased::rebased_err; use crate::rebased::Error; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::MoveType; +use iota_interaction::IotaClientTrait; +use iota_interaction::MoveType; use super::ControllerCap; use super::ControllerToken; @@ -303,7 +304,7 @@ impl OnChainIdentity { } else { // no version given, this version will be included in history let version = identity_ref.version(); - let response = client.get_past_object(object_id, version).await?; + let response = client.get_past_object(object_id, version).await.map_err(rebased_err)?; let latest_version = if let IotaPastObjectResponse::VersionFound(response_value) = response { response_value } else { @@ -629,7 +630,7 @@ impl CreateIdentity { .pack(StateMetadataEncoding::default()) .map_err(|e| Error::DidDocSerialization(e.to_string()))?; let pt_bcs = if controllers.is_empty() { - IdentityMoveCallsAdapter::new_identity(Some(&did_doc), package).await? + move_calls::identity::new_identity(Some(&did_doc), package).await? } else { let threshold = match threshold { Some(t) => t, @@ -649,7 +650,7 @@ impl CreateIdentity { let controllers = controllers .iter() .map(|(addr, (vp, can_delegate))| (*addr, *vp, *can_delegate)); - IdentityMoveCallsAdapter::new_with_controllers(Some(&did_doc), controllers, *threshold, package).await? + move_calls::identity::new_with_controllers(Some(&did_doc), controllers, *threshold, package).await? }; Ok(bcs::from_bytes(&pt_bcs)?) @@ -660,8 +661,9 @@ impl CreateIdentity { #[cfg_attr(feature = "send-sync", async_trait)] impl Transaction for CreateIdentity { type Output = OnChainIdentity; + type Error = Error; - async fn build_programmable_transaction(&self, client: &C) -> Result + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { @@ -670,14 +672,14 @@ impl Transaction for CreateIdentity { async fn apply( mut self, - mut effects: IotaTransactionBlockEffects, + effects: &mut IotaTransactionBlockEffects, client: &C, - ) -> (Result, IotaTransactionBlockEffects) + ) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } let created_objects = effects @@ -687,13 +689,10 @@ impl Transaction for CreateIdentity { .filter(|(_, elem)| matches!(elem.owner, Owner::Shared { .. })) .map(|(i, obj)| (i, obj.object_id())); - let target_did_bytes = match StateMetadataDocument::from(self.builder.did_doc) + let target_did_bytes = StateMetadataDocument::from(self.builder.did_doc) .pack(StateMetadataEncoding::Json) - .map_err(|e| Error::DidDocSerialization(e.to_string())) - { - Ok(did_doc_bytes) => did_doc_bytes, - Err(e) => return (Err(e), effects), - }; + .map_err(|e| Error::DidDocSerialization(e.to_string()))?; + let is_target_identity = |identity: &OnChainIdentity| -> bool { let did_bytes = identity .multicontroller() @@ -717,16 +716,13 @@ impl Transaction for CreateIdentity { } let (Some(i), Some(identity)) = (target_identity_pos, target_identity) else { - return ( - Err(Error::TransactionUnexpectedResponse( - "failed to find the correct identity in this transaction's effects".to_owned(), - )), - effects, - ); + return Err(Error::TransactionUnexpectedResponse( + "failed to find the correct identity in this transaction's effects".to_owned(), + )); }; effects.created_mut().swap_remove(i); - (Ok(identity), effects) + Ok(identity) } } diff --git a/identity_iota_core/src/rebased/migration/multicontroller.rs b/identity_iota_core/src/rebased/migration/multicontroller.rs index 5002fb67d8..73f2f80518 100644 --- a/identity_iota_core/src/rebased/migration/multicontroller.rs +++ b/identity_iota_core/src/rebased/migration/multicontroller.rs @@ -6,11 +6,11 @@ use std::collections::HashSet; use crate::rebased::iota::types::Bag; use crate::rebased::iota::types::Number; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::collection_types::Entry; -use identity_iota_interaction::types::collection_types::VecMap; -use identity_iota_interaction::types::collection_types::VecSet; -use identity_iota_interaction::types::id::UID; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::collection_types::Entry; +use iota_interaction::types::collection_types::VecMap; +use iota_interaction::types::collection_types::VecSet; +use iota_interaction::types::id::UID; use serde::Deserialize; use serde::Serialize; diff --git a/identity_iota_core/src/rebased/migration/registry.rs b/identity_iota_core/src/rebased/migration/registry.rs index 183749feff..a3d71fc478 100644 --- a/identity_iota_core/src/rebased/migration/registry.rs +++ b/identity_iota_core/src/rebased/migration/registry.rs @@ -5,17 +5,17 @@ use std::collections::HashMap; use std::str::FromStr as _; use std::sync::LazyLock; -use identity_iota_interaction::move_types::language_storage::StructTag; -use identity_iota_interaction::rpc_types::EventFilter; -use identity_iota_interaction::rpc_types::IotaData; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::id::ID; -use identity_iota_interaction::IotaClientTrait; +use iota_interaction::move_types::language_storage::StructTag; +use iota_interaction::rpc_types::EventFilter; +use iota_interaction::rpc_types::IotaData; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::id::ID; +use iota_interaction::IotaClientTrait; use phf::phf_map; use phf::Map; +use product_core::core_client::CoreClientReadOnly; use tokio::sync::RwLock; -use crate::rebased::client::CoreClientReadOnly; use crate::rebased::client::IdentityClientReadOnly; use crate::rebased::iota::package::identity_package_registry; diff --git a/identity_iota_core/src/rebased/mod.rs b/identity_iota_core/src/rebased/mod.rs index fe1e45a56e..1f3849e953 100644 --- a/identity_iota_core/src/rebased/mod.rs +++ b/identity_iota_core/src/rebased/mod.rs @@ -11,10 +11,6 @@ mod iota; pub mod migration; /// Contains the operations of proposals. pub mod proposals; -/// Module for handling transactions. -pub mod transaction; -/// Module for creating transactions using a builder style pattern. -pub mod transaction_builder; /// Contains utility functions. #[cfg(not(target_arch = "wasm32"))] pub mod utils; @@ -24,4 +20,4 @@ pub use error::*; /// Integration with IOTA's Keytool. #[cfg(feature = "keytool")] -pub use identity_iota_interaction::keytool; +pub use iota_interaction::keytool; diff --git a/identity_iota_core/src/rebased/proposals/borrow.rs b/identity_iota_core/src/rebased/proposals/borrow.rs index c68754c054..23af39167c 100644 --- a/identity_iota_core/src/rebased/proposals/borrow.rs +++ b/identity_iota_core/src/rebased/proposals/borrow.rs @@ -4,30 +4,31 @@ use std::collections::HashMap; use std::marker::PhantomData; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; +use crate::rebased::iota::move_calls; use crate::rebased::iota::package::identity_package_id; + use crate::rebased::migration::ControllerToken; -use crate::rebased::transaction_builder::Transaction; -use crate::rebased::transaction_builder::TransactionBuilder; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::OptionalSync; + +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; +use product_core::transaction::ProtoTransaction; use serde::Deserialize; use tokio::sync::Mutex; use crate::rebased::migration::Proposal; -use crate::rebased::transaction::ProtoTransaction; use crate::rebased::Error; use async_trait::async_trait; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::MoveType; +use iota_interaction::rpc_types::IotaExecutionStatus; +use iota_interaction::rpc_types::IotaObjectData; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::transaction::Argument; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::types::TypeTag; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; use serde::Serialize; use super::CreateProposal; @@ -38,7 +39,7 @@ use super::UserDrivenTx; cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { - use iota_interaction_ts::NativeTsTransactionBuilderBindingWrapper as Ptb; + use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; /// Instances of BorrowIntentFnT can be used as user-provided function to describe how /// a borrowed assets shall be used. pub trait BorrowIntentFnT: FnOnce(&mut Ptb, &HashMap) {} @@ -47,7 +48,7 @@ cfg_if::cfg_if! { #[allow(unreachable_pub)] pub type BorrowIntentFn = Box; } else { - use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; + use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; /// Instances of BorrowIntentFnT can be used as user-provided function to describe how /// a borrowed assets shall be used. pub trait BorrowIntentFnT: FnOnce(&mut Ptb, &HashMap) {} @@ -207,7 +208,7 @@ where } object_data_list }; - IdentityMoveCallsAdapter::create_and_execute_borrow( + move_calls::identity::create_and_execute_borrow( identity_ref, controller_cap_ref, object_data_list, @@ -216,7 +217,7 @@ where package, ) } else { - IdentityMoveCallsAdapter::propose_borrow(identity_ref, controller_cap_ref, action.objects, expiration, package) + move_calls::identity::propose_borrow(identity_ref, controller_cap_ref, action.objects, expiration, package) } .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; @@ -319,9 +320,8 @@ where } object_data_list }; - let package = identity_package_id(client).await?; - let tx = IdentityMoveCallsAdapter::execute_borrow( + let tx = move_calls::identity::execute_borrow( identity_ref, controller_token_ref, *proposal_id, @@ -346,24 +346,23 @@ where F: BorrowIntentFnT + Send, { type Output = (); - async fn build_programmable_transaction(&self, client: &C) -> Result + type Error = Error; + + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } - (Ok(()), effects) + Ok(()) } } diff --git a/identity_iota_core/src/rebased/proposals/config_change.rs b/identity_iota_core/src/rebased/proposals/config_change.rs index 90f98a0da9..fdb300f107 100644 --- a/identity_iota_core/src/rebased/proposals/config_change.rs +++ b/identity_iota_core/src/rebased/proposals/config_change.rs @@ -1,35 +1,35 @@ // Copyright 2020-2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use crate::rebased::iota::package::identity_package_id; + use std::collections::HashMap; use std::collections::HashSet; use std::marker::PhantomData; use std::ops::DerefMut as _; use std::str::FromStr as _; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; -use crate::rebased::iota::package::identity_package_id; +use crate::rebased::iota::move_calls; use crate::rebased::migration::ControllerToken; -use crate::rebased::transaction_builder::TransactionBuilder; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::OptionalSync; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::TransactionBuilder; use crate::rebased::migration::Proposal; use async_trait::async_trait; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::collection_types::Entry; -use identity_iota_interaction::types::collection_types::VecMap; -use identity_iota_interaction::types::TypeTag; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::collection_types::Entry; +use iota_interaction::types::collection_types::VecMap; +use iota_interaction::types::TypeTag; use serde::Deserialize; use serde::Serialize; use crate::rebased::iota::types::Number; use crate::rebased::migration::OnChainIdentity; use crate::rebased::Error; -use identity_iota_interaction::MoveType; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; use super::CreateProposal; use super::ExecuteProposal; @@ -254,7 +254,7 @@ impl ProposalT for Proposal { .controller_voting_power(controller_token.controller_id()) .expect("controller exists"); let chained_execution = sender_vp >= identity.threshold(); - let tx = IdentityMoveCallsAdapter::propose_config_change( + let tx = move_calls::identity::propose_config_change( identity_ref, controller_cap_ref, expiration, @@ -297,9 +297,8 @@ impl ProposalT for Proposal { .await? .expect("identity exists on-chain"); let controller_cap_ref = controller_token.controller_ref(client).await?; - let package = identity_package_id(client).await?; - let tx = IdentityMoveCallsAdapter::execute_config_change(identity_ref, controller_cap_ref, proposal_id, package) + let tx = move_calls::identity::execute_config_change(identity_ref, controller_cap_ref, proposal_id, package) .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; Ok(TransactionBuilder::new(ExecuteProposal { diff --git a/identity_iota_core/src/rebased/proposals/controller.rs b/identity_iota_core/src/rebased/proposals/controller.rs index 038e2e10c2..cb9c7b1ed0 100644 --- a/identity_iota_core/src/rebased/proposals/controller.rs +++ b/identity_iota_core/src/rebased/proposals/controller.rs @@ -3,33 +3,32 @@ use std::marker::PhantomData; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; +use crate::rebased::iota::move_calls; use crate::rebased::iota::package::identity_package_id; use crate::rebased::migration::ControllerToken; -use crate::rebased::transaction_builder::Transaction; -use crate::rebased::transaction_builder::TransactionBuilder; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::OptionalSync; -use tokio::sync::Mutex; - use crate::rebased::migration::Proposal; -use crate::rebased::transaction::ProtoTransaction; + use crate::rebased::Error; use async_trait::async_trait; -use identity_iota_interaction::rpc_types::IotaObjectRef; -use identity_iota_interaction::rpc_types::OwnedObjectRef; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::transaction::Argument; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::MoveType; +use iota_interaction::rpc_types::IotaExecutionStatus; +use iota_interaction::rpc_types::IotaObjectRef; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI; +use iota_interaction::rpc_types::OwnedObjectRef; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::transaction::Argument; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::types::TypeTag; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; +use product_core::transaction::ProtoTransaction; use serde::Deserialize; use serde::Serialize; +use tokio::sync::Mutex; use super::CreateProposal; use super::OnChainIdentity; @@ -39,7 +38,7 @@ use super::UserDrivenTx; cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { - use iota_interaction_ts::NativeTsTransactionBuilderBindingWrapper as Ptb; + use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; /// Instances of ControllerIntentFnT can be used as user-provided function to describe how /// a borrowed identity's controller capability will be used. pub trait ControllerIntentFnT: FnOnce(&mut Ptb, &Argument) {} @@ -48,7 +47,7 @@ cfg_if::cfg_if! { /// Boxed dynamic trait object of {@link ControllerIntentFnT} pub type ControllerIntentFn = Box; } else { - use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; + use iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder as Ptb; /// Instances of ControllerIntentFnT can be used as user-provided function to describe how /// a borrowed identity's controller capability will be used. pub trait ControllerIntentFnT: FnOnce(&mut Ptb, &Argument) {} @@ -200,7 +199,7 @@ where }) .ok_or_else(|| Error::ObjectLookup(format!("object {} doesn't exist", action.controller_cap)))?; - IdentityMoveCallsAdapter::create_and_execute_controller_execution( + move_calls::identity::create_and_execute_controller_execution( identity_ref, controller_cap_ref, expiration, @@ -209,7 +208,7 @@ where package, ) } else { - IdentityMoveCallsAdapter::propose_controller_execution( + move_calls::identity::propose_controller_execution( identity_ref, controller_cap_ref, action.controller_cap, @@ -321,9 +320,9 @@ where .await? .map(|object_ref| object_ref.reference.to_object_ref()) .ok_or_else(|| Error::ObjectLookup(format!("object {borrowing_cap_id} doesn't exist")))?; - let package = identity_package_id(client).await?; - let tx = IdentityMoveCallsAdapter::execute_controller_execution( + + let tx = move_calls::identity::execute_controller_execution( identity_ref, controller_cap_ref, *proposal_id, @@ -350,24 +349,22 @@ where F: ControllerIntentFnT + Send, { type Output = (); - async fn build_programmable_transaction(&self, client: &C) -> Result + type Error = Error; + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result<(), Error>, IotaTransactionBlockEffects) + + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result<(), Self::Error> where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } - (Ok(()), effects) + Ok(()) } } diff --git a/identity_iota_core/src/rebased/proposals/mod.rs b/identity_iota_core/src/rebased/proposals/mod.rs index ae35ccdd00..b697eeb5a6 100644 --- a/identity_iota_core/src/rebased/proposals/mod.rs +++ b/identity_iota_core/src/rebased/proposals/mod.rs @@ -12,44 +12,42 @@ use std::marker::PhantomData; use std::ops::Deref; use std::ops::DerefMut; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; - -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::OptionalSend; -use identity_iota_interaction::OptionalSync; -use tokio::sync::OnceCell; - +use crate::rebased::iota::move_calls; use crate::rebased::migration::get_identity; -use crate::rebased::transaction::ProtoTransaction; -use crate::rebased::transaction_builder::Transaction; -use crate::rebased::transaction_builder::TransactionBuilder; use async_trait::async_trait; pub use borrow::*; pub use config_change::*; pub use controller::*; -use identity_iota_interaction::rpc_types::IotaExecutionStatus; -use identity_iota_interaction::rpc_types::IotaObjectData; -use identity_iota_interaction::rpc_types::IotaObjectDataOptions; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::base_types::ObjectType; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::TypeTag; +use iota_interaction::rpc_types::IotaExecutionStatus; +use iota_interaction::rpc_types::IotaObjectData; +use iota_interaction::rpc_types::IotaObjectDataOptions; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectRef; +use iota_interaction::types::base_types::ObjectType; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::types::TypeTag; +use iota_interaction::IotaClientTrait; +use iota_interaction::OptionalSend; +use iota_interaction::OptionalSync; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; +use product_core::transaction::ProtoTransaction; +use tokio::sync::OnceCell; + pub use send::*; use serde::de::DeserializeOwned; pub use update_did_doc::*; pub use upgrade::*; +use super::iota::package::identity_package_id; use crate::rebased::migration::OnChainIdentity; use crate::rebased::migration::Proposal; use crate::rebased::Error; -use identity_iota_interaction::MoveType; +use iota_interaction::MoveType; -use super::client::CoreClientReadOnly; -use super::iota::package::identity_package_id; use super::migration::ControllerToken; /// Interface that allows the creation and execution of an [`OnChainIdentity`]'s [`Proposal`]s. @@ -192,6 +190,7 @@ where A: OptionalSend + OptionalSync, { type Output = ProposalResult>; + type Error = Error; async fn build_programmable_transaction(&self, _client: &C) -> Result where @@ -200,11 +199,7 @@ where Ok(self.ptb.clone()) } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { @@ -215,20 +210,18 @@ where } = self; if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } // Identity has been changed regardless of whether the proposal has been executed // or simply created. Refetch it, to sync it with its on-chain state. - match get_identity(client, identity.id()).await { - Ok(maybe_identity) => *identity = maybe_identity.expect("This identity already exists on-chain"), - Err(e) => return (Err(e), effects), - } + *identity = get_identity(client, identity.id()) + .await? + .ok_or_else(|| Error::Identity(format!("identity {} cannot be found", identity.id())))?; if chained_execution { // The proposal has been created and executed right-away. Parse its effects. - let apply_result = Proposal::::parse_tx_effects(&effects).map(ProposalResult::Executed); - (apply_result, effects) + Proposal::::parse_tx_effects(effects).map(ProposalResult::Executed) } else { // 2 objects are created, one is the Bag's Field and the other is our Proposal. Proposal is not owned by the bag, // but the field is. @@ -240,13 +233,11 @@ where .expect("tx was successful") .object_id(); - let apply_result = client + client .get_object_by_id(proposal_id) .await .map_err(Error::from) - .map(ProposalResult::Pending); - - (apply_result, effects) + .map(ProposalResult::Pending) } } } @@ -274,32 +265,30 @@ where A: OptionalSend + OptionalSync, { type Output = as ProposalT>::Output; + type Error = Error; + async fn build_programmable_transaction(&self, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { Ok(self.ptb.clone()) } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { let Self { identity, .. } = self; if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } - match get_identity(client, identity.id()).await { - Ok(maybe_identity) => *identity = maybe_identity.expect("This identity already exists on-chain"), - Err(e) => return (Err(e), effects), - } + *identity = get_identity(client, identity.id()) + .await? + .ok_or_else(|| Error::Identity(format!("identity {} cannot be found", identity.id())))?; - (Proposal::::parse_tx_effects(&effects), effects) + Proposal::::parse_tx_effects(effects) } } @@ -352,12 +341,8 @@ impl ApproveProposal<'_, '_, A> { .ok_or_else(|| Error::Identity(format!("identity {} doesn't exist", identity.id())))?; let controller_cap = controller_token.controller_ref(client).await?; let package = identity_package_id(client).await?; - let tx = ::approve_proposal::( - identity_ref.clone(), - controller_cap, - proposal.id(), - package, - )?; + + let tx = move_calls::identity::approve_proposal::(identity_ref.clone(), controller_cap, proposal.id(), package)?; Ok(bcs::from_bytes(&tx)?) } @@ -371,22 +356,20 @@ where A: MoveType + OptionalSend + OptionalSync, { type Output = (); - async fn build_programmable_transaction(&self, client: &C) -> Result + type Error = Error; + + async fn build_programmable_transaction(&self, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { self.cached_ptb.get_or_try_init(|| self.make_ptb(client)).await.cloned() } - async fn apply( - self, - effects: IotaTransactionBlockEffects, - _client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { if let IotaExecutionStatus::Failure { error } = effects.status() { - return (Err(Error::TransactionUnexpectedResponse(error.clone())), effects); + return Err(Error::TransactionUnexpectedResponse(error.clone())); } let proposal_was_updated = effects @@ -399,15 +382,12 @@ where .controller_voting_power(self.controller_token.controller_id()) .expect("is identity's controller"); *self.proposal.votes_mut() = self.proposal.votes() + vp; - (Ok(()), effects) + Ok(()) } else { - ( - Err(Error::TransactionUnexpectedResponse(format!( - "proposal {} wasn't updated in this transaction", - self.proposal.id() - ))), - effects, - ) + Err(Error::TransactionUnexpectedResponse(format!( + "proposal {} wasn't updated in this transaction", + self.proposal.id() + ))) } } } diff --git a/identity_iota_core/src/rebased/proposals/send.rs b/identity_iota_core/src/rebased/proposals/send.rs index cae120d165..524372c016 100644 --- a/identity_iota_core/src/rebased/proposals/send.rs +++ b/identity_iota_core/src/rebased/proposals/send.rs @@ -3,23 +3,22 @@ use std::marker::PhantomData; +use crate::rebased::iota::package::identity_package_id; use async_trait::async_trait; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::TypeTag; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::MoveType; -use identity_iota_interaction::OptionalSync; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::TypeTag; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::TransactionBuilder; use serde::Deserialize; use serde::Serialize; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; -use crate::rebased::iota::package::identity_package_id; +use crate::rebased::iota::move_calls; use crate::rebased::migration::ControllerToken; use crate::rebased::migration::OnChainIdentity; -use crate::rebased::transaction_builder::TransactionBuilder; use crate::rebased::Error; use super::CreateProposal; @@ -127,7 +126,7 @@ impl ProposalT for Proposal { } object_and_type_list }; - IdentityMoveCallsAdapter::create_and_execute_send( + move_calls::identity::create_and_execute_send( identity_ref, controller_cap_ref, action.0, @@ -136,7 +135,7 @@ impl ProposalT for Proposal { package, ) } else { - IdentityMoveCallsAdapter::propose_send(identity_ref, controller_cap_ref, action.0, expiration, package) + move_calls::identity::propose_send(identity_ref, controller_cap_ref, action.0, expiration, package) } .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; Ok(TransactionBuilder::new(CreateProposal { @@ -182,10 +181,10 @@ impl ProposalT for Proposal { } object_and_type_list }; - let package = identity_package_id(client).await?; + let tx = - IdentityMoveCallsAdapter::execute_send(identity_ref, controller_cap_ref, proposal_id, object_type_list, package) + move_calls::identity::execute_send(identity_ref, controller_cap_ref, proposal_id, object_type_list, package) .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; Ok(TransactionBuilder::new(ExecuteProposal { diff --git a/identity_iota_core/src/rebased/proposals/update_did_doc.rs b/identity_iota_core/src/rebased/proposals/update_did_doc.rs index 1516dcbf5a..44378f2c24 100644 --- a/identity_iota_core/src/rebased/proposals/update_did_doc.rs +++ b/identity_iota_core/src/rebased/proposals/update_did_doc.rs @@ -1,28 +1,26 @@ // Copyright 2020-2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use iota_interaction::OptionalSync; +use crate::rebased::iota::package::identity_package_id; use std::marker::PhantomData; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::OptionalSync; - -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; -use crate::rebased::iota::package::identity_package_id; +use crate::rebased::iota::move_calls; use crate::rebased::migration::ControllerToken; -use crate::rebased::transaction_builder::TransactionBuilder; use crate::IotaDocument; use async_trait::async_trait; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::TypeTag; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::TypeTag; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::TransactionBuilder; use serde::Deserialize; use serde::Serialize; use crate::rebased::migration::OnChainIdentity; use crate::rebased::migration::Proposal; use crate::rebased::Error; -use identity_iota_interaction::MoveType; +use iota_interaction::MoveType; use super::CreateProposal; use super::ExecuteProposal; @@ -103,7 +101,7 @@ impl ProposalT for Proposal { .controller_voting_power(controller_token.controller_id()) .expect("controller exists"); let chained_execution = sender_vp >= identity.threshold(); - let tx = IdentityMoveCallsAdapter::propose_update( + let tx = move_calls::identity::propose_update( identity_ref, controller_cap_ref, action.0.as_deref(), @@ -149,9 +147,9 @@ impl ProposalT for Proposal { .await? .expect("identity exists on-chain"); let controller_cap_ref = controller_token.controller_ref(client).await?; - let package = identity_package_id(client).await?; - let tx = IdentityMoveCallsAdapter::execute_update(identity_ref, controller_cap_ref, proposal_id, package) + + let tx = move_calls::identity::execute_update(identity_ref, controller_cap_ref, proposal_id, package) .await .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; diff --git a/identity_iota_core/src/rebased/proposals/upgrade.rs b/identity_iota_core/src/rebased/proposals/upgrade.rs index df431e3939..8f1eb59d40 100644 --- a/identity_iota_core/src/rebased/proposals/upgrade.rs +++ b/identity_iota_core/src/rebased/proposals/upgrade.rs @@ -3,25 +3,24 @@ use std::marker::PhantomData; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::IdentityMoveCalls; -use identity_iota_interaction::OptionalSync; +use iota_interaction::rpc_types::IotaTransactionBlockEffects; +use product_core::core_client::CoreClientReadOnly; +use product_core::transaction::transaction_builder::TransactionBuilder; -use crate::iota_interaction_adapter::IdentityMoveCallsAdapter; -use crate::rebased::client::CoreClientReadOnly; +use crate::rebased::iota::move_calls; use crate::rebased::iota::package::identity_package_id; use crate::rebased::migration::ControllerToken; -use crate::rebased::transaction_builder::TransactionBuilder; use async_trait::async_trait; -use identity_iota_interaction::types::base_types::ObjectID; -use identity_iota_interaction::types::TypeTag; +use iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::TypeTag; use serde::Deserialize; use serde::Serialize; use crate::rebased::migration::OnChainIdentity; use crate::rebased::migration::Proposal; use crate::rebased::Error; -use identity_iota_interaction::MoveType; +use iota_interaction::MoveType; +use iota_interaction::OptionalSync; use super::CreateProposal; use super::ExecuteProposal; @@ -80,7 +79,8 @@ impl ProposalT for Proposal { .expect("controller exists"); let chained_execution = sender_vp >= identity.threshold(); let package = identity_package_id(client).await?; - let tx = IdentityMoveCallsAdapter::propose_upgrade(identity_ref, controller_cap_ref, expiration, package) + + let tx = move_calls::identity::propose_upgrade(identity_ref, controller_cap_ref, expiration, package) .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; Ok(TransactionBuilder::new(CreateProposal { @@ -114,9 +114,9 @@ impl ProposalT for Proposal { .await? .expect("identity exists on-chain"); let controller_cap_ref = controller_token.controller_ref(client).await?; - let package = identity_package_id(client).await?; - let tx = IdentityMoveCallsAdapter::execute_upgrade(identity_ref, controller_cap_ref, proposal_id, package) + + let tx = move_calls::identity::execute_upgrade(identity_ref, controller_cap_ref, proposal_id, package) .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; Ok(TransactionBuilder::new(ExecuteProposal { diff --git a/identity_iota_core/src/rebased/transaction.rs b/identity_iota_core/src/rebased/transaction.rs deleted file mode 100644 index cfdc790ca5..0000000000 --- a/identity_iota_core/src/rebased/transaction.rs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::ops::Deref; - -#[cfg(not(target_arch = "wasm32"))] -use identity_iota_interaction::rpc_types::IotaTransactionBlockResponse; - -use super::transaction_builder::TransactionBuilder; -use crate::iota_interaction_adapter::IotaTransactionBlockResponseAdaptedTraitObj; - -/// The output type of a [`Transaction`]. -#[cfg(not(target_arch = "wasm32"))] -#[derive(Debug, Clone)] -pub struct TransactionOutput { - /// The parsed Transaction output. See [`Transaction::Output`]. - pub output: T, - /// The "raw" transaction execution response received. - pub response: IotaTransactionBlockResponse, -} - -/// The output type of a [`Transaction`]. -pub struct TransactionOutputInternal { - /// The parsed Transaction output. See [`Transaction::Output`]. - pub output: T, - /// The "raw" transaction execution response received. - pub response: IotaTransactionBlockResponseAdaptedTraitObj, -} - -impl Deref for TransactionOutputInternal { - type Target = T; - fn deref(&self) -> &Self::Target { - &self.output - } -} - -#[cfg(not(target_arch = "wasm32"))] -impl From> for TransactionOutput { - fn from(value: TransactionOutputInternal) -> Self { - let TransactionOutputInternal:: { - output: out, - response: internal_response, - } = value; - let response = internal_response.clone_native_response(); - TransactionOutput { output: out, response } - } -} - -/// Interface to describe an operation that can eventually -/// be turned into a [`Transaction`], given the right input. -pub trait ProtoTransaction { - /// The input required by this operation. - type Input; - /// This operation's next state. Can either be another [`ProtoTransaction`] - /// or a whole [`Transaction`] ready to be executed. - type Tx: ProtoTransaction; - - /// Feed this operation with its required input, advancing its - /// state to another [`ProtoTransaction`] that may or may not - /// be ready for execution. - fn with(self, input: Self::Input) -> Self::Tx; -} - -// Every Transaction is a QuasiTransaction that requires no input -// and that has itself as its next state. -impl ProtoTransaction for TransactionBuilder -where - T: super::transaction_builder::Transaction, -{ - type Input = (); - type Tx = Self; - - fn with(self, _: Self::Input) -> Self::Tx { - self - } -} diff --git a/identity_iota_core/src/rebased/transaction_builder.rs b/identity_iota_core/src/rebased/transaction_builder.rs deleted file mode 100644 index 24349521c3..0000000000 --- a/identity_iota_core/src/rebased/transaction_builder.rs +++ /dev/null @@ -1,513 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::ops::Deref; - -use anyhow::Context as _; -use async_trait::async_trait; -use cfg_if::cfg_if; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI as _; -use identity_iota_interaction::rpc_types::IotaTransactionBlockResponseOptions; -use identity_iota_interaction::shared_crypto::intent::Intent; -use identity_iota_interaction::shared_crypto::intent::IntentMessage; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::base_types::ObjectRef; -use identity_iota_interaction::types::crypto::IotaSignature as _; -use identity_iota_interaction::types::crypto::PublicKey; -use identity_iota_interaction::types::crypto::Signature; -use identity_iota_interaction::types::quorum_driver_types::ExecuteTransactionRequestType; -use identity_iota_interaction::types::transaction::GasData; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; -use identity_iota_interaction::types::transaction::TransactionData; -use identity_iota_interaction::types::transaction::TransactionDataAPI as _; -use identity_iota_interaction::types::transaction::TransactionKind; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::OptionalSync; -use itertools::Itertools; -use secret_storage::Signer; - -use super::client::CoreClient; -use super::client::CoreClientReadOnly; -#[cfg(not(target_arch = "wasm32"))] -use super::transaction::TransactionOutput; -#[cfg(target_arch = "wasm32")] -use super::transaction::TransactionOutputInternal as TransactionOutput; -use super::Error; - -/// An operation that combines a transaction with its off-chain effects. -#[cfg_attr(feature = "send-sync", async_trait)] -#[cfg_attr(not(feature = "send-sync"), async_trait(?Send))] -pub trait Transaction { - /// Output type for this transaction. - type Output; - - /// Encode this operation into a [ProgrammableTransaction]. - async fn build_programmable_transaction(&self, client: &C) -> Result - where - C: CoreClientReadOnly + OptionalSync; - - /// Parses a transaction result in order to compute its effects. - /// ## Notes - /// [Transaction::apply] implementations should make sure to properly consume - /// the parts of `effects` that are needed for the transaction - e.g., removing - /// the ID of the object the transaction created from the `effects`'s list of - /// created objects. - /// This is particularly important to enable the batching of transactions. - async fn apply( - self, - effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) - where - C: CoreClientReadOnly + OptionalSync; -} - -#[derive(Debug, Default, Clone)] -struct PartialGasData { - payment: Vec, - owner: Option, - price: Option, - budget: Option, -} - -impl From for PartialGasData { - fn from(value: GasData) -> Self { - Self { - payment: value.payment, - owner: Some(value.owner), - price: Some(value.price), - budget: Some(value.budget), - } - } -} - -impl PartialGasData { - fn into_gas_data_with_defaults(self) -> GasData { - GasData { - payment: self.payment, - owner: self.owner.unwrap_or_default(), - price: self.price.unwrap_or_default(), - budget: self.budget.unwrap_or_default(), - } - } -} - -impl TryFrom for GasData { - type Error = Error; - fn try_from(value: PartialGasData) -> Result { - let owner = value - .owner - .ok_or_else(|| Error::GasIssue("missing gas owner".to_owned()))?; - let price = value - .price - .ok_or_else(|| Error::GasIssue("missing gas price".to_owned()))?; - let budget = value - .budget - .ok_or_else(|| Error::GasIssue("missing gas budget".to_owned()))?; - - Ok(GasData { - payment: value.payment, - owner, - price, - budget, - }) - } -} - -/// A reference to [TransactionData] that only allows to mutate its [GasData]. -#[derive(Debug)] -pub struct MutGasDataRef<'tx>(&'tx mut TransactionData); -impl Deref for MutGasDataRef<'_> { - type Target = TransactionData; - fn deref(&self) -> &Self::Target { - self.0 - } -} - -impl MutGasDataRef<'_> { - /// Returns a mutable reference to [GasData]. - pub fn gas_data_mut(&mut self) -> &mut GasData { - self.0.gas_data_mut() - } -} - -/// Builds an executable transaction on a step by step manner. -#[derive(Debug)] -pub struct TransactionBuilder { - programmable_tx: Option, - sender: Option, - gas: PartialGasData, - signatures: Vec, - tx: Tx, -} - -impl AsRef for TransactionBuilder { - fn as_ref(&self) -> &Tx { - &self.tx - } -} - -impl TransactionBuilder -where - Tx: Transaction, -{ - /// Starts the creation of an executable transaction by supplying - /// a type implementing [Transaction]. - pub fn new(effect: Tx) -> Self { - Self { - tx: effect, - gas: PartialGasData::default(), - signatures: vec![], - sender: None, - programmable_tx: None, - } - } - - async fn transaction_data(&mut self, client: &C) -> anyhow::Result - where - C: CoreClientReadOnly + OptionalSync, - { - // Make sure the partial gas information is actually complete to create a whole GasData. - let gas_data: GasData = std::mem::take(&mut self.gas).try_into()?; - self.gas = gas_data.into(); - - // Forward call to "with_partial_gas" knowing no defaults will be used. - self.transaction_data_with_partial_gas(client).await - } - - /// Same as [Self::transaction_data] but will not fail with incomplete gas information. - /// Missing gas data is filled with default values through [PartialGasData::into_gas_data_with_defaults]. - async fn transaction_data_with_partial_gas(&mut self, client: &C) -> anyhow::Result - where - C: CoreClientReadOnly + OptionalSync, - { - let sender = self.sender.context("missing sender")?; - let gas_data = self.gas.clone().into_gas_data_with_defaults(); - let pt = self.get_or_init_programmable_tx(client).await?.clone(); - - Ok(TransactionData::new_with_gas_data( - TransactionKind::ProgrammableTransaction(pt), - sender, - gas_data, - )) - } - - /// Adds `signer`'s signature to this this transaction's signatures list. - /// # Notes - /// This methods asserts that `signer`'s address matches the address of - /// either this transaction's sender or the gas owner - failing otherwise. - pub async fn with_signature(mut self, client: &C) -> Result - where - C: CoreClient + OptionalSync, - S: Signer + OptionalSync, - { - let pk = client - .signer() - .public_key() - .await - .map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?; - let signer_address = IotaAddress::from(&pk); - let matches_sender = self.sender.is_none_or(|sender| sender == signer_address); - let matches_gas_owner = self.gas.owner.is_none_or(|owner| owner == signer_address); - if !(matches_sender || matches_gas_owner) { - return Err(Error::TransactionBuildingFailed(format!( - "signer's address {signer_address} doesn't match the address of either the transaction sender or the gas owner" - ))); - } - - let tx_data = self.transaction_data(client).await?; - - let sig = client - .signer() - .sign(&tx_data) - .await - .map_err(|e| Error::TransactionSigningFailed(e.to_string()))?; - self.signatures.push(sig); - - Ok(self) - } - - /// Attempts to sponsor this transaction by having another party supply [GasData] and gas owner signature. - /// ## Notes - /// The [TransactionData] passed to `sponsor_tx` can be constructed from partial gas data; the sponsor is - /// tasked with setting the gas information appropriately before signing. - pub async fn with_sponsor(mut self, client: &C, sponsor_tx: F) -> Result - where - C: CoreClientReadOnly + OptionalSync, - F: AsyncFnOnce(MutGasDataRef<'_>) -> anyhow::Result, - { - let mut tx_data = self.transaction_data_with_partial_gas(client).await?; - let signature = sponsor_tx(MutGasDataRef(&mut tx_data)) - .await - .map_err(|e| Error::GasIssue(format!("failed to sponsor transaction: {e}")))?; - - let gas_owner = tx_data.gas_owner(); - let mut intent_msg = IntentMessage::new(Intent::iota_transaction(), tx_data); - signature - .verify_secure(&intent_msg, gas_owner, signature.scheme()) - .map_err(|e| Error::TransactionBuildingFailed(format!("invalid sponsor signature: {e}")))?; - let gas_data = std::mem::replace( - intent_msg.value.gas_data_mut(), - GasData { - payment: vec![], - owner: IotaAddress::ZERO, - price: 0, - budget: 0, - }, - ); - - self.signatures.push(signature); - self.gas = gas_data.into(); - - Ok(self) - } - - async fn get_or_init_programmable_tx(&mut self, client: &C) -> Result<&ProgrammableTransaction, Error> - where - C: CoreClientReadOnly + OptionalSync, - { - if self.programmable_tx.is_none() { - self.programmable_tx = Some(self.tx.build_programmable_transaction(client).await?); - } - - Ok(self.programmable_tx.as_ref().unwrap()) - } - - /// Attempts to build this transaction using `client` in a best effort manner: - /// - when no sender had been supplied, client's address is used; - /// - when gas information is incomplete, the client will attempt to fill it, making use of whatever funds its address - /// has, if possible; - /// - when signatures are missing, the client will provide its own if possible; - /// - /// ## Notes - /// This method *DOES NOT* remove nor checks for invalid signatures. - /// Transaction with invalid signatures will fail after attempting to execute them. - pub async fn build( - mut self, - client: &(impl CoreClient + OptionalSync), - ) -> Result<(TransactionData, Vec, Tx), Error> - where - S: Signer + OptionalSync, - { - self.get_or_init_programmable_tx(client).await?; - let programmable_tx = self.programmable_tx.expect("just computed it"); - let client_address = client.sender_address(); - let sender = self.sender.unwrap_or(client_address); - let gas_data = complete_gas_data_for_tx(&programmable_tx, self.gas, client) - .await - .map_err(|e| Error::GasIssue(e.to_string()))?; - - let tx_data = TransactionData::new_with_gas_data( - TransactionKind::ProgrammableTransaction(programmable_tx), - sender, - gas_data, - ); - - let mut signatures = self.signatures; - let needs_client_signature = client_address == sender - || client_address == tx_data.gas_data().owner - && !signatures.iter().map(address_from_signature).contains(&client_address); - if needs_client_signature { - let signature = client - .signer() - .sign(&tx_data) - .await - .map_err(|e| Error::TransactionSigningFailed(e.to_string()))?; - signatures.push(signature); - } - - Ok((tx_data, signatures, self.tx)) - } - - /// Attempts to build and execute this transaction using `client` in a best effort manner: - /// - when no sender had been supplied, client's address is used; - /// - when gas information is incomplete, the client will attempt to fill it, making use of whatever funds its address - /// has, if possible; - /// - when signatures are missing, the client will provide its own if possible; - /// - /// After the transaction has been successfully executed, the transaction's effect will be computed. - /// ## Notes - /// This method *DOES NOT* remove nor checks for invalid signatures. - /// Transaction with invalid signatures will fail after attempting to execute them. - pub async fn build_and_execute(self, client: &C) -> Result, Error> - where - C: CoreClient + OptionalSync, - S: Signer + OptionalSync, - { - // Build the transaction into its parts. - let (tx_data, signatures, tx) = self.build(client).await?; - - // Execute and wait for the transaction to be confirmed. - let dyn_tx_block = client - .client_adapter() - .quorum_driver_api() - .execute_transaction_block( - tx_data, - signatures, - Some(IotaTransactionBlockResponseOptions::full_content()), - Some(ExecuteTransactionRequestType::WaitForLocalExecution), - ) - .await?; - - // Get the transaction's effects, making sure they are successful. - let tx_effects = dyn_tx_block - .effects() - .ok_or_else(|| Error::TransactionUnexpectedResponse("missing effects in response".to_owned()))? - .clone(); - let tx_status = tx_effects.status(); - if tx_status.is_err() { - return Err(Error::TransactionUnexpectedResponse(format!( - "errors in transaction's effects: {}", - tx_status - ))); - } - - let (application_result, _remaining_effects) = tx.apply(tx_effects, client).await; - let response = { - cfg_if! { - if #[cfg(target_arch = "wasm32")] { - dyn_tx_block - } else { - dyn_tx_block.clone_native_response() - } - } - }; - // Apply the off-chain logic of the transaction by parsing the transaction's effects. - // If the application goes awry, salvage the response by returning it alongside the error. - let output = match application_result { - Ok(output) => output, - Err(e) => { - #[cfg(not(target_arch = "wasm32"))] - let response = Box::new(response); - #[cfg(target_arch = "wasm32")] - // For WASM the response is passed in the error as its JSON-encoded string representation. - let response = response.as_native_response().to_string(); - return Err(Error::TransactionOffChainApplicationFailure { - source: Box::new(e), - response, - }); - } - }; - - Ok(TransactionOutput { output, response }) - } -} - -impl TransactionBuilder { - /// Returns the partial [Transaction] wrapped by this builder, consuming it. - pub fn into_inner(self) -> Tx { - self.tx - } - - /// Sets the address that will execute the transaction. - pub fn with_sender(mut self, sender: IotaAddress) -> Self { - self.sender = Some(sender); - self - } - - /// Sets the gas budget for this transaction. - pub fn with_gas_budget(mut self, budget: u64) -> Self { - self.gas.budget = Some(budget); - self - } - - /// Sets the coins to use to cover the gas cost. - pub fn with_gas_payment(mut self, coins: Vec) -> Self { - self.gas.payment = coins; - self - } - - /// Sets the gas owner. - pub fn with_gas_owner(mut self, address: IotaAddress) -> Self { - self.gas.owner = Some(address); - self - } - - /// Sets the gas price. - pub fn with_gas_price(mut self, price: u64) -> Self { - self.gas.price = Some(price); - self - } - - /// Sets the gas information that must be used to execute this transaction. - pub fn with_gas_data(mut self, gas_data: GasData) -> Self { - self.gas = gas_data.into(); - self - } - - /// Attempts to construct a [TransactionBuilder] from a whole transaction. - pub fn try_from_signed_transaction( - tx_data: TransactionData, - signatures: Vec, - effect: Tx, - ) -> Result { - #[allow(irrefutable_let_patterns)] - let TransactionKind::ProgrammableTransaction(pt) = tx_data.kind().clone() else { - return Err(Error::TransactionBuildingFailed( - "only programmable transactions are supported".to_string(), - )); - }; - let sender = tx_data.sender(); - let gas = tx_data.gas_data().clone().into(); - - Ok(Self { - programmable_tx: Some(pt), - sender: Some(sender), - gas, - signatures, - tx: effect, - }) - } -} - -/// Returns a best effort [GasData] for the given transaction, partial gas information, and client. -/// ## Notes -/// If a field is missing from gas data: -/// - client's address is set as the gas owner; -/// - current gas price is fetched from a node; -/// - budget is calculated by dry running the transaction; -/// - payment is set to whatever IOTA coins the gas owner has, that satisfy the tx's budget; -async fn complete_gas_data_for_tx( - pt: &ProgrammableTransaction, - partial_gas_data: PartialGasData, - client: &C, -) -> anyhow::Result -where - C: CoreClient + OptionalSync, - S: Signer + OptionalSync, -{ - let owner = partial_gas_data.owner.unwrap_or(client.sender_address()); - let price = if let Some(price) = partial_gas_data.price { - price - } else { - client.client_adapter().read_api().get_reference_gas_price().await? - }; - let budget = if let Some(budget) = partial_gas_data.budget { - budget - } else { - client.client_adapter().default_gas_budget(owner, pt).await? - }; - let payment = if !partial_gas_data.payment.is_empty() { - partial_gas_data.payment - } else { - client.get_iota_coins_with_at_least_balance(owner, budget).await? - }; - - Ok(GasData { - owner, - payment, - price, - budget, - }) -} - -/// Extract the signer's address from an IOTA [Signature]. -fn address_from_signature(signature: &Signature) -> IotaAddress { - let scheme = signature.scheme(); - let pk_bytes = signature.public_key_bytes(); - let pk = PublicKey::try_from_bytes(scheme, pk_bytes).expect("valid signature hence valid key"); - - IotaAddress::from(&pk) -} diff --git a/identity_iota_core/src/rebased/utils.rs b/identity_iota_core/src/rebased/utils.rs index c12905d1a6..c59b3143f5 100644 --- a/identity_iota_core/src/rebased/utils.rs +++ b/identity_iota_core/src/rebased/utils.rs @@ -4,7 +4,7 @@ use std::process::Output; use anyhow::Context as _; -use identity_iota_interaction::types::base_types::ObjectID; +use iota_interaction::types::base_types::ObjectID; use iota_sdk::IotaClient; use iota_sdk::IotaClientBuilder; use serde::Deserialize; @@ -12,7 +12,7 @@ use serde::Deserialize; use tokio::process::Command; use crate::rebased::Error; -use identity_iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::base_types::IotaAddress; const FUND_WITH_ACTIVE_ADDRESS_FUNDING_TX_BUDGET: u64 = 5_000_000; const FUND_WITH_ACTIVE_ADDRESS_FUNDING_VALUE: u64 = 500_000_000; diff --git a/identity_iota_core/tests/e2e/asset.rs b/identity_iota_core/tests/e2e/asset.rs index cda0739303..ca9517c8c0 100644 --- a/identity_iota_core/tests/e2e/asset.rs +++ b/identity_iota_core/tests/e2e/asset.rs @@ -3,6 +3,8 @@ use std::str::FromStr as _; +use crate::common::get_funded_test_client; +use crate::common::TEST_GAS_BUDGET; use identity_core::common::Object; use identity_core::common::Timestamp; use identity_core::common::Url; @@ -12,26 +14,23 @@ use identity_credential::validator::JwtCredentialValidationOptions; use identity_credential::validator::JwtCredentialValidator; use identity_document::document::CoreDocument; use identity_eddsa_verifier::EdDSAJwsVerifier; -use identity_iota_core::rebased::client::CoreClient; use identity_iota_core::rebased::AuthenticatedAsset; use identity_iota_core::rebased::PublicAvailableVC; use identity_iota_core::rebased::TransferProposal; use identity_iota_core::IotaDID; use identity_iota_core::IotaDocument; -use identity_iota_interaction::IotaClientTrait; -use identity_iota_interaction::MoveType as _; use identity_jose::jwk::ToJwk as _; use identity_storage::JwkDocumentExt; use identity_storage::JwsSignatureOptions; use identity_verification::VerificationMethod; +use iota_interaction::IotaClientTrait; +use iota_interaction::MoveType as _; use iota_sdk::types::TypeTag; use itertools::Itertools as _; use move_core_types::language_storage::StructTag; +use product_core::core_client::CoreClient; use secret_storage::Signer as _; -use crate::common::get_funded_test_client; -use crate::common::TEST_GAS_BUDGET; - #[tokio::test] async fn creating_authenticated_asset_works() -> anyhow::Result<()> { let test_client = get_funded_test_client().await?; diff --git a/identity_iota_core/tests/e2e/common.rs b/identity_iota_core/tests/e2e/common.rs index 024f78962a..72d6597cac 100644 --- a/identity_iota_core/tests/e2e/common.rs +++ b/identity_iota_core/tests/e2e/common.rs @@ -5,25 +5,12 @@ use anyhow::anyhow; use anyhow::Context; use async_trait::async_trait; -use identity_iota_core::iota_interaction_rust::IotaClientAdapter; -use identity_iota_core::rebased::client::CoreClient; -use identity_iota_core::rebased::client::CoreClientReadOnly; use identity_iota_core::rebased::client::IdentityClient; use identity_iota_core::rebased::client::IdentityClientReadOnly; use identity_iota_core::rebased::keytool::KeytoolSigner; -use identity_iota_core::rebased::transaction_builder::Transaction; -use identity_iota_core::rebased::transaction_builder::TransactionBuilder; use identity_iota_core::rebased::utils::request_funds; use identity_iota_core::rebased::Error; use identity_iota_core::IotaDID; -use identity_iota_core::NetworkName; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffects; -use identity_iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI; -use identity_iota_interaction::types::transaction::ProgrammableTransaction; - -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::IotaTransactionBlockEffectsMutAPI; -use identity_iota_interaction::OptionalSync; use identity_jose::jwk::Jwk; use identity_jose::jwk::ToJwk as _; use identity_jose::jws::JwsAlgorithm; @@ -37,15 +24,26 @@ use identity_storage::MethodDigest; use identity_storage::Storage; use identity_storage::StorageSigner; use identity_verification::VerificationMethod; +use iota_interaction::rpc_types::IotaTransactionBlockEffectsAPI; +use iota_interaction::types::transaction::ProgrammableTransaction; +use iota_interaction::IotaKeySignature; +use iota_interaction::IotaTransactionBlockEffectsMutAPI; +use iota_interaction::OptionalSync; +use iota_interaction_rust::IotaClientAdapter; use iota_sdk::rpc_types::IotaObjectDataOptions; use iota_sdk::rpc_types::IotaObjectResponse; +use iota_sdk::rpc_types::IotaTransactionBlockEffects; use iota_sdk::types::base_types::IotaAddress; use iota_sdk::types::base_types::ObjectID; use iota_sdk::types::crypto::PublicKey; use iota_sdk::types::crypto::SignatureScheme; use iota_sdk::types::object::Owner; use iota_sdk::types::programmable_transaction_builder::ProgrammableTransactionBuilder; +use product_core::core_client::CoreClient; +use product_core::core_client::CoreClientReadOnly; +use product_core::network_name::NetworkName; +use iota_interaction::IotaClientTrait; use iota_sdk::types::TypeTag; use iota_sdk::types::IOTA_FRAMEWORK_PACKAGE_ID; use iota_sdk::IotaClient; @@ -54,6 +52,8 @@ use iota_sdk::IOTA_LOCAL_NETWORK_URL; use lazy_static::lazy_static; use move_core_types::ident_str; use move_core_types::language_storage::StructTag; +use product_core::transaction::transaction_builder::Transaction; +use product_core::transaction::transaction_builder::TransactionBuilder; use secret_storage::Signer; use serde::Deserialize; use serde_json::Value; @@ -63,7 +63,6 @@ use std::str::FromStr; use std::sync::Arc; use tokio::process::Command; use tokio::sync::OnceCell; - pub type MemStorage = Storage; pub type MemSigner<'s> = StorageSigner<'s, JwkMemStore, KeyIdMemstore>; @@ -406,7 +405,9 @@ struct GetTestCoin { impl Transaction for GetTestCoin { type Output = ObjectID; - async fn build_programmable_transaction(&self, _client: &C) -> Result + type Error = Error; + + async fn build_programmable_transaction(&self, _client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { @@ -422,15 +423,10 @@ impl Transaction for GetTestCoin { Ok(ptb.finish()) } - async fn apply( - self, - mut effects: IotaTransactionBlockEffects, - client: &C, - ) -> (Result, IotaTransactionBlockEffects) + async fn apply(self, effects: &mut IotaTransactionBlockEffects, client: &C) -> Result where C: CoreClientReadOnly + OptionalSync, { - use identity_iota_interaction::IotaClientTrait as _; let created_objects = effects .created() .iter() @@ -461,15 +457,12 @@ impl Transaction for GetTestCoin { if let (Some(i), Some(id)) = (i, id) { effects.created_mut().swap_remove(i); - (Ok(id), effects) + Ok(id) } else { - ( - Err(Error::TransactionUnexpectedResponse(format!( - "transaction didn't create any coins for address {}", - self.recipient - ))), - effects, - ) + Err(Error::TransactionUnexpectedResponse(format!( + "transaction didn't create any coins for address {}", + self.recipient + ))) } } } diff --git a/identity_iota_core/tests/e2e/identity.rs b/identity_iota_core/tests/e2e/identity.rs index 78662bdc34..9b0219671c 100644 --- a/identity_iota_core/tests/e2e/identity.rs +++ b/identity_iota_core/tests/e2e/identity.rs @@ -1,6 +1,5 @@ // Copyright 2020-2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 - use crate::common; use crate::common::get_funded_test_client; use crate::common::get_key_data; @@ -8,8 +7,6 @@ use crate::common::TestClient; use crate::common::TEST_COIN_TYPE; use crate::common::TEST_GAS_BUDGET; use identity_iota_core::rebased::client::get_object_id_from_did; -use identity_iota_core::rebased::client::CoreClient; -use identity_iota_core::rebased::client::CoreClientReadOnly; use identity_iota_core::rebased::migration::has_previous_version; use identity_iota_core::rebased::migration::ControllerToken; use identity_iota_core::rebased::migration::DelegationToken; @@ -17,7 +14,6 @@ use identity_iota_core::rebased::migration::Identity; use identity_iota_core::rebased::proposals::ProposalResult; use identity_iota_core::IotaDID; use identity_iota_core::IotaDocument; -use identity_iota_interaction::KeytoolSigner; use identity_jose::jwk::ToJwk as _; use identity_verification::MethodScope; use identity_verification::VerificationMethod; @@ -30,6 +26,8 @@ use iota_sdk::types::transaction::ObjectArg; use iota_sdk::types::TypeTag; use iota_sdk::types::IOTA_FRAMEWORK_PACKAGE_ID; use move_core_types::ident_str; +use product_core::core_client::CoreClient; +use product_core::core_client::CoreClientReadOnly; use secret_storage::Signer as _; #[tokio::test] @@ -472,7 +470,7 @@ async fn identity_delete_did_works() -> anyhow::Result<()> { let mut identity = client .create_identity(IotaDocument::new(client.network())) .finish() - .build_and_execute::(&client) + .build_and_execute(&client) .await? .output; let did = identity.did_document().id().clone(); @@ -482,7 +480,7 @@ async fn identity_delete_did_works() -> anyhow::Result<()> { .delete_did(&controller_token) .finish(&client) .await? - .build_and_execute::(&client) + .build_and_execute(&client) .await? .output else { diff --git a/identity_iota_interaction/Cargo.toml b/identity_iota_interaction/Cargo.toml deleted file mode 100644 index a580760c61..0000000000 --- a/identity_iota_interaction/Cargo.toml +++ /dev/null @@ -1,72 +0,0 @@ -[package] -name = "identity_iota_interaction" -version = "1.6.0-alpha" -authors.workspace = true -edition.workspace = true -homepage.workspace = true -keywords = ["iota", "tangle", "identity"] -license.workspace = true -readme = "./README.md" -repository.workspace = true -rust-version.workspace = true -description = "Trait definitions and a wasm32 compatible subset of code, copied from the IOTA Rust SDK, used to replace the IOTA Rust SDK for wasm32 builds." - -[dependencies] -anyhow = "1.0.75" -async-trait = { version = "0.1.81", default-features = false } -bcs = "0.1.4" -cfg-if = "1.0.0" -fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "2f502fd8570fe4e9cff36eea5bbd6fef22002898", package = "fastcrypto", features = ["copy_key"] } -jsonpath-rust = { version = "0.5.1", optional = true } -secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", default-features = false, tag = "v0.3.0" } -serde.workspace = true -serde_json.workspace = true - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v0.12.0-rc" } -move-core-types = { git = "https://github.com/iotaledger/iota.git", package = "move-core-types", tag = "v0.12.0-rc" } -tokio = { version = "1", optional = true, default-features = false, features = ["process"] } - -shared-crypto = { git = "https://github.com/iotaledger/iota.git", package = "shared-crypto", tag = "v0.12.0-rc" } - -[target.'cfg(target_arch = "wasm32")'.dependencies] -eyre = { version = "0.6" } -fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "2f502fd8570fe4e9cff36eea5bbd6fef22002898", package = "fastcrypto-zkp" } -getrandom = { version = "0.2", default-features = false, features = ["js"] } -hex = { version = "0.4" } -itertools = "0.13" -jsonrpsee = { version = "0.24", default-features = false, features = ["wasm-client"] } -leb128 = { version = "0.2" } -num-bigint = { version = "0.4" } -primitive-types = { version = "0.12", features = ["impl-serde"] } -rand = "0.8.5" -ref-cast = { version = "1.0" } -serde_repr = { version = "0.1" } -serde_with = { version = "3.8", features = ["hex"] } -strum.workspace = true -thiserror.workspace = true -tracing = { version = "0.1" } -uint = { version = "0.9" } -derive_more = "0.99.18" -enum_dispatch = "0.3.13" -schemars = "0.8.21" -tap = "1" -nonempty = "0.11" - -[package.metadata.docs.rs] -# To build locally: -# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --no-deps --workspace --open -all-features = true -rustdoc-args = ["--cfg", "docsrs"] - -[features] -default = ["send-sync-transaction", "secret-storage/send-sync-storage"] -send-sync-transaction = ["secret-storage/send-sync-storage"] -keytool = ["dep:tokio", "dep:jsonpath-rust"] - -[lints.clippy] -result_large_err = "allow" - -[lints.rust] -# from local sdk types -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(msim)'] } diff --git a/identity_iota_interaction/README.md b/identity_iota_interaction/README.md deleted file mode 100644 index abee8ad9e1..0000000000 --- a/identity_iota_interaction/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# Platform Agnostic Iota Interaction - -This crate gathers types needed to interact with IOTA nodes in a platform-agnostic way -to allow building the Identity library for WASM32 architectures. - -The folder `sdk_types`, contained in this crate, provides a selection of -code copied from the iotaledger/iota.git repository: - -| Folder Name | Original Source in iotaledger/iota.git | -|------------------------------------|------------------------------------------------------| -| sdk_types/iota_json_rpc_types | crates/iota-json-rpc-types | -| sdk_types/iota_types | crates/iota-types | -| sdk_types/move_command_line_common | external-crates/move/crates/move-command-line-common | -| sdk_types/move_core_types | external-crates/move/crates/move-core-types | -| sdk_types/shared_crypto | crates/shared-crypto/Cargo.toml | - -The folder structure in `sdk_types` matches the way the original IOTA Client Rust SDK -provides the above listed crates via `pub use`. - -This crate (file 'lib.rs' contained in this folder) provides several -`build target` specific `pub use` and `type` expressions: - -* For **NON wasm32 targets**, the original _IOTA Client Rust SDK_ sources are provided -* For **WASM32 targets** the code contained in the `sdk_types` folder is used - -Please make sure always to import the SDK dependencies via `use identity_iota::iota_interaction::...` -instead of `use iota_sdk::...` in your code. This way the dependencies needed for your -code are automatically switched according to the currently used build target. - -The Advantage of this target specific dependency switching is, -that for NON wasm32 targets no type marshalling is needed because -the original Rust SDK types are used. - -The drawback of target specific dependency switching is, that code of -the original Rust SDK could be used, that is not contained in the -`sdk_types` folder. The following todos result from this drawback: - -TODOs: - -* Always build your code additionally for the wasm32-unknown-unknown target - before committing your code:
- `cargo build --package identity_iota_.... --lib --target wasm32-unknown-unknown` -* We need to add tests for the wasm32-unknown-unknown target in the CI toolchain - to make sure the code is always buildable for wasm32 targets. - -All cross-platform usable types and traits (cross-platform-traits) -are contained in this crate. -Platform specific adapters (implementing the cross-platform-traits) are contained in -the crate [bindings/wasm/iota_interaction_ts](../../bindings/wasm/iota_interaction_ts) -and in the folder -[identity_iota_core/src/iota_interaction_rust](../../identity_iota_core/src/iota_interaction_rust). \ No newline at end of file diff --git a/identity_iota_interaction/src/effects_mut_api.rs b/identity_iota_interaction/src/effects_mut_api.rs deleted file mode 100644 index 83b1879be4..0000000000 --- a/identity_iota_interaction/src/effects_mut_api.rs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::rpc_types::IotaObjectRef; -use crate::rpc_types::IotaTransactionBlockEffects; -use crate::rpc_types::IotaTransactionBlockEffectsAPI; -use crate::rpc_types::IotaTransactionBlockEffectsV1; -use crate::rpc_types::OwnedObjectRef; - -/// A mutable version of [IotaTransactionBlockEffectsAPI] that allows the -/// in-place mutation of [IotaTransactionBlockEffects] -pub trait IotaTransactionBlockEffectsMutAPI: IotaTransactionBlockEffectsAPI { - fn shared_objects_mut(&mut self) -> &mut Vec; - fn created_mut(&mut self) -> &mut Vec; - fn mutated_mut(&mut self) -> &mut Vec; - fn unwrapped_mut(&mut self) -> &mut Vec; - fn deleted_mut(&mut self) -> &mut Vec; - fn unwrapped_then_deleted_mut(&mut self) -> &mut Vec; - fn wrapped_mut(&mut self) -> &mut Vec; -} - -impl IotaTransactionBlockEffectsMutAPI for IotaTransactionBlockEffectsV1 { - fn shared_objects_mut(&mut self) -> &mut Vec { - &mut self.shared_objects - } - - fn created_mut(&mut self) -> &mut Vec { - &mut self.created - } - - fn mutated_mut(&mut self) -> &mut Vec { - &mut self.mutated - } - - fn unwrapped_mut(&mut self) -> &mut Vec { - &mut self.unwrapped - } - - fn deleted_mut(&mut self) -> &mut Vec { - &mut self.deleted - } - - fn unwrapped_then_deleted_mut(&mut self) -> &mut Vec { - &mut self.unwrapped_then_deleted - } - - fn wrapped_mut(&mut self) -> &mut Vec { - &mut self.wrapped - } -} - -impl IotaTransactionBlockEffectsMutAPI for IotaTransactionBlockEffects { - fn shared_objects_mut(&mut self) -> &mut Vec { - match self { - Self::V1(effects) => &mut effects.shared_objects, - } - } - - fn created_mut(&mut self) -> &mut Vec { - match self { - Self::V1(effects) => &mut effects.created, - } - } - - fn mutated_mut(&mut self) -> &mut Vec { - match self { - Self::V1(effects) => &mut effects.mutated, - } - } - - fn unwrapped_mut(&mut self) -> &mut Vec { - match self { - Self::V1(effects) => &mut effects.unwrapped, - } - } - - fn deleted_mut(&mut self) -> &mut Vec { - match self { - Self::V1(effects) => &mut effects.deleted, - } - } - - fn unwrapped_then_deleted_mut(&mut self) -> &mut Vec { - match self { - Self::V1(effects) => &mut effects.unwrapped_then_deleted, - } - } - - fn wrapped_mut(&mut self) -> &mut Vec { - match self { - Self::V1(effects) => &mut effects.wrapped, - } - } -} diff --git a/identity_iota_interaction/src/iota_client_trait.rs b/identity_iota_interaction/src/iota_client_trait.rs deleted file mode 100644 index acec57a1c0..0000000000 --- a/identity_iota_interaction/src/iota_client_trait.rs +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::error::IotaRpcResult; -use crate::rpc_types::CoinPage; -use crate::rpc_types::EventFilter; -use crate::rpc_types::EventPage; -use crate::rpc_types::IotaObjectData; -use crate::rpc_types::IotaObjectDataOptions; -use crate::rpc_types::IotaObjectResponse; -use crate::rpc_types::IotaObjectResponseQuery; -use crate::rpc_types::IotaPastObjectResponse; -use crate::rpc_types::IotaTransactionBlockEffects; -use crate::rpc_types::IotaTransactionBlockResponseOptions; -use crate::rpc_types::ObjectsPage; -use crate::types::base_types::IotaAddress; -use crate::types::base_types::ObjectID; -use crate::types::base_types::SequenceNumber; -use crate::types::crypto::PublicKey; -use crate::types::crypto::Signature; -use crate::types::digests::TransactionDigest; -use crate::types::dynamic_field::DynamicFieldName; -use crate::types::event::EventID; -use crate::types::quorum_driver_types::ExecuteTransactionRequestType; -use crate::types::transaction::ProgrammableTransaction; -use crate::types::transaction::TransactionData; -use crate::OptionalSend; -use async_trait::async_trait; -use secret_storage::SignatureScheme as SignatureSchemeSecretStorage; -use secret_storage::Signer; -use std::boxed::Box; -use std::option::Option; -use std::result::Result; - -#[cfg(not(target_arch = "wasm32"))] -use std::marker::Send; - -#[cfg(feature = "send-sync-transaction")] -use crate::OptionalSync; - -pub struct IotaKeySignature { - pub public_key: PublicKey, - pub signature: Signature, -} - -impl SignatureSchemeSecretStorage for IotaKeySignature { - type PublicKey = PublicKey; - type Signature = Signature; - type Input = TransactionData; -} - -//******************************************************************** -// TODO: rename the following traits to have a consistent relation -// between platform specific trait specializations -// and the platform agnostic traits specified in this file: -// * QuorumDriverTrait -> QuorumDriverApiT -// * ReadTrait -> ReadApiT -// * CoinReadTrait -> CoinReadApiT -// * EventTrait -> EventApiT -// -// Platform specific trait specializations are defined -// in modules identity_iota_core::iota_interaction_rust and -// iota_interaction_ts with the following names: -// * QuorumDriverApiAdaptedT -// * ReadApiAdaptedT -// * CoinReadApiAdaptedT -// * EventApiAdaptedT -// * IotaClientAdaptedT -//******************************************************************** - -/// Adapter Allowing to query information from an IotaTransactionBlockResponse instance. -/// As IotaTransactionBlockResponse pulls too many dependencies we need to -/// hide it behind a trait. -#[cfg_attr(not(feature = "send-sync-transaction"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync-transaction", async_trait)] -pub trait IotaTransactionBlockResponseT: OptionalSend { - /// Error type used - type Error; - /// The response type used in the platform specific client sdk - type NativeResponse; - - /// Returns Debug representation of the IotaTransactionBlockResponse - fn to_string(&self) -> String; - - /// Returns the effects of this transaction - fn effects(&self) -> Option<&IotaTransactionBlockEffects>; - - /// Returns a reference to the platform specific client sdk response instance wrapped by this adapter - fn as_native_response(&self) -> &Self::NativeResponse; - - /// Returns a mutable reference to the platform specific client sdk response instance wrapped by this adapter - fn as_mut_native_response(&mut self) -> &mut Self::NativeResponse; - - /// Returns a clone of the wrapped platform specific client sdk response - fn clone_native_response(&self) -> Self::NativeResponse; - - // Returns digest for transaction block. - fn digest(&self) -> Result; -} - -#[cfg_attr(not(feature = "send-sync-transaction"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync-transaction", async_trait)] -pub trait QuorumDriverTrait { - /// Error type used - type Error; - /// The response type used in the platform specific client sdk - type NativeResponse; - - async fn execute_transaction_block( - &self, - tx_data: TransactionData, - signatures: Vec, - options: Option, - request_type: Option, - ) -> IotaRpcResult>>; -} - -#[cfg_attr(not(feature = "send-sync-transaction"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync-transaction", async_trait)] -pub trait ReadTrait { - /// Error type used - type Error; - /// The response type used in the platform specific client sdk - type NativeResponse; - - async fn get_chain_identifier(&self) -> Result; - - async fn get_dynamic_field_object( - &self, - parent_object_id: ObjectID, - name: DynamicFieldName, - ) -> IotaRpcResult; - - async fn get_object_with_options( - &self, - object_id: ObjectID, - options: IotaObjectDataOptions, - ) -> IotaRpcResult; - - async fn get_owned_objects( - &self, - address: IotaAddress, - query: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult; - - async fn get_reference_gas_price(&self) -> IotaRpcResult; - - async fn get_transaction_with_options( - &self, - digest: TransactionDigest, - options: IotaTransactionBlockResponseOptions, - ) -> IotaRpcResult>>; - - async fn try_get_parsed_past_object( - &self, - object_id: ObjectID, - version: SequenceNumber, - options: IotaObjectDataOptions, - ) -> IotaRpcResult; -} - -#[cfg_attr(not(feature = "send-sync-transaction"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync-transaction", async_trait)] -pub trait CoinReadTrait { - type Error; - - async fn get_coins( - &self, - owner: IotaAddress, - coin_type: Option, - cursor: Option, - limit: Option, - ) -> IotaRpcResult; -} - -#[cfg_attr(not(feature = "send-sync-transaction"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync-transaction", async_trait)] -pub trait EventTrait { - /// Error type used - type Error; - - async fn query_events( - &self, - query: EventFilter, - cursor: Option, - limit: Option, - descending_order: bool, - ) -> IotaRpcResult; -} - -#[cfg_attr(not(feature = "send-sync-transaction"), async_trait(?Send))] -#[cfg_attr(feature = "send-sync-transaction", async_trait)] -pub trait IotaClientTrait { - /// Error type used - type Error; - /// The response type used in the platform specific client sdk - type NativeResponse; - - #[cfg(not(feature = "send-sync-transaction"))] - fn quorum_driver_api( - &self, - ) -> Box + '_>; - #[cfg(feature = "send-sync-transaction")] - fn quorum_driver_api( - &self, - ) -> Box + Send + '_>; - - #[cfg(not(feature = "send-sync-transaction"))] - fn read_api(&self) -> Box + '_>; - #[cfg(feature = "send-sync-transaction")] - fn read_api(&self) -> Box + Send + '_>; - - #[cfg(not(feature = "send-sync-transaction"))] - fn coin_read_api(&self) -> Box + '_>; - #[cfg(feature = "send-sync-transaction")] - fn coin_read_api(&self) -> Box + Send + '_>; - - #[cfg(not(feature = "send-sync-transaction"))] - fn event_api(&self) -> Box + '_>; - #[cfg(feature = "send-sync-transaction")] - fn event_api(&self) -> Box + Send + '_>; - - #[cfg(not(feature = "send-sync-transaction"))] - async fn execute_transaction>( - &self, - tx_data: TransactionData, - signer: &S, - ) -> Result< - Box>, - Self::Error, - >; - #[cfg(feature = "send-sync-transaction")] - async fn execute_transaction + OptionalSync>( - &self, - tx_data: TransactionData, - signer: &S, - ) -> Result< - Box>, - Self::Error, - >; - - async fn default_gas_budget( - &self, - sender_address: IotaAddress, - tx: &ProgrammableTransaction, - ) -> Result; - - async fn get_previous_version(&self, iod: IotaObjectData) -> Result, Self::Error>; - - async fn get_past_object( - &self, - object_id: ObjectID, - version: SequenceNumber, - ) -> Result; -} diff --git a/identity_iota_interaction/src/iota_verifiable_credential.rs b/identity_iota_interaction/src/iota_verifiable_credential.rs deleted file mode 100644 index 7f2ab9dcd1..0000000000 --- a/identity_iota_interaction/src/iota_verifiable_credential.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::move_types::language_storage::TypeTag; -use crate::types::base_types::ObjectID; -use crate::MoveType; -use crate::TypedValue; -use serde::Deserialize; -use serde::Serialize; -use std::str::FromStr; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] -pub struct IotaVerifiableCredential { - data: Vec, -} - -impl IotaVerifiableCredential { - pub fn new(data: Vec) -> IotaVerifiableCredential { - IotaVerifiableCredential { data } - } - - pub fn data(&self) -> &Vec { - &self.data - } -} - -impl MoveType for IotaVerifiableCredential { - fn move_type(package: ObjectID) -> TypeTag { - TypeTag::from_str(&format!("{package}::public_vc::PublicVc")).expect("valid utf8") - } - - fn get_typed_value(&self, _package: ObjectID) -> TypedValue - where - Self: MoveType, - Self: Sized, - { - TypedValue::IotaVerifiableCredential(self) - } -} diff --git a/identity_iota_interaction/src/keytool/internal.rs b/identity_iota_interaction/src/keytool/internal.rs deleted file mode 100644 index e09c206c33..0000000000 --- a/identity_iota_interaction/src/keytool/internal.rs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::path::Path; -use std::path::PathBuf; -use std::str::FromStr as _; - -use anyhow::anyhow; -use anyhow::Context as _; -use fastcrypto::traits::EncodeDecodeBase64 as _; -use jsonpath_rust::JsonPathQuery as _; -use serde::Deserialize; -use serde_json::Value; - -use crate::types::base_types::IotaAddress; -use crate::types::crypto::PublicKey; - -#[derive(Debug, Clone)] -pub(super) struct IotaCliWrapper { - iota_bin: PathBuf, -} - -impl Default for IotaCliWrapper { - fn default() -> Self { - Self { - iota_bin: PathBuf::from_str("iota").expect("infallible"), - } - } -} - -impl IotaCliWrapper { - /// Creates a new [IotaCliWrapper] that will use the iota binary found at - /// the provided path. - pub fn new_with_custom_bin(iota_bin: impl AsRef) -> Self { - Self { - iota_bin: iota_bin.as_ref().to_owned(), - } - } - - /// Returns the location of the iota binary used. - pub fn iota_bin(&self) -> &Path { - &self.iota_bin - } - - /// Executes a given "iota" command with the provided string-encoded args. - /// Returns the parsed JSON output. - pub fn run_command(&self, args: &str) -> anyhow::Result { - cfg_if::cfg_if! { - if #[cfg(not(target_arch = "wasm32"))] { - let output = std::process::Command::new(&self.iota_bin) - .args(args.split_ascii_whitespace()) - .arg("--json") - .output() - .map_err(|e| anyhow!("failed to run command: {e}"))?; - - if !output.status.success() { - let err_msg = - String::from_utf8(output.stderr).map_err(|e| anyhow!("command failed with non-utf8 error message: {e}"))?; - return Err(anyhow!("failed to run keytool cmd: {err_msg}")); - } - - let trimmed_output = { - let start_of_json = output.stdout.iter().enumerate().find_map(|(i, b)| matches!(*b, b'[' | b'{' | b'\"').then_some(i)).context("no JSON in command output")?; - &output.stdout[start_of_json..] - }; - - serde_json::from_slice(trimmed_output).context("invalid JSON object in command output") - } else { - extern "Rust" { - fn __wasm_exec_iota_cmd(cmd: &str) -> anyhow::Result; - } - let iota_bin = self.iota_bin.to_str().context("invalid IOTA bin path")?; - let cmd = format!("{iota_bin} {args} --json"); - unsafe { __wasm_exec_iota_cmd(&cmd) } - } - } - } - - /// Returns the current active address. - pub fn get_active_address(&self) -> anyhow::Result { - self - .run_command("client active-address") - .and_then(|value| serde_json::from_value(value).context("failed to parse IotaAddress from output")) - } - - fn get_key_impl(&self, json_path_query: &str) -> anyhow::Result> { - let Some(pk_json_data) = self - .run_command("keytool list")? - .path(json_path_query) - .map_err(|e| anyhow!("failed to query JSON output: {e}"))? - .get_mut(0) - .map(Value::take) - else { - return Ok(None); - }; - - let KeytoolPublicKeyHelper { - public_base64_key_with_flag, - alias, - .. - } = serde_json::from_value(pk_json_data)?; - - let pk = PublicKey::decode_base64(&public_base64_key_with_flag).map_err(|e| anyhow!("{e:?}"))?; - - Ok(Some((pk, alias))) - } - - /// Returns the public key of a given address, if any. - pub fn get_key(&self, address: IotaAddress) -> anyhow::Result> { - let query = format!("$[?(@.iotaAddress==\"{}\")]", address); - self.get_key_impl(&query) - } - - /// Returns the public key with the given alias, if any. - pub fn get_key_by_alias(&self, alias: &str) -> anyhow::Result> { - let query = format!("$[?(@.alias==\"{}\")]", alias); - Ok(self.get_key_impl(&query)?.map(|(pk, _)| pk)) - } -} - -#[derive(Deserialize)] -#[serde(rename_all = "camelCase")] -struct KeytoolPublicKeyHelper { - alias: String, - public_base64_key_with_flag: String, -} diff --git a/identity_iota_interaction/src/keytool/mod.rs b/identity_iota_interaction/src/keytool/mod.rs deleted file mode 100644 index 2b1b517e33..0000000000 --- a/identity_iota_interaction/src/keytool/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -mod internal; -mod signer; -mod storage; - -pub use signer::*; -pub use storage::*; diff --git a/identity_iota_interaction/src/keytool/signer.rs b/identity_iota_interaction/src/keytool/signer.rs deleted file mode 100644 index dc307e5147..0000000000 --- a/identity_iota_interaction/src/keytool/signer.rs +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::path::Path; -use std::path::PathBuf; - -use crate::types::base_types::IotaAddress; -use crate::types::crypto::PublicKey; -use crate::types::crypto::Signature; -use crate::types::transaction::TransactionData; -use crate::IotaKeySignature; -use anyhow::anyhow; -use anyhow::Context as _; -use async_trait::async_trait; -use fastcrypto::encoding::Base64; -use fastcrypto::encoding::Encoding; -use secret_storage::Error as SecretStorageError; -use secret_storage::Signer; - -use super::internal::IotaCliWrapper; - -/// Builder structure to ease the creation of a [KeytoolSigner]. -#[derive(Debug, Default)] -pub struct KeytoolSignerBuilder { - address: Option, - iota_bin: Option, -} - -impl KeytoolSignerBuilder { - /// Returns a new [KeytoolSignerBuilder] with default configuration: - /// - use current active address; - /// - assumes `iota` binary to be in PATH; - pub fn new() -> Self { - Self::default() - } - - /// Sets the address the signer will use. - /// Defaults to current active address if no address is provided. - pub fn with_address(mut self, address: IotaAddress) -> Self { - self.address = Some(address); - self - } - - /// Sets the path to the `iota` binary to use. - /// Assumes `iota` to be in PATH if no value is provided. - pub fn iota_bin_location(mut self, path: impl AsRef) -> Self { - let path = path.as_ref().to_path_buf(); - self.iota_bin = Some(path); - - self - } - - /// Builds a new [KeytoolSigner] using the provided configuration. - pub fn build(self) -> anyhow::Result { - let KeytoolSignerBuilder { address, iota_bin } = self; - let iota_cli_wrapper = iota_bin.map(IotaCliWrapper::new_with_custom_bin).unwrap_or_default(); - let address = if let Some(address) = address { - address - } else { - iota_cli_wrapper.get_active_address()? - }; - - let public_key = iota_cli_wrapper.get_key(address)?.context("key doens't exist")?.0; - - Ok(KeytoolSigner { - public_key, - iota_cli_wrapper, - address, - }) - } -} - -/// IOTA Keytool [Signer] implementation. -#[derive(Debug)] -pub struct KeytoolSigner { - public_key: PublicKey, - iota_cli_wrapper: IotaCliWrapper, - address: IotaAddress, -} - -impl KeytoolSigner { - /// Returns a [KeytoolSignerBuilder]. - pub fn builder() -> KeytoolSignerBuilder { - KeytoolSignerBuilder::default() - } - - /// Returns the [IotaAddress] used by this [KeytoolSigner]. - pub fn address(&self) -> IotaAddress { - self.address - } - - /// Returns the [PublicKey] used by this [KeytoolSigner]. - pub fn public_key(&self) -> &PublicKey { - &self.public_key - } -} - -#[cfg_attr(feature = "send-sync-transaction", async_trait)] -#[cfg_attr(not(feature = "send-sync-transaction"), async_trait(?Send))] -impl Signer for KeytoolSigner { - type KeyId = IotaAddress; - - fn key_id(&self) -> Self::KeyId { - self.address - } - - async fn public_key(&self) -> Result { - Ok(self.public_key.clone()) - } - - async fn sign(&self, data: &TransactionData) -> Result { - let tx_data_bcs = - bcs::to_bytes(data).map_err(|e| SecretStorageError::Other(anyhow!("bcs serialization failed: {e}")))?; - let base64_data = Base64::encode(&tx_data_bcs); - let command = format!("keytool sign --address {} --data {base64_data}", self.address); - - self - .iota_cli_wrapper - .run_command(&command) - .and_then(|json| { - json - .get("iotaSignature") - .context("invalid JSON output: missing iotaSignature")? - .as_str() - .context("not a JSON string")? - .parse() - .map_err(|e| anyhow!("invalid IOTA signature: {e}")) - }) - .map_err(SecretStorageError::Other) - } -} diff --git a/identity_iota_interaction/src/keytool/storage.rs b/identity_iota_interaction/src/keytool/storage.rs deleted file mode 100644 index 6dc0f3c019..0000000000 --- a/identity_iota_interaction/src/keytool/storage.rs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::path::Path; - -use anyhow::anyhow; -use anyhow::Context as _; -use fastcrypto::ed25519::Ed25519Signature; -use fastcrypto::secp256k1::Secp256k1Signature; -use fastcrypto::secp256r1::Secp256r1Signature; -use fastcrypto::traits::Signer; -use serde::Deserialize; - -use crate::types::base_types::IotaAddress; -use crate::types::crypto::IotaKeyPair; -use crate::types::crypto::PublicKey; -use crate::types::crypto::SignatureScheme as IotaSignatureScheme; - -use super::internal::IotaCliWrapper; -use super::KeytoolSignerBuilder; - -#[derive(Clone, Default)] -pub struct KeytoolStorage { - iota_cli_wrapper: IotaCliWrapper, -} - -impl KeytoolStorage { - /// Returns a new [KeytoolStorage] that will use the IOTA binary in PATH. - pub fn new() -> Self { - Self::default() - } - - /// Returns a new [KeytoolStorage] that will use the provided IOTA binary. - pub fn new_with_custom_bin(iota_bin: impl AsRef) -> Self { - Self { - iota_cli_wrapper: IotaCliWrapper::new_with_custom_bin(iota_bin), - } - } - - /// Returns a [KeytoolSignerBuilder] to construct a [super::KeytoolSigner] after - /// selecting an address. - pub fn signer(&self) -> KeytoolSignerBuilder { - KeytoolSignerBuilder::new().iota_bin_location(self.iota_cli_wrapper.iota_bin()) - } - - /// Generates a new keypair of type `key_scheme`. - /// Returns the resulting [PublicKey] together with its alias. - pub fn generate_key(&self, key_scheme: IotaSignatureScheme) -> anyhow::Result<(PublicKey, String)> { - if !matches!( - &key_scheme, - IotaSignatureScheme::ED25519 | IotaSignatureScheme::Secp256k1 | IotaSignatureScheme::Secp256r1 - ) { - anyhow::bail!("key scheme {key_scheme} is not supported by the keytool"); - } - - let cmd = format!("client new-address --key-scheme {key_scheme}"); - let KeyGenOutput { alias, address } = { - let json_output = self.iota_cli_wrapper.run_command(&cmd)?; - serde_json::from_value(json_output)? - }; - - let pk = self - .iota_cli_wrapper - .get_key(address)? - .ok_or_else(|| anyhow!("key for address {address} wasn't found"))? - .0; - - Ok((pk, alias)) - } - - /// Inserts a new key in this keytool. - /// Returns the alias assigned to the inserted key. - pub fn insert_key(&self, key: IotaKeyPair) -> anyhow::Result { - let bech32_encoded_key = key.encode().map_err(|e| anyhow!("{e:?}"))?; - let key_scheme = key.public().scheme().to_string(); - let cmd = format!("keytool import {bech32_encoded_key} {key_scheme}"); - - let json_output = self.iota_cli_wrapper.run_command(&cmd)?; - let KeyGenOutput { alias, .. } = serde_json::from_value(json_output)?; - - Ok(alias) - } - - /// Uses the private key corresponding to [IotaAddress] `address` to sign `data`. - /// ## Notes - /// - SHA-512 is used to produce signatures when the key is ed25519. - /// - SHA-256 is used otherwise. - pub fn sign_raw(&self, address: IotaAddress, data: impl AsRef<[u8]>) -> anyhow::Result> { - let cmd = format!("keytool export {address}"); - let keypair = { - let json_output = self.iota_cli_wrapper.run_command(&cmd)?; - let KeyExportOutput { - exported_private_key: bech32_encoded_sk, - } = serde_json::from_value(json_output)?; - - IotaKeyPair::decode(&bech32_encoded_sk).map_err(|e| anyhow!("failed to decode private key: {e:?}"))? - }; - let data = data.as_ref(); - - let sig = match keypair { - IotaKeyPair::Ed25519(sk) => Signer::::sign(&sk, data).sig.to_bytes().to_vec(), - IotaKeyPair::Secp256r1(sk) => Signer::::sign(&sk, data).sig.to_vec(), - IotaKeyPair::Secp256k1(sk) => { - let sig = Signer::::sign(&sk, data); - sig.as_ref().to_vec() - } - }; - - Ok(sig) - } - - /// Updates an alias from `old_alias` to `new_alias` - /// If no value for `new_alias` is provided, a randomly generated one will be used. - pub fn update_alias(&self, old_alias: &str, new_alias: Option<&str>) -> anyhow::Result<()> { - let cmd = format!("keytool update-alias {old_alias} {}", new_alias.unwrap_or_default()); - self - .iota_cli_wrapper - .run_command(&cmd) - .context("failed to update alias")?; - - Ok(()) - } - - /// Returns the [PublicKey] for the given [IotaAddress] together with its alias. - pub fn get_key(&self, address: IotaAddress) -> anyhow::Result> { - self.iota_cli_wrapper.get_key(address) - } - - /// Returns the [PublicKey] that has the given alias, if any. - pub fn get_key_by_alias(&self, alias: &str) -> anyhow::Result> { - self.iota_cli_wrapper.get_key_by_alias(alias) - } -} - -#[derive(Deserialize)] -struct KeyGenOutput { - alias: String, - address: IotaAddress, -} - -#[derive(Deserialize)] -#[serde(rename_all = "camelCase")] -struct KeyExportOutput { - exported_private_key: String, -} diff --git a/identity_iota_interaction/src/lib.rs b/identity_iota_interaction/src/lib.rs deleted file mode 100644 index 64ea7b62db..0000000000 --- a/identity_iota_interaction/src/lib.rs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#![allow(missing_docs)] - -mod effects_mut_api; -mod iota_client_trait; -mod iota_verifiable_credential; -#[cfg(feature = "keytool")] -pub mod keytool; -mod move_call_traits; -mod move_type; -mod transaction_builder_trait; - -pub use effects_mut_api::*; -pub use iota_client_trait::*; -pub use iota_verifiable_credential::*; -#[cfg(feature = "keytool")] -pub use keytool::*; -pub use move_call_traits::*; -pub use move_type::*; -pub use transaction_builder_trait::*; - -#[cfg(target_arch = "wasm32")] -mod sdk_types; -#[cfg(target_arch = "wasm32")] -pub use sdk_types::*; - -#[cfg(not(target_arch = "wasm32"))] -pub use iota_sdk::*; -#[cfg(not(target_arch = "wasm32"))] -pub use move_core_types as move_types; -#[cfg(not(target_arch = "wasm32"))] -pub use shared_crypto; - -/// BCS serialized Transaction, where a Transaction includes the TransactionData and a Vec -pub type TransactionBcs = Vec; -/// BCS serialized TransactionData -/// TransactionData usually contain the ProgrammableTransaction, sender, kind = ProgrammableTransaction, -/// gas_coin, gas_budget, gas_price, expiration, ... -/// Example usage: -/// * TS: ExecuteTransactionBlockParams::transactionBlock - Base64 encoded TransactionDataBcs -pub type TransactionDataBcs = Vec; -/// BCS serialized Signature -pub type SignatureBcs = Vec; -/// BCS serialized ProgrammableTransaction -/// A ProgrammableTransaction -/// * has `inputs` (or *CallArgs*) and `commands` (or *Transactions*) -/// * is the result of ProgrammableTransactionBuilder::finish() -pub type ProgrammableTransactionBcs = Vec; -/// BCS serialized IotaTransactionBlockResponse -pub type IotaTransactionBlockResponseBcs = Vec; - -// dummy types, have to be replaced with actual types later on -pub type DummySigner = str; -pub type Hashable = Vec; -pub type Identity = (); - -/// `ident_str!` is a compile-time validated macro that constructs a -/// `&'static IdentStr` from a const `&'static str`. -/// -/// ### Example -/// -/// Creating a valid static or const [`IdentStr`]: -/// -/// ```rust -/// use move_core_types::ident_str; -/// use move_core_types::identifier::IdentStr; -/// const VALID_IDENT: &'static IdentStr = ident_str!("MyCoolIdentifier"); -/// -/// const THING_NAME: &'static str = "thing_name"; -/// const THING_IDENT: &'static IdentStr = ident_str!(THING_NAME); -/// ``` -/// -/// In contrast, creating an invalid [`IdentStr`] will fail at compile time: -/// -/// ```rust,compile_fail -/// use move_core_types::{ident_str, identifier::IdentStr}; -/// const INVALID_IDENT: &'static IdentStr = ident_str!("123Foo"); // Fails to compile! -/// ``` -// TODO(philiphayes): this should really be an associated const fn like `IdentStr::new`; -// unfortunately, both unsafe-reborrow and unsafe-transmute don't currently work -// inside const fn's. Only unsafe-transmute works inside static const-blocks -// (but not const-fn's). -#[macro_export] -macro_rules! ident_str { - ($ident:expr) => {{ - // Only static strings allowed. - let s: &'static str = $ident; - - // Only valid identifier strings are allowed. - // Note: Work-around hack to print an error message in a const block. - let is_valid = $crate::move_types::identifier::is_valid(s); - ["String is not a valid Move identifier"][!is_valid as usize]; - - // SAFETY: the following transmute is safe because - // (1) it's equivalent to the unsafe-reborrow inside IdentStr::ref_cast() - // (which we can't use b/c it's not const). - // (2) we've just asserted that IdentStr impls RefCast, which - // already guarantees the transmute is safe (RefCast checks that - // IdentStr(str) is #[repr(transparent)]). - // (3) both in and out lifetimes are 'static, so we're not widening the - // lifetime. (4) we've just asserted that the IdentStr passes the - // is_valid check. - // - // Note: this lint is unjustified and no longer checked. See issue: - // https://github.com/rust-lang/rust-clippy/issues/6372 - #[allow(clippy::transmute_ptr_to_ptr)] - unsafe { - ::std::mem::transmute::<&'static str, &'static $crate::move_types::identifier::IdentStr>(s) - } - }}; -} - -// Alias name for the Send trait controlled by the "send-sync-transaction" feature -cfg_if::cfg_if! { - if #[cfg(feature = "send-sync-transaction")] { - pub trait OptionalSend: Send {} - impl OptionalSend for T where T: Send {} - - pub trait OptionalSync: Sync {} - impl OptionalSync for T where T: Sync {} - } else { - pub trait OptionalSend: {} - impl OptionalSend for T {} - - pub trait OptionalSync: {} - impl OptionalSync for T where T: {} - } -} diff --git a/identity_iota_interaction/src/move_call_traits.rs b/identity_iota_interaction/src/move_call_traits.rs deleted file mode 100644 index e93abf1291..0000000000 --- a/identity_iota_interaction/src/move_call_traits.rs +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::HashMap; -use std::collections::HashSet; -use std::iter::IntoIterator; - -use async_trait::async_trait; -use serde::Serialize; - -use crate::rpc_types::IotaObjectData; -use crate::rpc_types::OwnedObjectRef; -use crate::types::base_types::IotaAddress; -use crate::types::base_types::ObjectID; -use crate::types::base_types::ObjectRef; -use crate::types::base_types::SequenceNumber; -use crate::types::transaction::Argument; -use crate::types::TypeTag; -use crate::MoveType; -use crate::OptionalSend; -use crate::ProgrammableTransactionBcs; - -#[derive(Debug, Clone, Copy)] -pub enum ControllerTokenRef { - Controller(ObjectRef), - Delegate(ObjectRef), -} - -impl ControllerTokenRef { - pub fn is_controller_cap(&self) -> bool { - matches!(self, ControllerTokenRef::Controller(_)) - } - - pub fn object_ref(&self) -> ObjectRef { - match self { - Self::Controller(obj_ref) => *obj_ref, - Self::Delegate(obj_ref) => *obj_ref, - } - } -} - -pub trait AssetMoveCalls { - type Error; - - fn new_asset( - inner: &T, - mutable: bool, - transferable: bool, - deletable: bool, - package: ObjectID, - ) -> Result; - - fn delete(asset: ObjectRef, package: ObjectID) -> Result; - - fn transfer( - asset: ObjectRef, - recipient: IotaAddress, - package: ObjectID, - ) -> Result; - - fn make_tx( - proposal: (ObjectID, SequenceNumber), - cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, - function_name: &'static str, - ) -> Result; - - fn accept_proposal( - proposal: (ObjectID, SequenceNumber), - recipient_cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, - ) -> Result; - - fn conclude_or_cancel( - proposal: (ObjectID, SequenceNumber), - sender_cap: ObjectRef, - asset: ObjectRef, - asset_type_param: TypeTag, - package: ObjectID, - ) -> Result; - - fn update( - asset: ObjectRef, - new_content: &T, - package: ObjectID, - ) -> Result; -} - -pub trait MigrationMoveCalls { - type Error; - - fn migrate_did_output( - did_output: ObjectRef, - creation_timestamp: Option, - migration_registry: OwnedObjectRef, - package: ObjectID, - ) -> anyhow::Result; -} - -pub trait BorrowIntentFnInternalT: FnOnce(&mut B, &HashMap) {} -impl BorrowIntentFnInternalT for T where T: FnOnce(&mut B, &HashMap) {} - -pub trait ControllerIntentFnInternalT: FnOnce(&mut B, &Argument) {} -impl ControllerIntentFnInternalT for T where T: FnOnce(&mut B, &Argument) {} - -#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -#[cfg_attr(not(target_arch = "wasm32"), async_trait)] -pub trait IdentityMoveCalls { - type Error; - type NativeTxBuilder; - - fn propose_borrow( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - objects: Vec, - expiration: Option, - package_id: ObjectID, - ) -> Result; - - fn execute_borrow>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - objects: Vec, - intent_fn: F, - package: ObjectID, - ) -> Result; - - fn create_and_execute_borrow( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - objects: Vec, - intent_fn: F, - expiration: Option, - package_id: ObjectID, - ) -> anyhow::Result - where - F: BorrowIntentFnInternalT; - - // We allow clippy::too_many_arguments here because splitting this trait function into multiple - // other functions or creating an options struct gathering multiple function arguments has lower - // priority at the moment. - // TODO: remove clippy::too_many_arguments allowance here - #[allow(clippy::too_many_arguments)] - fn propose_config_change( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - expiration: Option, - threshold: Option, - controllers_to_add: I1, - controllers_to_remove: HashSet, - controllers_to_update: I2, - package: ObjectID, - ) -> Result - where - I1: IntoIterator, - I2: IntoIterator; - - fn execute_config_change( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - proposal_id: ObjectID, - package: ObjectID, - ) -> Result; - - fn propose_controller_execution( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - controller_cap_id: ObjectID, - expiration: Option, - package_id: ObjectID, - ) -> Result; - - fn execute_controller_execution>( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package: ObjectID, - ) -> Result; - - fn create_and_execute_controller_execution( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - expiration: Option, - borrowing_controller_cap_ref: ObjectRef, - intent_fn: F, - package_id: ObjectID, - ) -> Result - where - F: ControllerIntentFnInternalT; - - async fn new_identity( - did_doc: Option<&[u8]>, - package_id: ObjectID, - ) -> Result; - - async fn new_with_controllers + OptionalSend>( - did_doc: Option<&[u8]>, - controllers: C, - threshold: u64, - package_id: ObjectID, - ) -> Result; - - fn approve_proposal( - identity: OwnedObjectRef, - controller_cap: ControllerTokenRef, - proposal_id: ObjectID, - package: ObjectID, - ) -> Result; - - fn propose_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - package_id: ObjectID, - ) -> Result; - - fn execute_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, - ) -> Result; - - async fn propose_update( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - did_doc: Option<&[u8]>, - expiration: Option, - package_id: ObjectID, - ) -> Result; - - async fn execute_update( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - package_id: ObjectID, - ) -> Result; - - fn create_and_execute_send( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - transfer_map: Vec<(ObjectID, IotaAddress)>, - expiration: Option, - objects: Vec<(ObjectRef, TypeTag)>, - package: ObjectID, - ) -> anyhow::Result; - - fn propose_upgrade( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - expiration: Option, - package_id: ObjectID, - ) -> Result; - - fn execute_upgrade( - identity: OwnedObjectRef, - capability: ControllerTokenRef, - proposal_id: ObjectID, - package_id: ObjectID, - ) -> Result; - - async fn delegate_controller_cap( - controller_cap: ObjectRef, - recipient: IotaAddress, - permissions: u32, - package: ObjectID, - ) -> Result; - - async fn revoke_delegation_token( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - delegation_token_id: ObjectID, - package: ObjectID, - ) -> Result; - - async fn unrevoke_delegation_token( - identity: OwnedObjectRef, - controller_cap: ObjectRef, - delegation_token_id: ObjectID, - package: ObjectID, - ) -> Result; - - async fn destroy_delegation_token( - identity: OwnedObjectRef, - delegation_token: ObjectRef, - package: ObjectID, - ) -> Result; -} diff --git a/identity_iota_interaction/src/move_type.rs b/identity_iota_interaction/src/move_type.rs deleted file mode 100644 index ac49e6ee40..0000000000 --- a/identity_iota_interaction/src/move_type.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020-2025 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::types::base_types::IotaAddress; -use crate::types::base_types::ObjectID; -use crate::types::TypeTag; -use crate::IotaVerifiableCredential; -use serde::Serialize; - -pub enum TypedValue<'a, T: MoveType> { - IotaVerifiableCredential(&'a IotaVerifiableCredential), - Other(&'a T), -} - -/// Trait for types that can be converted to a Move type. -pub trait MoveType: Serialize { - /// Returns the Move type for this type. - fn move_type(package: ObjectID) -> TypeTag; - - fn get_typed_value(&self, _package: ObjectID) -> TypedValue - where - Self: MoveType, - Self: Sized, - { - TypedValue::Other(self) - } -} - -impl MoveType for u8 { - fn move_type(_package: ObjectID) -> TypeTag { - TypeTag::U8 - } -} - -impl MoveType for u16 { - fn move_type(_package: ObjectID) -> TypeTag { - TypeTag::U16 - } -} - -impl MoveType for u32 { - fn move_type(_package: ObjectID) -> TypeTag { - TypeTag::U32 - } -} - -impl MoveType for u64 { - fn move_type(_package: ObjectID) -> TypeTag { - TypeTag::U64 - } -} - -impl MoveType for u128 { - fn move_type(_package: ObjectID) -> TypeTag { - TypeTag::U128 - } -} - -impl MoveType for bool { - fn move_type(_package: ObjectID) -> TypeTag { - TypeTag::Bool - } -} - -impl MoveType for IotaAddress { - fn move_type(_package: ObjectID) -> TypeTag { - TypeTag::Address - } -} - -impl MoveType for Vec { - fn move_type(package: ObjectID) -> TypeTag { - TypeTag::Vector(Box::new(T::move_type(package))) - } -} diff --git a/identity_iota_interaction/src/sdk_types/error.rs b/identity_iota_interaction/src/sdk_types/error.rs deleted file mode 100644 index 1448df9a33..0000000000 --- a/identity_iota_interaction/src/sdk_types/error.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use super::iota_types::base_types::{IotaAddress, TransactionDigest}; -use thiserror::Error; - -//pub use crate::json_rpc_error::Error as JsonRpcError; - -pub type IotaRpcResult = Result; - -#[derive(Error, Debug)] -pub enum Error { - #[error(transparent)] - Rpc(#[from] jsonrpsee::core::ClientError), - #[error(transparent)] - BcsSerialization(#[from] bcs::Error), - #[error("Subscription error: {0}")] - Subscription(String), - #[error("Failed to confirm tx status for {0:?} within {1} seconds.")] - FailToConfirmTransactionStatus(TransactionDigest, u64), - #[error("Data error: {0}")] - Data(String), - #[error( - "Client/Server api version mismatch, client api version: {client_version}, server api version: {server_version}" - )] - ServerVersionMismatch { - client_version: String, - server_version: String, - }, - #[error("Insufficient funds for address [{address}], requested amount: {amount}")] - InsufficientFunds { address: IotaAddress, amount: u128 }, - #[error(transparent)] - Json(#[from] serde_json::Error), - #[error("Error caused by a foreign function interface call: {0}")] - FfiError(String), // Added for IOTA interaction -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/generated_types.rs b/identity_iota_interaction/src/sdk_types/generated_types.rs deleted file mode 100644 index 03319749de..0000000000 --- a/identity_iota_interaction/src/sdk_types/generated_types.rs +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use fastcrypto::encoding::Base64; -use serde::Deserialize; -use serde::Serialize; - -use super::iota_json_rpc_types::iota_transaction::IotaTransactionBlockResponseOptions; -use super::iota_types::quorum_driver_types::ExecuteTransactionRequestType; -use super::types::crypto::Signature; -use super::types::transaction::TransactionData; - -use crate::rpc_types::EventFilter; -use crate::rpc_types::IotaObjectDataFilter; -use crate::rpc_types::IotaObjectDataOptions; -use crate::types::dynamic_field::DynamicFieldName; -use crate::types::event::EventID; -use crate::types::iota_serde::SequenceNumber; - -// The types defined in this file: -// * do not exist in the iota rust sdk -// * have an equivalent type in the iota typescript sdk -// * are needed for wasm-bindings -// * have been generated by @iota/sdk/typescript/scripts/generate.ts -// -// As there is no equivalent rust type in the iota rust sdk, we need to -// define equivalent rust types here. - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct ExecuteTransactionBlockParams { - /// BCS serialized transaction data bytes without its type tag, as base-64 encoded string. - transaction_block: Base64, - /// A list of signatures (`flag || signature || pubkey` bytes, as base-64 encoded string). Signature is committed to - /// the intent message of the transaction data, as base-64 encoded string. - signature: Vec, - /// options for specifying the content to be returned - options: Option, - /// The request type, derived from `IotaTransactionBlockResponseOptions` if None - request_type: Option, -} - -impl ExecuteTransactionBlockParams { - pub fn new( - tx_data: TransactionData, - signatures: Vec, - options: Option, - request_type: Option, - ) -> Self { - let tx_data_bcs = bcs::to_bytes(&tx_data).expect("this serialization cannot fail"); - let signatures_b64 = signatures - .into_iter() - .map(|sig| Base64::from_bytes(sig.as_ref())) - .collect(); - ExecuteTransactionBlockParams { - transaction_block: Base64::from_bytes(&tx_data_bcs), - signature: signatures_b64, - options, - request_type, - } - } -} - -/// Return the dynamic field object information for a specified object -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct GetDynamicFieldObjectParams { - /// The ID of the queried parent object - parent_id: String, - /// The Name of the dynamic field - name: DynamicFieldName, -} - -impl GetDynamicFieldObjectParams { - pub fn new(parent_id: String, name: DynamicFieldName) -> Self { - GetDynamicFieldObjectParams { parent_id, name } - } -} - -/// Return the object information for a specified object -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct GetObjectParams { - /// the ID of the queried object - id: String, - /// options for specifying the content to be returned - options: Option, -} - -impl GetObjectParams { - pub fn new(id: String, options: Option) -> Self { - GetObjectParams { id, options } - } -} - -/// Return the list of objects owned by an address. Note that if the address owns more than -/// `QUERY_MAX_RESULT_LIMIT` objects, the pagination is not accurate, because previous page may have -/// been updated when the next page is fetched. Please use iotax_queryObjects if this is a concern. -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct GetOwnedObjectsParams { - /// the owner's Iota address - owner: String, - /// An optional paging cursor. If provided, the query will start from the next item after the specified - /// cursor. Default to start from the first item if not specified. - cursor: Option, - /// Max number of items returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. - limit: Option, - /// If None, no filter will be applied - filter: Option, - /// config which fields to include in the response, by default only digest is included - options: Option, -} - -impl GetOwnedObjectsParams { - pub fn new( - owner: String, - cursor: Option, - limit: Option, - filter: Option, - options: Option, - ) -> Self { - GetOwnedObjectsParams { - owner, - cursor, - limit, - filter, - options, - } - } -} - -/// Return the transaction response object. -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct GetTransactionBlockParams { - /// the digest of the queried transaction - digest: String, - /// options for specifying the content to be returned - #[serde(skip_serializing_if = "Option::is_none")] - options: Option, -} - -impl GetTransactionBlockParams { - pub fn new(digest: String, options: Option) -> Self { - GetTransactionBlockParams { digest, options } - } -} - -/// Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by -/// this API, even if the object and version exists/existed. The result may vary across nodes depending -/// on their pruning policies. Return the object information for a specified version -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct TryGetPastObjectParams { - /// the ID of the queried object - id: String, - /// the version of the queried object. If None, default to the latest known version - version: SequenceNumber, - //// options for specifying the content to be returned - options: Option, -} - -impl TryGetPastObjectParams { - pub fn new(id: String, version: SequenceNumber, options: Option) -> Self { - TryGetPastObjectParams { id, version, options } - } -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub enum SortOrder { - Ascending, - Descending, -} - -impl SortOrder { - pub fn new(descending_order: bool) -> Self { - return if descending_order { - SortOrder::Descending - } else { - SortOrder::Ascending - }; - } -} - -/// Return list of events for a specified query criteria. -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct QueryEventsParams { - /// The event query criteria. See [Event filter](https://docs.iota.io/build/event_api#event-filters) - /// documentation for examples. - query: EventFilter, - /// optional paging cursor - cursor: Option, - /// maximum number of items per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. - limit: Option, - /// query result ordering, default to false (ascending order), oldest record first. - order: Option, -} - -impl QueryEventsParams { - pub fn new(query: EventFilter, cursor: Option, limit: Option, order: Option) -> Self { - QueryEventsParams { - query, - cursor, - limit, - order, - } - } -} - -/// Return all Coin<`coin_type`> objects owned by an address. -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct GetCoinsParams { - /// the owner's Iota address - owner: String, - /// optional type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC), - /// default to 0x2::iota::IOTA if not specified. - coin_type: Option, - /// optional paging cursor - cursor: Option, - /// maximum number of items per page - limit: Option, -} - -impl GetCoinsParams { - pub fn new(owner: String, coin_type: Option, cursor: Option, limit: Option) -> Self { - GetCoinsParams { - owner, - coin_type, - cursor, - limit, - } - } -} - -/// Params for `wait_for_transaction` / `wait_for_transaction`. -/// -/// Be careful when serializing with `serde_wasm_bindgen::to_value`, as `#[serde(flatten)]` -/// will turn the object into a `Map` instead of a plain object in Js. -/// Prefer serializing with `serde_wasm_bindgen::Serializer::json_compatible` or perform custom serialization. -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct WaitForTransactionParams { - /// Block digest and options for content that should be returned. - #[serde(flatten)] - get_transaction_block_params: GetTransactionBlockParams, - /// The amount of time to wait for a transaction block. Defaults to one minute. - #[serde(skip_serializing_if = "Option::is_none")] - timeout: Option, - /// The amount of time to wait between checks for the transaction block. Defaults to 2 seconds. - #[serde(skip_serializing_if = "Option::is_none")] - poll_interval: Option, -} - -impl WaitForTransactionParams { - pub fn new( - digest: String, - options: Option, - timeout: Option, - poll_interval: Option, - ) -> Self { - WaitForTransactionParams { - get_transaction_block_params: GetTransactionBlockParams::new(digest, options), - timeout, - poll_interval, - } - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_coin.rs b/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_coin.rs deleted file mode 100644 index 818dbb4fd7..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_coin.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::{Deserialize, Serialize}; -use serde_with::{serde_as}; - -use super::super::iota_types::{ - base_types::{ObjectID, ObjectRef, TransactionDigest, SequenceNumber}, - digests::ObjectDigest, - iota_serde::{BigInt, SequenceNumber as AsSequenceNumber} -}; - -use super::Page; - -pub type CoinPage = Page; - -#[serde_as] -#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Coin { - pub coin_type: String, - pub coin_object_id: ObjectID, - #[serde_as(as = "AsSequenceNumber")] - pub version: SequenceNumber, - pub digest: ObjectDigest, - #[serde_as(as = "BigInt")] - pub balance: u64, - pub previous_transaction: TransactionDigest, -} - -impl Coin { - pub fn object_ref(&self) -> ObjectRef { - (self.coin_object_id, self.version, self.digest) - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_event.rs b/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_event.rs deleted file mode 100644 index 339386eb0b..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_event.rs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::{Deserialize, Serialize}; -use serde_with::{serde_as, DisplayFromStr}; -use serde_json::Value; - -use fastcrypto::encoding::{Base58, Base64}; - -use super::super::iota_types::{ - base_types::{ObjectID, IotaAddress, TransactionDigest}, - event::EventID, - iota_serde::{BigInt, IotaStructTag} -}; -use super::super::move_core_types::{ - identifier::Identifier, - language_storage::{StructTag}, -}; - -use super::{Page}; - -pub type EventPage = Page; - -#[serde_as] -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)] -#[serde(rename = "Event", rename_all = "camelCase")] -pub struct IotaEvent { - /// Sequential event ID, ie (transaction seq number, event seq number). - /// 1) Serves as a unique event ID for each fullnode - /// 2) Also serves to sequence events for the purposes of pagination and - /// querying. A higher id is an event seen later by that fullnode. - /// This ID is the "cursor" for event querying. - pub id: EventID, - /// Move package where this event was emitted. - pub package_id: ObjectID, - #[serde_as(as = "DisplayFromStr")] - /// Move module where this event was emitted. - pub transaction_module: Identifier, - /// Sender's IOTA address. - pub sender: IotaAddress, - #[serde_as(as = "IotaStructTag")] - /// Move event type. - pub type_: StructTag, - /// Parsed json value of the event - pub parsed_json: Value, - /// Base64 encoded bcs bytes of the move event - #[serde(flatten)] - pub bcs: BcsEvent, - /// UTC timestamp in milliseconds since epoch (1/1/1970) - #[serde(skip_serializing_if = "Option::is_none")] - #[serde_as(as = "Option>")] - pub timestamp_ms: Option, -} - -#[serde_as] -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase", tag = "bcsEncoding")] -#[serde(from = "MaybeTaggedBcsEvent")] -pub enum BcsEvent { - Base64 { - #[serde_as(as = "Base64")] - bcs: Vec, - }, - Base58 { - #[serde_as(as = "Base58")] - bcs: Vec, - }, -} - -impl BcsEvent { - pub fn new(bytes: Vec) -> Self { - Self::Base64 { bcs: bytes } - } - - pub fn bytes(&self) -> &[u8] { - match self { - BcsEvent::Base64 { bcs } => bcs.as_ref(), - BcsEvent::Base58 { bcs } => bcs.as_ref(), - } - } - - pub fn into_bytes(self) -> Vec { - match self { - BcsEvent::Base64 { bcs } => bcs, - BcsEvent::Base58 { bcs } => bcs, - } - } -} - -#[allow(unused)] -#[serde_as] -#[derive(Serialize, Deserialize)] -#[serde(rename_all = "camelCase", untagged)] -enum MaybeTaggedBcsEvent { - Tagged(TaggedBcsEvent), - Base58 { - #[serde_as(as = "Base58")] - bcs: Vec, - }, -} - -#[serde_as] -#[derive(Serialize, Deserialize)] -#[serde(rename_all = "camelCase", tag = "bcsEncoding")] -enum TaggedBcsEvent { - Base64 { - #[serde_as(as = "Base64")] - bcs: Vec, - }, - Base58 { - #[serde_as(as = "Base58")] - bcs: Vec, - }, -} - -impl From for BcsEvent { - fn from(event: MaybeTaggedBcsEvent) -> BcsEvent { - let bcs = match event { - MaybeTaggedBcsEvent::Tagged(TaggedBcsEvent::Base58 { bcs }) - | MaybeTaggedBcsEvent::Base58 { bcs } => bcs, - MaybeTaggedBcsEvent::Tagged(TaggedBcsEvent::Base64 { bcs }) => bcs, - }; - - // Bytes are already decoded, force into Base64 variant to avoid serializing to - // base58 - Self::Base64 { bcs } - } -} - -#[serde_as] -#[derive(Clone, Debug, Serialize, Deserialize)] -pub enum EventFilter { - /// Query by sender address. - Sender(IotaAddress), - /// Return events emitted by the given transaction. - Transaction( - /// digest of the transaction, as base-64 encoded string - TransactionDigest, - ), - /// Return events emitted in a specified Package. - Package(ObjectID), - /// Return events emitted in a specified Move module. - /// If the event is defined in Module A but emitted in a tx with Module B, - /// query `MoveModule` by module B returns the event. - /// Query `MoveEventModule` by module A returns the event too. - MoveModule { - /// the Move package ID - package: ObjectID, - /// the module name - #[serde_as(as = "DisplayFromStr")] - module: Identifier, - }, - /// Return events with the given Move event struct name (struct tag). - /// For example, if the event is defined in `0xabcd::MyModule`, and named - /// `Foo`, then the struct tag is `0xabcd::MyModule::Foo`. - MoveEventType( - #[serde_as(as = "IotaStructTag")] - StructTag, - ), - /// Return events with the given Move module name where the event struct is - /// defined. If the event is defined in Module A but emitted in a tx - /// with Module B, query `MoveEventModule` by module A returns the - /// event. Query `MoveModule` by module B returns the event too. - MoveEventModule { - /// the Move package ID - package: ObjectID, - /// the module name - #[serde_as(as = "DisplayFromStr")] - module: Identifier, - }, - MoveEventField { - path: String, - value: Value, - }, - /// Return events emitted in [start_time, end_time] interval - #[serde(rename_all = "camelCase")] - TimeRange { - /// left endpoint of time interval, milliseconds since epoch, inclusive - #[serde_as(as = "BigInt")] - start_time: u64, - /// right endpoint of time interval, milliseconds since epoch, exclusive - #[serde_as(as = "BigInt")] - end_time: u64, - }, - - All(Vec), - Any(Vec), - And(Box, Box), - Or(Box, Box), -} - -pub trait Filter { - fn matches(&self, item: &T) -> bool; -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_move.rs b/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_move.rs deleted file mode 100644 index fa5e6b9969..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_move.rs +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::BTreeMap; -use std::boxed::Box; -use std::fmt::{self, Display, Formatter, Write}; - -use itertools::Itertools; - -use serde::Deserialize; -use serde::Serialize; -use serde_with::{serde_as}; -use serde_json::{json, Value}; - -use tracing::warn; - -use crate::types::{ - base_types::{IotaAddress, ObjectID}, - iota_serde::IotaStructTag, -}; - -use super::super::move_core_types::{ - language_storage::StructTag, - annotated_value::{MoveStruct, MoveValue, MoveVariant}, - identifier::Identifier, -}; - -#[serde_as] -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(untagged, rename = "MoveValue")] -pub enum IotaMoveValue { - // u64 and u128 are converted to String to avoid overflow - Number(u32), - Bool(bool), - Address(IotaAddress), - Vector(Vec), - String(String), - UID { id: ObjectID }, - Struct(IotaMoveStruct), - Option(Box>), - Variant(IotaMoveVariant), -} - -impl IotaMoveValue { - /// Extract values from MoveValue without type information in json format - pub fn to_json_value(self) -> Value { - match self { - IotaMoveValue::Struct(move_struct) => move_struct.to_json_value(), - IotaMoveValue::Vector(values) => IotaMoveStruct::Runtime(values).to_json_value(), - IotaMoveValue::Number(v) => json!(v), - IotaMoveValue::Bool(v) => json!(v), - IotaMoveValue::Address(v) => json!(v), - IotaMoveValue::String(v) => json!(v), - IotaMoveValue::UID { id } => json!({ "id": id }), - IotaMoveValue::Option(v) => json!(v), - IotaMoveValue::Variant(v) => v.to_json_value(), - } - } -} - -impl Display for IotaMoveValue { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - let mut writer = String::new(); - match self { - IotaMoveValue::Number(value) => write!(writer, "{value}")?, - IotaMoveValue::Bool(value) => write!(writer, "{value}")?, - IotaMoveValue::Address(value) => write!(writer, "{value}")?, - IotaMoveValue::String(value) => write!(writer, "{value}")?, - IotaMoveValue::UID { id } => write!(writer, "{id}")?, - IotaMoveValue::Struct(value) => write!(writer, "{value}")?, - IotaMoveValue::Option(value) => write!(writer, "{value:?}")?, - IotaMoveValue::Vector(vec) => { - write!( - writer, - "{}", - vec.iter().map(|value| format!("{value}")).join(",\n") - )?; - } - IotaMoveValue::Variant(value) => write!(writer, "{value}")?, - } - write!(f, "{}", writer.trim_end_matches('\n')) - } -} - -impl From for IotaMoveValue { - fn from(value: MoveValue) -> Self { - match value { - MoveValue::U8(value) => IotaMoveValue::Number(value.into()), - MoveValue::U16(value) => IotaMoveValue::Number(value.into()), - MoveValue::U32(value) => IotaMoveValue::Number(value), - MoveValue::U64(value) => IotaMoveValue::String(format!("{value}")), - MoveValue::U128(value) => IotaMoveValue::String(format!("{value}")), - MoveValue::U256(value) => IotaMoveValue::String(format!("{value}")), - MoveValue::Bool(value) => IotaMoveValue::Bool(value), - MoveValue::Vector(values) => { - IotaMoveValue::Vector(values.into_iter().map(|value| value.into()).collect()) - } - MoveValue::Struct(value) => { - // Best effort IOTA core type conversion - let MoveStruct { type_, fields } = &value; - if let Some(value) = try_convert_type(type_, fields) { - return value; - } - IotaMoveValue::Struct(value.into()) - } - MoveValue::Signer(value) | MoveValue::Address(value) => { - IotaMoveValue::Address(IotaAddress::from(ObjectID::from(value))) - } - MoveValue::Variant(MoveVariant { - type_, - variant_name, - tag: _, - fields, - }) => IotaMoveValue::Variant(IotaMoveVariant { - type_: type_.clone(), - variant: variant_name.to_string(), - fields: fields - .into_iter() - .map(|(id, value)| (id.into_string(), value.into())) - .collect::>(), - }), - } - } -} - -fn to_bytearray(value: &[MoveValue]) -> Option> { - if value.iter().all(|value| matches!(value, MoveValue::U8(_))) { - let bytearray = value - .iter() - .flat_map(|value| { - if let MoveValue::U8(u8) = value { - Some(*u8) - } else { - None - } - }) - .collect::>(); - Some(bytearray) - } else { - None - } -} - -#[serde_as] -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(rename = "MoveVariant")] -pub struct IotaMoveVariant { - #[serde(rename = "type")] - #[serde_as(as = "IotaStructTag")] - pub type_: StructTag, - pub variant: String, - pub fields: BTreeMap, -} - -impl IotaMoveVariant { - pub fn to_json_value(self) -> Value { - // We only care about values here, assuming type information is known at the - // client side. - let fields = self - .fields - .into_iter() - .map(|(key, value)| (key, value.to_json_value())) - .collect::>(); - json!({ - "variant": self.variant, - "fields": fields, - }) - } -} - -impl Display for IotaMoveVariant { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - let mut writer = String::new(); - let IotaMoveVariant { - type_, - variant, - fields, - } = self; - writeln!(writer)?; - writeln!(writer, " {}: {type_}", "type")?; - writeln!(writer, " {}: {variant}", "variant")?; - for (name, value) in fields { - let value = format!("{}", value); - let value = if value.starts_with('\n') { - indent(&value, 2) - } else { - value - }; - writeln!(writer, " {}: {value}", name)?; - } - - write!(f, "{}", writer.trim_end_matches('\n')) - } -} - -#[serde_as] -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(untagged, rename = "MoveStruct")] -pub enum IotaMoveStruct { - Runtime(Vec), - WithTypes { - #[serde(rename = "type")] - #[serde_as(as = "IotaStructTag")] - type_: StructTag, - fields: BTreeMap, - }, - WithFields(BTreeMap), -} - -impl IotaMoveStruct { - /// Extract values from MoveStruct without type information in json format - pub fn to_json_value(self) -> Value { - // Unwrap MoveStructs - match self { - IotaMoveStruct::Runtime(values) => { - let values = values - .into_iter() - .map(|value| value.to_json_value()) - .collect::>(); - json!(values) - } - // We only care about values here, assuming struct type information is known at the - // client side. - IotaMoveStruct::WithTypes { type_: _, fields } | IotaMoveStruct::WithFields(fields) => { - let fields = fields - .into_iter() - .map(|(key, value)| (key, value.to_json_value())) - .collect::>(); - json!(fields) - } - } - } - - pub fn read_dynamic_field_value(&self, field_name: &str) -> Option { - match self { - IotaMoveStruct::WithFields(fields) => fields.get(field_name).cloned(), - IotaMoveStruct::WithTypes { type_: _, fields } => fields.get(field_name).cloned(), - _ => None, - } - } -} - -impl Display for IotaMoveStruct { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - let mut writer = String::new(); - match self { - IotaMoveStruct::Runtime(_) => {} - IotaMoveStruct::WithFields(fields) => { - for (name, value) in fields { - writeln!(writer, "{}: {value}", name)?; - } - } - IotaMoveStruct::WithTypes { type_, fields } => { - writeln!(writer)?; - writeln!(writer, " {}: {type_}", "type")?; - for (name, value) in fields { - let value = format!("{value}"); - let value = if value.starts_with('\n') { - indent(&value, 2) - } else { - value - }; - writeln!(writer, " {}: {value}", name)?; - } - } - } - write!(f, "{}", writer.trim_end_matches('\n')) - } -} - -fn indent(d: &T, indent: usize) -> String { - d.to_string() - .lines() - .map(|line| format!("{:indent$}{line}", "")) - .join("\n") -} - -fn try_convert_type( - type_: &StructTag, - fields: &[(Identifier, MoveValue)], -) -> Option { - let struct_name = format!( - "0x{}::{}::{}", - type_.address.short_str_lossless(), - type_.module, - type_.name - ); - let mut values = fields - .iter() - .map(|(id, value)| (id.to_string(), value)) - .collect::>(); - match struct_name.as_str() { - "0x1::string::String" | "0x1::ascii::String" => { - if let Some(MoveValue::Vector(bytes)) = values.remove("bytes") { - return to_bytearray(bytes) - .and_then(|bytes| String::from_utf8(bytes).ok()) - .map(IotaMoveValue::String); - } - } - "0x2::url::Url" => { - return values.remove("url").cloned().map(IotaMoveValue::from); - } - "0x2::object::ID" => { - return values.remove("bytes").cloned().map(IotaMoveValue::from); - } - "0x2::object::UID" => { - let id = values.remove("id").cloned().map(IotaMoveValue::from); - if let Some(IotaMoveValue::Address(address)) = id { - return Some(IotaMoveValue::UID { - id: ObjectID::from(address), - }); - } - } - "0x2::balance::Balance" => { - return values.remove("value").cloned().map(IotaMoveValue::from); - } - "0x1::option::Option" => { - if let Some(MoveValue::Vector(values)) = values.remove("vec") { - return Some(IotaMoveValue::Option(Box::new( - // in Move option is modeled as vec of 1 element - values.first().cloned().map(IotaMoveValue::from), - ))); - } - } - _ => return None, - } - warn!( - fields =? fields, - "Failed to convert {struct_name} to IotaMoveValue" - ); - None -} - -impl From for IotaMoveStruct { - fn from(move_struct: MoveStruct) -> Self { - IotaMoveStruct::WithTypes { - type_: move_struct.type_, - fields: move_struct - .fields - .into_iter() - .map(|(id, value)| (id.into_string(), value.into())) - .collect(), - } - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_object.rs b/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_object.rs deleted file mode 100644 index 41e84546ae..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_object.rs +++ /dev/null @@ -1,808 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::BTreeMap; -use std::string::String; -use std::fmt::{self, Display, Formatter, Write}; -use std::cmp::Ordering; - -use schemars::JsonSchema; -use serde::Deserialize; -use serde::Serialize; -use serde_with::{DisplayFromStr, serde_as}; -use serde_json::Value; - -use anyhow::anyhow; - -use crate::move_core_types::{ - identifier::Identifier, - language_storage::StructTag -}; -use crate::types::{ - base_types::{ObjectID, SequenceNumber, ObjectType, ObjectRef, ObjectInfo, IotaAddress}, - move_package::{TypeOrigin, UpgradeInfo, MovePackage}, - iota_serde::{IotaStructTag, BigInt, SequenceNumber as AsSequenceNumber}, - digests::{ObjectDigest,TransactionDigest}, - object::Owner, - error::{IotaObjectResponseError, UserInputResult, UserInputError}, - gas_coin::GasCoin, -}; - -use fastcrypto::encoding::Base64; - -use super::{ - Page, - iota_move::{IotaMoveStruct, IotaMoveValue}, -}; - -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] -pub struct IotaObjectResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub data: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl IotaObjectResponse { - pub fn new(data: Option, error: Option) -> Self { - Self { data, error } - } - - pub fn new_with_data(data: IotaObjectData) -> Self { - Self { - data: Some(data), - error: None, - } - } - - pub fn new_with_error(error: IotaObjectResponseError) -> Self { - Self { - data: None, - error: Some(error), - } - } -} - -impl Ord for IotaObjectResponse { - fn cmp(&self, other: &Self) -> Ordering { - match (&self.data, &other.data) { - (Some(data), Some(data_2)) => { - if data.object_id.cmp(&data_2.object_id).eq(&Ordering::Greater) { - return Ordering::Greater; - } else if data.object_id.cmp(&data_2.object_id).eq(&Ordering::Less) { - return Ordering::Less; - } - Ordering::Equal - } - // In this ordering those with data will come before IotaObjectResponses that are - // errors. - (Some(_), None) => Ordering::Less, - (None, Some(_)) => Ordering::Greater, - // IotaObjectResponses that are errors are just considered equal. - _ => Ordering::Equal, - } - } -} - -impl PartialOrd for IotaObjectResponse { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - -impl IotaObjectResponse { - pub fn move_object_bcs(&self) -> Option<&Vec> { - match &self.data { - Some(IotaObjectData { - bcs: Some(IotaRawData::MoveObject(obj)), - .. - }) => Some(&obj.bcs_bytes), - _ => None, - } - } - - pub fn owner(&self) -> Option { - if let Some(data) = &self.data { - return data.owner; - } - None - } - - pub fn object_id(&self) -> Result { - match (&self.data, &self.error) { - (Some(obj_data), None) => Ok(obj_data.object_id), - (None, Some(IotaObjectResponseError::NotExists { object_id })) => Ok(*object_id), - ( - None, - Some(IotaObjectResponseError::Deleted { - object_id, - version: _, - digest: _, - }), - ) => Ok(*object_id), - _ => Err(anyhow!( - "Could not get object_id, something went wrong with IotaObjectResponse construction." - )), - } - } - - pub fn object_ref_if_exists(&self) -> Option { - match (&self.data, &self.error) { - (Some(obj_data), None) => Some(obj_data.object_ref()), - _ => None, - } - } -} - -#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq)] -pub struct DisplayFieldsResponse { - pub data: Option>, - pub error: Option, -} - -#[serde_as] -#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "camelCase", rename = "ObjectData")] -pub struct IotaObjectData { - pub object_id: ObjectID, - /// Object version. - #[serde_as(as = "AsSequenceNumber")] - pub version: SequenceNumber, - /// Base64 string representing the object digest - pub digest: ObjectDigest, - /// The type of the object. Default to be None unless - /// IotaObjectDataOptions.showType is set to true - #[serde_as(as = "Option")] - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub type_: Option, - // Default to be None because otherwise it will be repeated for the getOwnedObjects endpoint - /// The owner of this object. Default to be None unless - /// IotaObjectDataOptions.showOwner is set to true - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - /// The digest of the transaction that created or last mutated this object. - /// Default to be None unless IotaObjectDataOptions. - /// showPreviousTransaction is set to true - #[serde(skip_serializing_if = "Option::is_none")] - pub previous_transaction: Option, - /// The amount of IOTA we would rebate if this object gets deleted. - /// This number is re-calculated each time the object is mutated based on - /// the present storage gas price. - #[serde_as(as = "Option>")] - #[serde(skip_serializing_if = "Option::is_none")] - pub storage_rebate: Option, - /// The Display metadata for frontend UI rendering, default to be None - /// unless IotaObjectDataOptions.showContent is set to true This can also - /// be None if the struct type does not have Display defined - #[serde(skip_serializing_if = "Option::is_none")] - pub display: Option, - /// Move object content or package content, default to be None unless - /// IotaObjectDataOptions.showContent is set to true - #[serde(skip_serializing_if = "Option::is_none")] - pub content: Option, - /// Move object content or package content in BCS, default to be None unless - /// IotaObjectDataOptions.showBcs is set to true - #[serde(skip_serializing_if = "Option::is_none")] - pub bcs: Option, -} - -impl IotaObjectData { - pub fn object_ref(&self) -> ObjectRef { - (self.object_id, self.version, self.digest) - } - - pub fn object_type(&self) -> anyhow::Result { - self.type_ - .as_ref() - .ok_or_else(|| anyhow!("type is missing for object {:?}", self.object_id)) - .cloned() - } - - pub fn is_gas_coin(&self) -> bool { - match self.type_.as_ref() { - Some(ObjectType::Struct(ty)) if ty.is_gas_coin() => true, - Some(_) => false, - None => false, - } - } -} - -impl Display for IotaObjectData { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - let type_ = if let Some(type_) = &self.type_ { - type_.to_string() - } else { - "Unknown Type".into() - }; - let mut writer = String::new(); - writeln!( - writer, - "{}", - format!("----- {type_} ({}[{}]) -----", self.object_id, self.version) - )?; - if let Some(owner) = self.owner { - writeln!(writer, "{}: {owner}", "Owner")?; - } - - writeln!( - writer, - "{}: {}", - "Version", - self.version - )?; - if let Some(storage_rebate) = self.storage_rebate { - writeln!( - writer, - "{}: {storage_rebate}", - "Storage Rebate", - )?; - } - - if let Some(previous_transaction) = self.previous_transaction { - writeln!( - writer, - "{}: {previous_transaction:?}", - "Previous Transaction", - )?; - } - if let Some(content) = self.content.as_ref() { - writeln!(writer, "{}", "----- Data -----")?; - write!(writer, "{content}")?; - } - - write!(f, "{writer}") - } -} - -#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq, Default)] -#[serde(rename_all = "camelCase", rename = "ObjectDataOptions", default)] -pub struct IotaObjectDataOptions { - /// Whether to show the type of the object. Default to be False - pub show_type: bool, - /// Whether to show the owner of the object. Default to be False - pub show_owner: bool, - /// Whether to show the previous transaction digest of the object. Default - /// to be False - pub show_previous_transaction: bool, - /// Whether to show the Display metadata of the object for frontend - /// rendering. Default to be False - pub show_display: bool, - /// Whether to show the content(i.e., package content or Move struct - /// content) of the object. Default to be False - pub show_content: bool, - /// Whether to show the content in BCS format. Default to be False - pub show_bcs: bool, - /// Whether to show the storage rebate of the object. Default to be False - pub show_storage_rebate: bool, -} - -impl IotaObjectDataOptions { - pub fn new() -> Self { - Self::default() - } - - /// return BCS data and all other metadata such as storage rebate - pub fn bcs_lossless() -> Self { - Self { - show_bcs: true, - show_type: true, - show_owner: true, - show_previous_transaction: true, - show_display: false, - show_content: false, - show_storage_rebate: true, - } - } - - /// return full content except bcs - pub fn full_content() -> Self { - Self { - show_bcs: false, - show_type: true, - show_owner: true, - show_previous_transaction: true, - show_display: false, - show_content: true, - show_storage_rebate: true, - } - } - - pub fn with_content(mut self) -> Self { - self.show_content = true; - self - } - - pub fn with_owner(mut self) -> Self { - self.show_owner = true; - self - } - - pub fn with_type(mut self) -> Self { - self.show_type = true; - self - } - - pub fn with_display(mut self) -> Self { - self.show_display = true; - self - } - - pub fn with_bcs(mut self) -> Self { - self.show_bcs = true; - self - } - - pub fn with_previous_transaction(mut self) -> Self { - self.show_previous_transaction = true; - self - } - - pub fn is_not_in_object_info(&self) -> bool { - self.show_bcs || self.show_content || self.show_display || self.show_storage_rebate - } -} - -impl IotaObjectResponse { - /// Returns a reference to the object if there is any, otherwise an Err if - /// the object does not exist or is deleted. - pub fn object(&self) -> Result<&IotaObjectData, IotaObjectResponseError> { - if let Some(data) = &self.data { - Ok(data) - } else if let Some(error) = &self.error { - Err(error.clone()) - } else { - // We really shouldn't reach this code block since either data, or error field - // should always be filled. - Err(IotaObjectResponseError::Unknown) - } - } - - /// Returns the object value if there is any, otherwise an Err if - /// the object does not exist or is deleted. - pub fn into_object(self) -> Result { - match self.object() { - Ok(data) => Ok(data.clone()), - Err(error) => Err(error), - } - } -} - -#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq, Ord, PartialOrd, JsonSchema)] -#[serde(rename_all = "camelCase", rename = "ObjectRef")] -pub struct IotaObjectRef { - /// Hex code as string representing the object id - pub object_id: ObjectID, - /// Object version. - pub version: SequenceNumber, - /// Base64 string representing the object digest - pub digest: ObjectDigest, -} - -impl IotaObjectRef { - pub fn to_object_ref(&self) -> ObjectRef { - (self.object_id, self.version, self.digest) - } -} - -impl Display for IotaObjectRef { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!( - f, - "Object ID: {}, version: {}, digest: {}", - self.object_id, self.version, self.digest - ) - } -} - -impl From for IotaObjectRef { - fn from(oref: ObjectRef) -> Self { - Self { - object_id: oref.0, - version: oref.1, - digest: oref.2, - } - } -} - -pub trait IotaData: Sized { - type ObjectType; - type PackageType; - // Code is commented out because MoveObject and MoveStructLayout - // introduce too many dependencies - // fn try_from_object(object: MoveObject, layout: MoveStructLayout) - // -> Result; - // fn try_from_package(package: MovePackage) -> Result; - fn try_as_move(&self) -> Option<&Self::ObjectType>; - fn try_into_move(self) -> Option; - fn try_as_package(&self) -> Option<&Self::PackageType>; - fn type_(&self) -> Option<&StructTag>; -} - -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(tag = "dataType", rename_all = "camelCase", rename = "RawData")] -pub enum IotaRawData { - // Manually handle generic schema generation - MoveObject(IotaRawMoveObject), - Package(IotaRawMovePackage), -} - -impl IotaData for IotaRawData { - type ObjectType = IotaRawMoveObject; - type PackageType = IotaRawMovePackage; - - // try_from_object() and try_from_package() are not defined here because - // MoveObject and MoveStructLayout introduce too many dependencies - - fn try_as_move(&self) -> Option<&Self::ObjectType> { - match self { - Self::MoveObject(o) => Some(o), - Self::Package(_) => None, - } - } - - fn try_into_move(self) -> Option { - match self { - Self::MoveObject(o) => Some(o), - Self::Package(_) => None, - } - } - - fn try_as_package(&self) -> Option<&Self::PackageType> { - match self { - Self::MoveObject(_) => None, - Self::Package(p) => Some(p), - } - } - - fn type_(&self) -> Option<&StructTag> { - match self { - Self::MoveObject(o) => Some(&o.type_), - Self::Package(_) => None, - } - } -} - -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(tag = "dataType", rename_all = "camelCase", rename = "Data")] -pub enum IotaParsedData { - // Manually handle generic schema generation - MoveObject(IotaParsedMoveObject), - Package(IotaMovePackage), -} - -impl IotaData for IotaParsedData { - type ObjectType = IotaParsedMoveObject; - type PackageType = IotaMovePackage; - - // try_from_object() and try_from_package() are not defined here because - // MoveObject and MoveStructLayout introduce too many dependencies - - fn try_as_move(&self) -> Option<&Self::ObjectType> { - match self { - Self::MoveObject(o) => Some(o), - Self::Package(_) => None, - } - } - - fn try_into_move(self) -> Option { - match self { - Self::MoveObject(o) => Some(o), - Self::Package(_) => None, - } - } - - fn try_as_package(&self) -> Option<&Self::PackageType> { - match self { - Self::MoveObject(_) => None, - Self::Package(p) => Some(p), - } - } - - fn type_(&self) -> Option<&StructTag> { - match self { - Self::MoveObject(o) => Some(&o.type_), - Self::Package(_) => None, - } - } -} - -impl Display for IotaParsedData { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - let mut writer = String::new(); - match self { - IotaParsedData::MoveObject(o) => { - writeln!(writer, "{}: {}", "type", o.type_)?; - write!(writer, "{}", &o.fields)?; - } - IotaParsedData::Package(p) => { - write!( - writer, - "{}: {:?}", - "Modules", - p.disassembled.keys() - )?; - } - } - write!(f, "{writer}") - } -} - -#[serde_as] -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(rename = "MoveObject", rename_all = "camelCase")] -pub struct IotaParsedMoveObject { - #[serde(rename = "type")] - #[serde_as(as = "IotaStructTag")] - pub type_: StructTag, - pub fields: IotaMoveStruct, -} - -impl IotaParsedMoveObject { - // try_from_object_read()is not defined here because - // MoveObject introduces too many dependencies - - pub fn read_dynamic_field_value(&self, field_name: &str) -> Option { - match &self.fields { - IotaMoveStruct::WithFields(fields) => fields.get(field_name).cloned(), - IotaMoveStruct::WithTypes { fields, .. } => fields.get(field_name).cloned(), - _ => None, - } - } -} - -#[serde_as] -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(rename = "RawMoveObject", rename_all = "camelCase")] -pub struct IotaRawMoveObject { - #[serde(rename = "type")] - #[serde_as(as = "IotaStructTag")] - pub type_: StructTag, - pub version: SequenceNumber, - #[serde_as(as = "Base64")] - pub bcs_bytes: Vec, -} - -impl IotaRawMoveObject { - pub fn deserialize<'a, T: Deserialize<'a>>(&'a self) -> Result { - Ok(bcs::from_bytes(self.bcs_bytes.as_slice())?) - } -} - -#[serde_as] -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(rename = "RawMovePackage", rename_all = "camelCase")] -pub struct IotaRawMovePackage { - pub id: ObjectID, - pub version: SequenceNumber, - #[serde_as(as = "BTreeMap<_, Base64>")] - pub module_map: BTreeMap>, - pub type_origin_table: Vec, - pub linkage_table: BTreeMap, -} - -impl From for IotaRawMovePackage { - fn from(p: MovePackage) -> Self { - Self { - id: p.id(), - version: p.version(), - module_map: p.serialized_module_map().clone(), - type_origin_table: p.type_origin_table().clone(), - linkage_table: p.linkage_table().clone(), - } - } -} - -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] -#[serde(tag = "status", content = "details", rename = "ObjectRead")] -pub enum IotaPastObjectResponse { - /// The object exists and is found with this version - VersionFound(IotaObjectData), - /// The object does not exist - ObjectNotExists(ObjectID), - /// The object is found to be deleted with this version - ObjectDeleted(IotaObjectRef), - /// The object exists but not found with this version - VersionNotFound(ObjectID, SequenceNumber), - /// The asked object version is higher than the latest - VersionTooHigh { - object_id: ObjectID, - asked_version: SequenceNumber, - latest_version: SequenceNumber, - }, -} - -impl IotaPastObjectResponse { - /// Returns a reference to the object if there is any, otherwise an Err - pub fn object(&self) -> UserInputResult<&IotaObjectData> { - match &self { - Self::ObjectDeleted(oref) => Err(UserInputError::ObjectDeleted { - object_ref: oref.to_object_ref(), - }), - Self::ObjectNotExists(id) => Err(UserInputError::ObjectNotFound { - object_id: *id, - version: None, - }), - Self::VersionFound(o) => Ok(o), - Self::VersionNotFound(id, seq_num) => Err(UserInputError::ObjectNotFound { - object_id: *id, - version: Some(*seq_num), - }), - Self::VersionTooHigh { - object_id, - asked_version, - latest_version, - } => Err(UserInputError::ObjectSequenceNumberTooHigh { - object_id: *object_id, - asked_version: *asked_version, - latest_version: *latest_version, - }), - } - } - - /// Returns the object value if there is any, otherwise an Err - pub fn into_object(self) -> UserInputResult { - match self { - Self::ObjectDeleted(oref) => Err(UserInputError::ObjectDeleted { - object_ref: oref.to_object_ref(), - }), - Self::ObjectNotExists(id) => Err(UserInputError::ObjectNotFound { - object_id: id, - version: None, - }), - Self::VersionFound(o) => Ok(o), - Self::VersionNotFound(object_id, version) => Err(UserInputError::ObjectNotFound { - object_id, - version: Some(version), - }), - Self::VersionTooHigh { - object_id, - asked_version, - latest_version, - } => Err(UserInputError::ObjectSequenceNumberTooHigh { - object_id, - asked_version, - latest_version, - }), - } - } -} - -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(rename = "MovePackage", rename_all = "camelCase")] -pub struct IotaMovePackage { - pub disassembled: BTreeMap, -} - -pub type ObjectsPage = Page; - -#[serde_as] -#[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq)] -#[serde(rename = "GetPastObjectRequest", rename_all = "camelCase")] -pub struct IotaGetPastObjectRequest { - /// the ID of the queried object - pub object_id: ObjectID, - /// the version of the queried object. - #[serde_as(as = "AsSequenceNumber")] - pub version: SequenceNumber, -} - -#[serde_as] -#[derive(Clone, Debug, Serialize, Deserialize)] -pub enum IotaObjectDataFilter { - MatchAll(Vec), - MatchAny(Vec), - MatchNone(Vec), - /// Query by type a specified Package. - Package(ObjectID), - /// Query by type a specified Move module. - MoveModule { - /// the Move package ID - package: ObjectID, - /// the module name - #[serde_as(as = "DisplayFromStr")] - module: Identifier, - }, - /// Query by type - StructType( - #[serde_as(as = "IotaStructTag")] - StructTag, - ), - AddressOwner(IotaAddress), - ObjectOwner(ObjectID), - ObjectId(ObjectID), - // allow querying for multiple object ids - ObjectIds(Vec), - Version( - #[serde_as(as = "BigInt")] - u64, - ), -} - -impl IotaObjectDataFilter { - pub fn gas_coin() -> Self { - Self::StructType(GasCoin::type_()) - } - - pub fn and(self, other: Self) -> Self { - Self::MatchAll(vec![self, other]) - } - pub fn or(self, other: Self) -> Self { - Self::MatchAny(vec![self, other]) - } - pub fn not(self, other: Self) -> Self { - Self::MatchNone(vec![self, other]) - } - - pub fn matches(&self, object: &ObjectInfo) -> bool { - match self { - IotaObjectDataFilter::MatchAll(filters) => !filters.iter().any(|f| !f.matches(object)), - IotaObjectDataFilter::MatchAny(filters) => filters.iter().any(|f| f.matches(object)), - IotaObjectDataFilter::MatchNone(filters) => !filters.iter().any(|f| f.matches(object)), - IotaObjectDataFilter::StructType(s) => { - let obj_tag: StructTag = match &object.type_ { - ObjectType::Package => return false, - ObjectType::Struct(s) => s.clone().into(), - }; - // If people do not provide type_params, we will match all type_params - // e.g. `0x2::coin::Coin` can match `0x2::coin::Coin<0x2::iota::IOTA>` - if !s.type_params.is_empty() && s.type_params != obj_tag.type_params { - false - } else { - obj_tag.address == s.address - && obj_tag.module == s.module - && obj_tag.name == s.name - } - } - IotaObjectDataFilter::MoveModule { package, module } => { - matches!(&object.type_, ObjectType::Struct(s) if &ObjectID::from(s.address()) == package - && s.module() == module.as_ident_str()) - } - IotaObjectDataFilter::Package(p) => { - matches!(&object.type_, ObjectType::Struct(s) if &ObjectID::from(s.address()) == p) - } - IotaObjectDataFilter::AddressOwner(a) => { - matches!(object.owner, Owner::AddressOwner(addr) if &addr == a) - } - IotaObjectDataFilter::ObjectOwner(o) => { - matches!(object.owner, Owner::ObjectOwner(addr) if addr == IotaAddress::from(*o)) - } - IotaObjectDataFilter::ObjectId(id) => &object.object_id == id, - IotaObjectDataFilter::ObjectIds(ids) => ids.contains(&object.object_id), - IotaObjectDataFilter::Version(v) => object.version.value() == *v, - } - } -} - -#[derive(Debug, Clone, Deserialize, Serialize, Default)] -#[serde(rename_all = "camelCase", rename = "ObjectResponseQuery", default)] -pub struct IotaObjectResponseQuery { - /// If None, no filter will be applied - pub filter: Option, - /// config which fields to include in the response, by default only digest - /// is included - pub options: Option, -} - -impl IotaObjectResponseQuery { - pub fn new( - filter: Option, - options: Option, - ) -> Self { - Self { filter, options } - } - - pub fn new_with_filter(filter: IotaObjectDataFilter) -> Self { - Self { - filter: Some(filter), - options: None, - } - } - - pub fn new_with_options(options: IotaObjectDataOptions) -> Self { - Self { - filter: None, - options: Some(options), - } - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_transaction.rs b/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_transaction.rs deleted file mode 100644 index cc2ffcf401..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/iota_transaction.rs +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{ - vec::Vec, - fmt::{self, Display, Formatter}, -}; - -use enum_dispatch::enum_dispatch; -use schemars::JsonSchema; -use serde::Deserialize; -use serde::Serialize; -use serde_with::serde_as; - -use crate::{iota_types::{base_types::EpochId, digests::{TransactionDigest, TransactionEventsDigest}, gas::GasCostSummary, storage::{DeleteKind, WriteKind}}, types::{ - base_types::{ObjectID, SequenceNumber}, execution_status::ExecutionStatus, object::Owner, quorum_driver_types::ExecuteTransactionRequestType, - iota_serde::{BigInt, SequenceNumber as AsSequenceNumber}, -}}; - -use super::iota_object::IotaObjectRef; - -/// BCS serialized IotaTransactionBlockEffects -pub type IotaTransactionBlockEffectsBcs = Vec; - -/// BCS serialized IotaTransactionBlockEvents -pub type IotaTransactionBlockEventsBcs = Vec; - -/// BCS serialized ObjectChange -pub type ObjectChangeBcs = Vec; - -/// BCS serialized BalanceChange -pub type BalanceChangeBcs = Vec; - -/// BCS serialized IotaTransactionBlockKind -pub type IotaTransactionBlockKindBcs = Vec; - -pub type CheckpointSequenceNumber = u64; - -#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq, Default)] -#[serde( - rename_all = "camelCase", - rename = "TransactionBlockResponseOptions", - default -)] -pub struct IotaTransactionBlockResponseOptions { - /// Whether to show transaction input data. Default to be False - pub show_input: bool, - /// Whether to show bcs-encoded transaction input data - pub show_raw_input: bool, - /// Whether to show transaction effects. Default to be False - pub show_effects: bool, - /// Whether to show transaction events. Default to be False - pub show_events: bool, - /// Whether to show object_changes. Default to be False - pub show_object_changes: bool, - /// Whether to show balance_changes. Default to be False - pub show_balance_changes: bool, - /// Whether to show raw transaction effects. Default to be False - pub show_raw_effects: bool, -} - -impl IotaTransactionBlockResponseOptions { - pub fn new() -> Self { - Self::default() - } - - pub fn full_content() -> Self { - Self { - show_effects: true, - show_input: true, - show_raw_input: true, - show_events: true, - show_object_changes: true, - show_balance_changes: true, - // This field is added for graphql execution. We keep it false here - // so current users of `full_content` will not get raw effects unexpectedly. - show_raw_effects: false, - } - } - - pub fn with_input(mut self) -> Self { - self.show_input = true; - self - } - - pub fn with_raw_input(mut self) -> Self { - self.show_raw_input = true; - self - } - - pub fn with_effects(mut self) -> Self { - self.show_effects = true; - self - } - - pub fn with_events(mut self) -> Self { - self.show_events = true; - self - } - - pub fn with_balance_changes(mut self) -> Self { - self.show_balance_changes = true; - self - } - - pub fn with_object_changes(mut self) -> Self { - self.show_object_changes = true; - self - } - - pub fn with_raw_effects(mut self) -> Self { - self.show_raw_effects = true; - self - } - - /// default to return `WaitForEffectsCert` unless some options require - /// local execution - pub fn default_execution_request_type(&self) -> ExecuteTransactionRequestType { - // if people want effects or events, they typically want to wait for local - // execution - if self.require_effects() { - ExecuteTransactionRequestType::WaitForLocalExecution - } else { - ExecuteTransactionRequestType::WaitForEffectsCert - } - } - - pub fn require_input(&self) -> bool { - self.show_input || self.show_raw_input || self.show_object_changes - } - - pub fn require_effects(&self) -> bool { - self.show_effects - || self.show_events - || self.show_balance_changes - || self.show_object_changes - || self.show_raw_effects - } - - pub fn only_digest(&self) -> bool { - self == &Self::default() - } -} - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, JsonSchema)] -#[serde(rename = "ExecutionStatus", rename_all = "camelCase", tag = "status")] -pub enum IotaExecutionStatus { - // Gas used in the success case. - Success, - // Gas used in the failed case, and the error. - Failure { error: String }, -} - -impl Display for IotaExecutionStatus { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - match self { - Self::Success => write!(f, "success"), - Self::Failure { error } => write!(f, "failure due to {error}"), - } - } -} - -impl IotaExecutionStatus { - pub fn is_ok(&self) -> bool { - matches!(self, IotaExecutionStatus::Success { .. }) - } - pub fn is_err(&self) -> bool { - matches!(self, IotaExecutionStatus::Failure { .. }) - } -} - -impl From for IotaExecutionStatus { - fn from(status: ExecutionStatus) -> Self { - match status { - ExecutionStatus::Success => Self::Success, - ExecutionStatus::Failure { - error, - command: None, - } => Self::Failure { - error: format!("{error:?}"), - }, - ExecutionStatus::Failure { - error, - command: Some(idx), - } => Self::Failure { - error: format!("{error:?} in command {idx}"), - }, - } - } -} - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, JsonSchema)] -#[serde(rename = "OwnedObjectRef")] -pub struct OwnedObjectRef { - pub owner: Owner, - pub reference: IotaObjectRef, -} - -impl OwnedObjectRef { - pub fn object_id(&self) -> ObjectID { - self.reference.object_id - } - pub fn version(&self) -> SequenceNumber { - self.reference.version - } -} - -#[derive(Debug, Deserialize, Serialize, JsonSchema, Clone, PartialEq, Eq)] -#[enum_dispatch(IotaTransactionBlockEffectsAPI)] -#[serde( - rename = "TransactionBlockEffects", - rename_all = "camelCase", - tag = "messageVersion" -)] -pub enum IotaTransactionBlockEffects { - V1(IotaTransactionBlockEffectsV1), -} - -#[enum_dispatch] -pub trait IotaTransactionBlockEffectsAPI { - fn status(&self) -> &IotaExecutionStatus; - fn into_status(self) -> IotaExecutionStatus; - fn shared_objects(&self) -> &[IotaObjectRef]; - fn created(&self) -> &[OwnedObjectRef]; - fn mutated(&self) -> &[OwnedObjectRef]; - fn unwrapped(&self) -> &[OwnedObjectRef]; - fn deleted(&self) -> &[IotaObjectRef]; - fn unwrapped_then_deleted(&self) -> &[IotaObjectRef]; - fn wrapped(&self) -> &[IotaObjectRef]; - fn gas_object(&self) -> &OwnedObjectRef; - fn events_digest(&self) -> Option<&TransactionEventsDigest>; - fn dependencies(&self) -> &[TransactionDigest]; - fn executed_epoch(&self) -> EpochId; - fn transaction_digest(&self) -> &TransactionDigest; - fn gas_cost_summary(&self) -> &GasCostSummary; - - /// Return an iterator of mutated objects, but excluding the gas object. - fn mutated_excluding_gas(&self) -> Vec; - fn modified_at_versions(&self) -> Vec<(ObjectID, SequenceNumber)>; - fn all_changed_objects(&self) -> Vec<(&OwnedObjectRef, WriteKind)>; - fn all_deleted_objects(&self) -> Vec<(&IotaObjectRef, DeleteKind)>; -} - -#[serde_as] -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, JsonSchema)] -#[serde( - rename = "TransactionBlockEffectsModifiedAtVersions", - rename_all = "camelCase" -)] -pub struct IotaTransactionBlockEffectsModifiedAtVersions { - object_id: ObjectID, - #[schemars(with = "AsSequenceNumber")] - #[serde_as(as = "AsSequenceNumber")] - sequence_number: SequenceNumber, -} - -/// The response from processing a transaction or a certified transaction -#[serde_as] -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, JsonSchema)] -#[serde(rename = "TransactionBlockEffectsV1", rename_all = "camelCase")] -pub struct IotaTransactionBlockEffectsV1 { - /// The status of the execution - pub status: IotaExecutionStatus, - /// The epoch when this transaction was executed. - #[schemars(with = "BigInt")] - #[serde_as(as = "BigInt")] - pub executed_epoch: EpochId, - pub gas_used: GasCostSummary, - /// The version that every modified (mutated or deleted) object had before - /// it was modified by this transaction. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub modified_at_versions: Vec, - /// The object references of the shared objects used in this transaction. - /// Empty if no shared objects were used. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub shared_objects: Vec, - /// The transaction digest - pub transaction_digest: TransactionDigest, - /// ObjectRef and owner of new objects created. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub created: Vec, - /// ObjectRef and owner of mutated objects, including gas object. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub mutated: Vec, - /// ObjectRef and owner of objects that are unwrapped in this transaction. - /// Unwrapped objects are objects that were wrapped into other objects in - /// the past, and just got extracted out. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub unwrapped: Vec, - /// Object Refs of objects now deleted (the old refs). - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub deleted: Vec, - /// Object refs of objects previously wrapped in other objects but now - /// deleted. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub unwrapped_then_deleted: Vec, - /// Object refs of objects now wrapped in other objects. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub wrapped: Vec, - /// The updated gas object reference. Have a dedicated field for convenient - /// access. It's also included in mutated. - pub gas_object: OwnedObjectRef, - /// The digest of the events emitted during execution, - /// can be None if the transaction does not emit any event. - #[serde(skip_serializing_if = "Option::is_none")] - pub events_digest: Option, - /// The set of transaction digests this transaction depends on. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub dependencies: Vec, -} - -impl IotaTransactionBlockEffectsAPI for IotaTransactionBlockEffectsV1 { - fn status(&self) -> &IotaExecutionStatus { - &self.status - } - fn into_status(self) -> IotaExecutionStatus { - self.status - } - fn shared_objects(&self) -> &[IotaObjectRef] { - &self.shared_objects - } - fn created(&self) -> &[OwnedObjectRef] { - &self.created - } - fn mutated(&self) -> &[OwnedObjectRef] { - &self.mutated - } - fn unwrapped(&self) -> &[OwnedObjectRef] { - &self.unwrapped - } - fn deleted(&self) -> &[IotaObjectRef] { - &self.deleted - } - fn unwrapped_then_deleted(&self) -> &[IotaObjectRef] { - &self.unwrapped_then_deleted - } - fn wrapped(&self) -> &[IotaObjectRef] { - &self.wrapped - } - fn gas_object(&self) -> &OwnedObjectRef { - &self.gas_object - } - fn events_digest(&self) -> Option<&TransactionEventsDigest> { - self.events_digest.as_ref() - } - fn dependencies(&self) -> &[TransactionDigest] { - &self.dependencies - } - - fn executed_epoch(&self) -> EpochId { - self.executed_epoch - } - - fn transaction_digest(&self) -> &TransactionDigest { - &self.transaction_digest - } - - fn gas_cost_summary(&self) -> &GasCostSummary { - &self.gas_used - } - - fn mutated_excluding_gas(&self) -> Vec { - self.mutated - .iter() - .filter(|o| *o != &self.gas_object) - .cloned() - .collect() - } - - fn modified_at_versions(&self) -> Vec<(ObjectID, SequenceNumber)> { - self.modified_at_versions - .iter() - .map(|v| (v.object_id, v.sequence_number)) - .collect::>() - } - - fn all_changed_objects(&self) -> Vec<(&OwnedObjectRef, WriteKind)> { - self.mutated - .iter() - .map(|owner_ref| (owner_ref, WriteKind::Mutate)) - .chain( - self.created - .iter() - .map(|owner_ref| (owner_ref, WriteKind::Create)), - ) - .chain( - self.unwrapped - .iter() - .map(|owner_ref| (owner_ref, WriteKind::Unwrap)), - ) - .collect() - } - - fn all_deleted_objects(&self) -> Vec<(&IotaObjectRef, DeleteKind)> { - self.deleted - .iter() - .map(|r| (r, DeleteKind::Normal)) - .chain( - self.unwrapped_then_deleted - .iter() - .map(|r| (r, DeleteKind::UnwrapThenDelete)), - ) - .chain(self.wrapped.iter().map(|r| (r, DeleteKind::Wrap))) - .collect() - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/mod.rs b/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/mod.rs deleted file mode 100644 index 47aa47d99e..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_json_rpc_types/mod.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub mod iota_transaction; -pub mod iota_object; -pub mod iota_coin; -pub mod iota_event; -pub mod iota_move; - -pub use iota_transaction::*; -pub use iota_object::*; -pub use iota_coin::*; -pub use iota_event::*; - -use serde::{Deserialize, Serialize}; - -/// `next_cursor` points to the last item in the page; -/// Reading with `next_cursor` will start from the next item after `next_cursor` -/// if `next_cursor` is `Some`, otherwise it will start from the first item. -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] -#[serde(rename_all = "camelCase")] -pub struct Page { - pub data: Vec, - pub next_cursor: Option, - pub has_next_page: bool, -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/balance.rs b/identity_iota_interaction/src/sdk_types/iota_types/balance.rs deleted file mode 100644 index c4867a4a10..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/balance.rs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::{ident_str, fp_ensure}; - -use super::super::move_core_types::{ - identifier::{IdentStr}, - language_storage::{StructTag, TypeTag}, - annotated_value::{MoveStructLayout, MoveFieldLayout, MoveTypeLayout} -}; -use serde::{Deserialize, Serialize}; -use serde_with::serde_as; - -use super::{ - error::{ExecutionError, ExecutionErrorKind}, - iota_serde::{BigInt, Readable}, - IOTA_FRAMEWORK_ADDRESS, -}; - -pub const BALANCE_MODULE_NAME: &IdentStr = ident_str!("balance"); -pub const BALANCE_STRUCT_NAME: &IdentStr = ident_str!("Balance"); -pub const BALANCE_CREATE_REWARDS_FUNCTION_NAME: &IdentStr = ident_str!("create_staking_rewards"); -pub const BALANCE_DESTROY_REBATES_FUNCTION_NAME: &IdentStr = ident_str!("destroy_storage_rebates"); - -#[serde_as] -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Supply { - #[serde_as(as = "Readable, _>")] - pub value: u64, -} - -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Balance { - value: u64, -} - -impl Balance { - pub fn new(value: u64) -> Self { - Self { value } - } - - pub fn type_(type_param: TypeTag) -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - module: BALANCE_MODULE_NAME.to_owned(), - name: BALANCE_STRUCT_NAME.to_owned(), - type_params: vec![type_param], - } - } - - pub fn type_tag(inner_type_param: TypeTag) -> TypeTag { - TypeTag::Struct(Box::new(Self::type_(inner_type_param))) - } - - pub fn is_balance(s: &StructTag) -> bool { - s.address == IOTA_FRAMEWORK_ADDRESS - && s.module.as_ident_str() == BALANCE_MODULE_NAME - && s.name.as_ident_str() == BALANCE_STRUCT_NAME - } - - pub fn withdraw(&mut self, amount: u64) -> Result<(), ExecutionError> { - fp_ensure!( - self.value >= amount, - ExecutionError::new_with_source( - ExecutionErrorKind::InsufficientCoinBalance, - format!("balance: {} required: {}", self.value, amount) - ) - ); - self.value -= amount; - Ok(()) - } - - pub fn deposit_for_safe_mode(&mut self, amount: u64) { - self.value += amount; - } - - pub fn value(&self) -> u64 { - self.value - } - - pub fn to_bcs_bytes(&self) -> Vec { - bcs::to_bytes(&self).unwrap() - } - - pub fn layout(type_param: TypeTag) -> MoveStructLayout { - MoveStructLayout { - type_: Self::type_(type_param), - fields: vec![MoveFieldLayout::new( - ident_str!("value").to_owned(), - MoveTypeLayout::U64, - )], - } - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/base_types.rs b/identity_iota_interaction/src/sdk_types/iota_types/base_types.rs deleted file mode 100644 index cfb71ba85d..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/base_types.rs +++ /dev/null @@ -1,814 +0,0 @@ -// Copyright (c) 2021, Facebook, Inc. and its affiliates -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::fmt; -use std::vec::Vec; -use std::option::Option; -use std::convert::{AsRef, TryFrom}; -use std::result::Result::Ok; -use std::option::Option::Some; -use std::str::FromStr; -use std::string::String; - -use schemars::JsonSchema; -use Result; - -use rand::Rng; -use anyhow::anyhow; - -use serde::{ser::Error, Deserialize, Serialize}; -use serde_with::serde_as; - -use fastcrypto::encoding::{Hex, Encoding, decode_bytes_hex}; -use fastcrypto::hash::HashFunction; - -use crate::ident_str; - -use super::super::move_core_types::language_storage::{StructTag, TypeTag, ModuleId}; -use super::super::move_core_types::identifier::IdentStr; -use super::super::move_core_types::account_address::AccountAddress; - -use super::{IOTA_FRAMEWORK_ADDRESS, IOTA_CLOCK_OBJECT_ID, IOTA_SYSTEM_ADDRESS, MOVE_STDLIB_ADDRESS}; -use super::balance::Balance; -use super::coin::{Coin, CoinMetadata, TreasuryCap, COIN_MODULE_NAME, COIN_STRUCT_NAME}; -use super::crypto::{AuthorityPublicKeyBytes, IotaPublicKey, DefaultHash, PublicKey}; -use super::dynamic_field::DynamicFieldInfo; -use super::error::{IotaError, IotaResult}; -use super::gas_coin::GAS; -use super::governance::{StakedIota, STAKING_POOL_MODULE_NAME, STAKED_IOTA_STRUCT_NAME}; -use super::iota_serde::{Readable, HexAccountAddress, to_iota_struct_tag_string}; -use super::timelock::timelock::{self, TimeLock}; -use super::timelock::timelocked_staked_iota::TimelockedStakedIota; -use super::stardust::output::Nft; -use super::gas_coin::GasCoin; -use super::object::{Owner}; -use super::parse_iota_struct_tag; - -pub use super::digests::{ObjectDigest, TransactionDigest}; - -// ----------------------------------------------------------------- -// Originally defined in crates/iota-types/src/committee.rs -// ----------------------------------------------------------------- -pub type EpochId = u64; -// TODO: the stake and voting power of a validator can be different so -// in some places when we are actually referring to the voting power, we -// should use a different type alias, field name, etc. -pub type StakeUnit = u64; -// ----------------------------------------------------------------- -// Originally defined in crates/iota-types/src/execution_status.rs -// ----------------------------------------------------------------- -pub type CommandIndex = usize; -// ----------------------------------------------------------------- -// Originally defined in external-crates/move/crates/move-binary-format/src/file_format.rs -// ----------------------------------------------------------------- -/// Index into the code stream for a jump. The offset is relative to the -/// beginning of the instruction stream. -pub type CodeOffset = u16; -/// Type parameters are encoded as indices. This index can also be used to -/// lookup the kind of a type parameter in the `FunctionHandle` and -/// `StructHandle`. -pub type TypeParameterIndex = u16; -// ----------------------------------------------------------------- - -#[derive( - Eq, - PartialEq, - Ord, - PartialOrd, - Copy, - Clone, - Hash, - Default, - Debug, - Serialize, - Deserialize, - JsonSchema, -)] -pub struct SequenceNumber(u64); - -impl fmt::Display for SequenceNumber { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:#x}", self.0) - } -} - -pub type AuthorityName = AuthorityPublicKeyBytes; - -#[serde_as] -#[derive(Eq, PartialEq, Clone, Copy, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] -pub struct ObjectID( - #[schemars(with = "Hex")] - #[serde_as(as = "Readable")] - AccountAddress, -); - -pub type ObjectRef = (ObjectID, SequenceNumber, ObjectDigest); - -/// Wrapper around StructTag with a space-efficient representation for common -/// types like coins The StructTag for a gas coin is 84 bytes, so using 1 byte -/// instead is a win. The inner representation is private to prevent incorrectly -/// constructing an `Other` instead of one of the specialized variants, e.g. -/// `Other(GasCoin::type_())` instead of `GasCoin` -#[derive(Eq, PartialEq, PartialOrd, Ord, Debug, Clone, Deserialize, Serialize, Hash)] -pub struct MoveObjectType(MoveObjectType_); - -/// Even though it is declared public, it is the "private", internal -/// representation for `MoveObjectType` -#[derive(Eq, PartialEq, PartialOrd, Ord, Debug, Clone, Deserialize, Serialize, Hash)] -pub enum MoveObjectType_ { - /// A type that is not `0x2::coin::Coin` - Other(StructTag), - /// An IOTA coin (i.e., `0x2::coin::Coin<0x2::iota::IOTA>`) - GasCoin, - /// A record of a staked IOTA coin (i.e., `0x3::staking_pool::StakedIota`) - StakedIota, - /// A non-IOTA coin type (i.e., `0x2::coin::Coin where T != - /// 0x2::iota::IOTA`) - Coin(TypeTag), - // NOTE: if adding a new type here, and there are existing on-chain objects of that - // type with Other(_), that is ok, but you must hand-roll PartialEq/Eq/Ord/maybe Hash - // to make sure the new type and Other(_) are interpreted consistently. -} - -impl MoveObjectType { - pub fn gas_coin() -> Self { - Self(MoveObjectType_::GasCoin) - } - - pub fn staked_iota() -> Self { - Self(MoveObjectType_::StakedIota) - } - - pub fn timelocked_iota_balance() -> Self { - Self(MoveObjectType_::Other(TimeLock::::type_( - Balance::type_(GAS::type_().into()).into(), - ))) - } - - pub fn timelocked_staked_iota() -> Self { - Self(MoveObjectType_::Other(TimelockedStakedIota::type_())) - } - - pub fn stardust_nft() -> Self { - Self(MoveObjectType_::Other(Nft::tag())) - } - - pub fn address(&self) -> AccountAddress { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::Coin(_) => IOTA_FRAMEWORK_ADDRESS, - MoveObjectType_::StakedIota => IOTA_SYSTEM_ADDRESS, - MoveObjectType_::Other(s) => s.address, - } - } - - pub fn module(&self) -> &IdentStr { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::Coin(_) => COIN_MODULE_NAME, - MoveObjectType_::StakedIota => STAKING_POOL_MODULE_NAME, - MoveObjectType_::Other(s) => &s.module, - } - } - - pub fn name(&self) -> &IdentStr { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::Coin(_) => COIN_STRUCT_NAME, - MoveObjectType_::StakedIota => STAKED_IOTA_STRUCT_NAME, - MoveObjectType_::Other(s) => &s.name, - } - } - - pub fn type_params(&self) -> Vec { - match &self.0 { - MoveObjectType_::GasCoin => vec![GAS::type_tag()], - MoveObjectType_::StakedIota => vec![], - MoveObjectType_::Coin(inner) => vec![inner.clone()], - MoveObjectType_::Other(s) => s.type_params.clone(), - } - } - - pub fn into_type_params(self) -> Vec { - match self.0 { - MoveObjectType_::GasCoin => vec![GAS::type_tag()], - MoveObjectType_::StakedIota => vec![], - MoveObjectType_::Coin(inner) => vec![inner], - MoveObjectType_::Other(s) => s.type_params, - } - } - - pub fn coin_type_maybe(&self) -> Option { - match &self.0 { - MoveObjectType_::GasCoin => Some(GAS::type_tag()), - MoveObjectType_::Coin(inner) => Some(inner.clone()), - MoveObjectType_::StakedIota => None, - MoveObjectType_::Other(_) => None, - } - } - - pub fn module_id(&self) -> ModuleId { - ModuleId::new(self.address(), self.module().to_owned()) - } - - pub fn size_for_gas_metering(&self) -> usize { - // unwraps safe because a `StructTag` cannot fail to serialize - match &self.0 { - MoveObjectType_::GasCoin => 1, - MoveObjectType_::StakedIota => 1, - MoveObjectType_::Coin(inner) => bcs::serialized_size(inner).unwrap() + 1, - MoveObjectType_::Other(s) => bcs::serialized_size(s).unwrap() + 1, - } - } - - /// Return true if `self` is `0x2::coin::Coin` for some T (note: T can be - /// IOTA) - pub fn is_coin(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::Coin(_) => true, - MoveObjectType_::StakedIota | MoveObjectType_::Other(_) => false, - } - } - - /// Return true if `self` is 0x2::coin::Coin<0x2::iota::IOTA> - pub fn is_gas_coin(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin => true, - MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) | MoveObjectType_::Other(_) => { - false - } - } - } - - /// Return true if `self` is `0x2::coin::Coin` - pub fn is_coin_t(&self, t: &TypeTag) -> bool { - match &self.0 { - MoveObjectType_::GasCoin => GAS::is_gas_type(t), - MoveObjectType_::Coin(c) => t == c, - MoveObjectType_::StakedIota | MoveObjectType_::Other(_) => false, - } - } - - pub fn is_staked_iota(&self) -> bool { - match &self.0 { - MoveObjectType_::StakedIota => true, - MoveObjectType_::GasCoin | MoveObjectType_::Coin(_) | MoveObjectType_::Other(_) => { - false - } - } - } - - pub fn is_coin_metadata(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) => { - false - } - MoveObjectType_::Other(s) => CoinMetadata::is_coin_metadata(s), - } - } - - pub fn is_treasury_cap(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) => { - false - } - MoveObjectType_::Other(s) => TreasuryCap::is_treasury_type(s), - } - } - - pub fn is_upgrade_cap(&self) -> bool { - self.address() == IOTA_FRAMEWORK_ADDRESS - && self.module().as_str() == "package" - && self.name().as_str() == "UpgradeCap" - } - - pub fn is_regulated_coin_metadata(&self) -> bool { - self.address() == IOTA_FRAMEWORK_ADDRESS - && self.module().as_str() == "coin" - && self.name().as_str() == "RegulatedCoinMetadata" - } - - pub fn is_coin_deny_cap_v1(&self) -> bool { - self.address() == IOTA_FRAMEWORK_ADDRESS - && self.module().as_str() == "coin" - && self.name().as_str() == "DenyCapV1" - } - - pub fn is_dynamic_field(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) => { - false - } - MoveObjectType_::Other(s) => DynamicFieldInfo::is_dynamic_field(s), - } - } - - pub fn is_timelock(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) => { - false - } - MoveObjectType_::Other(s) => timelock::is_timelock(s), - } - } - - pub fn is_timelocked_balance(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) => { - false - } - MoveObjectType_::Other(s) => timelock::is_timelocked_balance(s), - } - } - - pub fn is_timelocked_staked_iota(&self) -> bool { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) => { - false - } - MoveObjectType_::Other(s) => TimelockedStakedIota::is_timelocked_staked_iota(s), - } - } - - pub fn try_extract_field_value(&self) -> IotaResult { - match &self.0 { - MoveObjectType_::GasCoin | MoveObjectType_::StakedIota | MoveObjectType_::Coin(_) => { - Err(IotaError::ObjectDeserialization { - error: "Error extracting dynamic object value from Coin object".to_string(), - }) - } - MoveObjectType_::Other(s) => DynamicFieldInfo::try_extract_field_value(s), - } - } -} - -impl From for MoveObjectType { - fn from(mut s: StructTag) -> Self { - Self(if GasCoin::is_gas_coin(&s) { - MoveObjectType_::GasCoin - } else if Coin::is_coin(&s) { - // unwrap safe because a coin has exactly one type parameter - MoveObjectType_::Coin(s.type_params.pop().unwrap()) - } else if StakedIota::is_staked_iota(&s) { - MoveObjectType_::StakedIota - } else { - MoveObjectType_::Other(s) - }) - } -} - -impl From for StructTag { - fn from(t: MoveObjectType) -> Self { - match t.0 { - MoveObjectType_::GasCoin => GasCoin::type_(), - MoveObjectType_::StakedIota => StakedIota::type_(), - MoveObjectType_::Coin(inner) => Coin::type_(inner), - MoveObjectType_::Other(s) => s, - } - } -} - -impl From for TypeTag { - fn from(o: MoveObjectType) -> TypeTag { - let s: StructTag = o.into(); - TypeTag::Struct(Box::new(s)) - } -} - -/// Type of an IOTA object -#[derive(Clone, Serialize, Deserialize, Ord, PartialOrd, Eq, PartialEq, Debug)] -pub enum ObjectType { - /// Move package containing one or more bytecode modules - Package, - /// A Move struct of the given type - Struct(MoveObjectType), -} - -impl TryFrom for StructTag { - type Error = anyhow::Error; - - fn try_from(o: ObjectType) -> Result { - match o { - ObjectType::Package => Err(anyhow!("Cannot create StructTag from Package")), - ObjectType::Struct(move_object_type) => Ok(move_object_type.into()), - } - } -} - -impl FromStr for ObjectType { - type Err = anyhow::Error; - - fn from_str(s: &str) -> Result { - if s.to_lowercase() == PACKAGE { - Ok(ObjectType::Package) - } else { - let tag = parse_iota_struct_tag(s)?; - Ok(ObjectType::Struct(MoveObjectType::from(tag))) - } - } -} - -#[derive(Clone, Serialize, Deserialize, Ord, PartialOrd, Eq, PartialEq, Debug)] -pub struct ObjectInfo { - pub object_id: ObjectID, - pub version: SequenceNumber, - pub digest: ObjectDigest, - pub type_: ObjectType, - pub owner: Owner, - pub previous_transaction: TransactionDigest, -} - -const PACKAGE: &str = "package"; -impl ObjectType { - pub fn is_gas_coin(&self) -> bool { - matches!(self, ObjectType::Struct(s) if s.is_gas_coin()) - } - - pub fn is_coin(&self) -> bool { - matches!(self, ObjectType::Struct(s) if s.is_coin()) - } - - /// Return true if `self` is `0x2::coin::Coin` - pub fn is_coin_t(&self, t: &TypeTag) -> bool { - matches!(self, ObjectType::Struct(s) if s.is_coin_t(t)) - } - - pub fn is_package(&self) -> bool { - matches!(self, ObjectType::Package) - } -} - -impl From for ObjectRef { - fn from(info: ObjectInfo) -> Self { - (info.object_id, info.version, info.digest) - } -} - -impl From<&ObjectInfo> for ObjectRef { - fn from(info: &ObjectInfo) -> Self { - (info.object_id, info.version, info.digest) - } -} - -pub const IOTA_ADDRESS_LENGTH: usize = ObjectID::LENGTH; - -#[serde_as] -#[derive(Eq, Default, PartialEq, Ord, PartialOrd, Copy, Clone, Hash, Serialize, Deserialize, JsonSchema)] -pub struct IotaAddress( - #[schemars(with = "Hex")] - #[serde_as(as = "Readable")] - [u8; IOTA_ADDRESS_LENGTH], -); - -impl IotaAddress { - pub const ZERO: Self = Self([0u8; IOTA_ADDRESS_LENGTH]); - - /// Convert the address to a byte buffer. - pub fn to_vec(&self) -> Vec { - self.0.to_vec() - } - - pub fn generate(mut rng: R) -> Self { - let buf: [u8; IOTA_ADDRESS_LENGTH] = rng.gen(); - Self(buf) - } - - /// Serialize an `Option` in Hex. - pub fn optional_address_as_hex( - key: &Option, - serializer: S, - ) -> Result - where - S: serde::ser::Serializer, - { - serializer.serialize_str(&key.map(Hex::encode).unwrap_or_default()) - } - - /// Deserialize into an `Option`. - pub fn optional_address_from_hex<'de, D>( - deserializer: D, - ) -> Result, D::Error> - where - D: serde::de::Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let value = decode_bytes_hex(&s).map_err(serde::de::Error::custom)?; - Ok(Some(value)) - } - - /// Return the underlying byte array of a IotaAddress. - pub fn to_inner(self) -> [u8; IOTA_ADDRESS_LENGTH] { - self.0 - } - - /// Parse a IotaAddress from a byte array or buffer. - pub fn from_bytes>(bytes: T) -> Result { - <[u8; IOTA_ADDRESS_LENGTH]>::try_from(bytes.as_ref()) - .map_err(|_| IotaError::InvalidAddress) - .map(IotaAddress) - } -} - -impl From for IotaAddress { - fn from(object_id: ObjectID) -> IotaAddress { - Self(object_id.into_bytes()) - } -} - -impl From for IotaAddress { - fn from(address: AccountAddress) -> IotaAddress { - Self(address.into_bytes()) - } -} - -impl TryFrom<&[u8]> for IotaAddress { - type Error = IotaError; - - /// Tries to convert the provided byte array into a IotaAddress. - fn try_from(bytes: &[u8]) -> Result { - Self::from_bytes(bytes) - } -} - -impl TryFrom> for IotaAddress { - type Error = IotaError; - - /// Tries to convert the provided byte buffer into a IotaAddress. - fn try_from(bytes: Vec) -> Result { - Self::from_bytes(bytes) - } -} - -impl AsRef<[u8]> for IotaAddress { - fn as_ref(&self) -> &[u8] { - &self.0[..] - } -} - -impl FromStr for IotaAddress { - type Err = anyhow::Error; - fn from_str(s: &str) -> Result { - decode_bytes_hex(s).map_err(|e| anyhow!(e)) - } -} - -impl From<&T> for IotaAddress { - fn from(pk: &T) -> Self { - let mut hasher = DefaultHash::default(); - T::SIGNATURE_SCHEME.update_hasher_with_flag(&mut hasher); - hasher.update(pk); - let g_arr = hasher.finalize(); - IotaAddress(g_arr.digest) - } -} - -impl From<&PublicKey> for IotaAddress { - fn from(pk: &PublicKey) -> Self { - let mut hasher = DefaultHash::default(); - pk.scheme().update_hasher_with_flag(&mut hasher); - hasher.update(pk); - let g_arr = hasher.finalize(); - IotaAddress(g_arr.digest) - } -} - -impl fmt::Display for IotaAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "0x{}", Hex::encode(self.0)) - } -} - -impl fmt::Debug for IotaAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - write!(f, "0x{}", Hex::encode(self.0)) - } -} - -pub const STD_OPTION_MODULE_NAME: &IdentStr = ident_str!("option"); -pub const STD_OPTION_STRUCT_NAME: &IdentStr = ident_str!("Option"); -pub const RESOLVED_STD_OPTION: (&AccountAddress, &IdentStr, &IdentStr) = ( - &MOVE_STDLIB_ADDRESS, - STD_OPTION_MODULE_NAME, - STD_OPTION_STRUCT_NAME, -); - -pub const STD_ASCII_MODULE_NAME: &IdentStr = ident_str!("ascii"); -pub const STD_ASCII_STRUCT_NAME: &IdentStr = ident_str!("String"); -pub const RESOLVED_ASCII_STR: (&AccountAddress, &IdentStr, &IdentStr) = ( - &MOVE_STDLIB_ADDRESS, - STD_ASCII_MODULE_NAME, - STD_ASCII_STRUCT_NAME, -); - -pub const STD_UTF8_MODULE_NAME: &IdentStr = ident_str!("string"); -pub const STD_UTF8_STRUCT_NAME: &IdentStr = ident_str!("String"); -pub const RESOLVED_UTF8_STR: (&AccountAddress, &IdentStr, &IdentStr) = ( - &MOVE_STDLIB_ADDRESS, - STD_UTF8_MODULE_NAME, - STD_UTF8_STRUCT_NAME, -); - -// TODO: rename to version -impl SequenceNumber { - pub const MIN: SequenceNumber = SequenceNumber(u64::MIN); - pub const MAX: SequenceNumber = SequenceNumber(0x7fff_ffff_ffff_ffff); - - pub const fn new() -> Self { - SequenceNumber(0) - } - - pub const fn value(&self) -> u64 { - self.0 - } - - pub const fn from_u64(u: u64) -> Self { - SequenceNumber(u) - } -} - -impl ObjectID { - /// The number of bytes in an address. - pub const LENGTH: usize = AccountAddress::LENGTH; - /// Hex address: 0x0 - pub const ZERO: Self = Self::new([0u8; Self::LENGTH]); - pub const MAX: Self = Self::new([0xff; Self::LENGTH]); - /// Create a new ObjectID - pub const fn new(obj_id: [u8; Self::LENGTH]) -> Self { - Self(AccountAddress::new(obj_id)) - } - - /// Const fn variant of `>::from` - pub const fn from_address(addr: AccountAddress) -> Self { - Self(addr) - } - - /// Return a random ObjectID. - pub fn random() -> Self { - Self::from(AccountAddress::random()) - } - - /// Return the underlying bytes buffer of the ObjectID. - pub fn to_vec(&self) -> Vec { - self.0.to_vec() - } - - /// Parse the ObjectID from byte array or buffer. - pub fn from_bytes>(bytes: T) -> Result { - <[u8; Self::LENGTH]>::try_from(bytes.as_ref()) - .map_err(|_| ObjectIDParseError::TryFromSlice) - .map(ObjectID::new) - } - - /// Return the underlying bytes array of the ObjectID. - pub fn into_bytes(self) -> [u8; Self::LENGTH] { - self.0.into_bytes() - } - - /// Make an ObjectID with padding 0s before the single byte. - pub const fn from_single_byte(byte: u8) -> ObjectID { - let mut bytes = [0u8; Self::LENGTH]; - bytes[Self::LENGTH - 1] = byte; - ObjectID::new(bytes) - } - - /// Convert from hex string to ObjectID where the string is prefixed with 0x - /// Padding 0s if the string is too short. - pub fn from_hex_literal(literal: &str) -> Result { - if !literal.starts_with("0x") { - return Err(ObjectIDParseError::HexLiteralPrefixMissing); - } - - let hex_len = literal.len() - 2; - - // If the string is too short, pad it - if hex_len < Self::LENGTH * 2 { - let mut hex_str = String::with_capacity(Self::LENGTH * 2); - for _ in 0..Self::LENGTH * 2 - hex_len { - hex_str.push('0'); - } - hex_str.push_str(&literal[2..]); - Self::from_str(&hex_str) - } else { - Self::from_str(&literal[2..]) - } - } - - - /// Return the full hex string with 0x prefix without removing trailing 0s. - /// Prefer this over [fn to_hex_literal] if the string needs to be fully - /// preserved. - pub fn to_hex_uncompressed(&self) -> String { - format!("{self}") - } - - pub fn is_clock(&self) -> bool { - *self == IOTA_CLOCK_OBJECT_ID - } -} - -impl From for ObjectID { - fn from(address: IotaAddress) -> ObjectID { - let tmp: AccountAddress = address.into(); - tmp.into() - } -} - -impl From for ObjectID { - fn from(address: AccountAddress) -> Self { - Self(address) - } -} - -impl fmt::Display for ObjectID { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - write!(f, "0x{}", Hex::encode(self.0)) - } -} - -impl fmt::Debug for ObjectID { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - write!(f, "0x{}", Hex::encode(self.0)) - } -} - -impl AsRef<[u8]> for ObjectID { - fn as_ref(&self) -> &[u8] { - self.0.as_slice() - } -} - -impl TryFrom<&[u8]> for ObjectID { - type Error = ObjectIDParseError; - - /// Tries to convert the provided byte array into ObjectID. - fn try_from(bytes: &[u8]) -> Result { - Self::from_bytes(bytes) - } -} - -impl TryFrom> for ObjectID { - type Error = ObjectIDParseError; - - /// Tries to convert the provided byte buffer into ObjectID. - fn try_from(bytes: Vec) -> Result { - Self::from_bytes(bytes) - } -} - -impl FromStr for ObjectID { - type Err = ObjectIDParseError; - - /// Parse ObjectID from hex string with or without 0x prefix, pad with 0s if - /// needed. - fn from_str(s: &str) -> Result { - decode_bytes_hex(s).or_else(|_| Self::from_hex_literal(s)) - } -} - -impl std::ops::Deref for ObjectID { - type Target = AccountAddress; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -#[derive(PartialEq, Eq, Clone, Debug, thiserror::Error)] -pub enum ObjectIDParseError { - #[error("ObjectID hex literal must start with 0x")] - HexLiteralPrefixMissing, - - #[error("Could not convert from bytes slice")] - TryFromSlice, -} - -impl From for AccountAddress { - fn from(obj_id: ObjectID) -> Self { - obj_id.0 - } -} - -impl From for AccountAddress { - fn from(address: IotaAddress) -> Self { - Self::new(address.0) - } -} - -impl fmt::Display for MoveObjectType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { - let s: StructTag = self.clone().into(); - write!( - f, - "{}", - to_iota_struct_tag_string(&s).map_err(fmt::Error::custom)? - ) - } -} - -impl fmt::Display for ObjectType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { - match self { - ObjectType::Package => write!(f, "{}", PACKAGE), - ObjectType::Struct(t) => write!(f, "{}", t), - } - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/coin.rs b/identity_iota_interaction/src/sdk_types/iota_types/coin.rs deleted file mode 100644 index e1cd2a27ca..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/coin.rs +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::Deserialize; -use serde::Serialize; - -use crate::ident_str; - -use super::super::move_core_types::language_storage::{StructTag, TypeTag}; -use super::super::move_core_types::identifier::IdentStr; -use super::super::move_core_types::annotated_value::{MoveStructLayout, MoveFieldLayout, MoveTypeLayout}; - -use super::id::UID; -use super::IOTA_FRAMEWORK_ADDRESS; -use super::error::{IotaError, ExecutionError, ExecutionErrorKind}; -use super::balance::{Supply, Balance}; -use super::base_types::ObjectID; - -pub const COIN_MODULE_NAME: &IdentStr = ident_str!("coin"); -pub const COIN_STRUCT_NAME: &IdentStr = ident_str!("Coin"); -pub const COIN_METADATA_STRUCT_NAME: &IdentStr = ident_str!("CoinMetadata"); -pub const COIN_TREASURE_CAP_NAME: &IdentStr = ident_str!("TreasuryCap"); -pub const COIN_JOIN_FUNC_NAME: &IdentStr = ident_str!("join"); - -pub const PAY_MODULE_NAME: &IdentStr = ident_str!("pay"); -pub const PAY_SPLIT_N_FUNC_NAME: &IdentStr = ident_str!("divide_and_keep"); -pub const PAY_SPLIT_VEC_FUNC_NAME: &IdentStr = ident_str!("split_vec"); - -// Rust version of the Move iota::coin::Coin type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Coin { - pub id: UID, - pub balance: Balance, -} - -impl Coin { - pub fn new(id: UID, value: u64) -> Self { - Self { - id, - balance: Balance::new(value), - } - } - - pub fn type_(type_param: TypeTag) -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - name: COIN_STRUCT_NAME.to_owned(), - module: COIN_MODULE_NAME.to_owned(), - type_params: vec![type_param], - } - } - - /// Is this other StructTag representing a Coin? - pub fn is_coin(other: &StructTag) -> bool { - other.address == IOTA_FRAMEWORK_ADDRESS - && other.module.as_ident_str() == COIN_MODULE_NAME - && other.name.as_ident_str() == COIN_STRUCT_NAME - } - - /// Create a coin from BCS bytes - pub fn from_bcs_bytes(content: &[u8]) -> Result { - bcs::from_bytes(content) - } - - pub fn id(&self) -> &ObjectID { - self.id.object_id() - } - - pub fn value(&self) -> u64 { - self.balance.value() - } - - pub fn to_bcs_bytes(&self) -> Vec { - bcs::to_bytes(&self).unwrap() - } - - pub fn layout(type_param: TypeTag) -> MoveStructLayout { - MoveStructLayout { - type_: Self::type_(type_param.clone()), - fields: vec![ - MoveFieldLayout::new( - ident_str!("id").to_owned(), - MoveTypeLayout::Struct(Box::new(UID::layout())), - ), - MoveFieldLayout::new( - ident_str!("balance").to_owned(), - MoveTypeLayout::Struct(Box::new(Balance::layout(type_param))), - ), - ], - } - } - - /// Add balance to this coin, erroring if the new total balance exceeds the - /// maximum - pub fn add(&mut self, balance: Balance) -> Result<(), ExecutionError> { - let Some(new_value) = self.value().checked_add(balance.value()) else { - return Err(ExecutionError::from_kind( - ExecutionErrorKind::CoinBalanceOverflow, - )); - }; - self.balance = Balance::new(new_value); - Ok(()) - } - - // Split amount out of this coin to a new coin. - // Related coin objects need to be updated in temporary_store to persist the - // changes, including creating the coin object related to the newly created - // coin. - pub fn split(&mut self, amount: u64, new_coin_id: UID) -> Result { - self.balance.withdraw(amount)?; - Ok(Coin::new(new_coin_id, amount)) - } -} - -// Rust version of the Move iota::coin::TreasuryCap type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct TreasuryCap { - pub id: UID, - pub total_supply: Supply, -} - -impl TreasuryCap { - pub fn is_treasury_type(other: &StructTag) -> bool { - other.address == IOTA_FRAMEWORK_ADDRESS - && other.module.as_ident_str() == COIN_MODULE_NAME - && other.name.as_ident_str() == COIN_TREASURE_CAP_NAME - } - - /// Create a TreasuryCap from BCS bytes - pub fn from_bcs_bytes(content: &[u8]) -> Result { - bcs::from_bytes(content).map_err(|err| IotaError::ObjectDeserialization { - error: format!("Unable to deserialize TreasuryCap object: {}", err), - }) - } - - pub fn type_(type_param: StructTag) -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - name: COIN_TREASURE_CAP_NAME.to_owned(), - module: COIN_MODULE_NAME.to_owned(), - type_params: vec![TypeTag::Struct(Box::new(type_param))], - } - } -} - -// Rust version of the Move iota::coin::CoinMetadata type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct CoinMetadata { - pub id: UID, - /// Number of decimal places the coin uses. - pub decimals: u8, - /// Name for the token - pub name: String, - /// Symbol for the token - pub symbol: String, - /// Description of the token - pub description: String, - /// URL for the token logo - pub icon_url: Option, -} - -impl CoinMetadata { - /// Is this other StructTag representing a CoinMetadata? - pub fn is_coin_metadata(other: &StructTag) -> bool { - other.address == IOTA_FRAMEWORK_ADDRESS - && other.module.as_ident_str() == COIN_MODULE_NAME - && other.name.as_ident_str() == COIN_METADATA_STRUCT_NAME - } - - /// Create a coin from BCS bytes - pub fn from_bcs_bytes(content: &[u8]) -> Result { - bcs::from_bytes(content).map_err(|err| IotaError::ObjectDeserialization { - error: format!("Unable to deserialize CoinMetadata object: {}", err), - }) - } - - pub fn type_(type_param: StructTag) -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - name: COIN_METADATA_STRUCT_NAME.to_owned(), - module: COIN_MODULE_NAME.to_owned(), - type_params: vec![TypeTag::Struct(Box::new(type_param))], - } - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/collection_types.rs b/identity_iota_interaction/src/sdk_types/iota_types/collection_types.rs deleted file mode 100644 index 28d851db4a..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/collection_types.rs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::{Deserialize, Serialize}; - -use super::{base_types::ObjectID, id::UID}; - -/// Rust version of the Move iota::vec_map::VecMap type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct VecMap { - pub contents: Vec>, -} - -/// Rust version of the Move iota::vec_map::Entry type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Entry { - pub key: K, - pub value: V, -} - -/// Rust version of the Move iota::vec_set::VecSet type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct VecSet { - pub contents: Vec, -} - -/// Rust version of the Move iota::table::Table type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct TableVec { - pub contents: Table, -} - -impl Default for TableVec { - fn default() -> Self { - TableVec { - contents: Table { - id: ObjectID::ZERO, - size: 0, - }, - } - } -} - -/// Rust version of the Move iota::table::Table type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Table { - pub id: ObjectID, - pub size: u64, -} - -impl Default for Table { - fn default() -> Self { - Table { - id: ObjectID::ZERO, - size: 0, - } - } -} - -/// Rust version of the Move iota::linked_table::LinkedTable type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct LinkedTable { - pub id: ObjectID, - pub size: u64, - pub head: Option, - pub tail: Option, -} - -impl Default for LinkedTable { - fn default() -> Self { - LinkedTable { - id: ObjectID::ZERO, - size: 0, - head: None, - tail: None, - } - } -} - -/// Rust version of the Move iota::linked_table::Node type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct LinkedTableNode { - pub prev: Option, - pub next: Option, - pub value: V, -} - -/// Rust version of the Move iota::bag::Bag type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Bag { - pub id: UID, - pub size: u64, -} - -impl Default for Bag { - fn default() -> Self { - Self { - id: UID::new(ObjectID::ZERO), - size: 0, - } - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/crypto.rs b/identity_iota_interaction/src/sdk_types/iota_types/crypto.rs deleted file mode 100644 index 0ad555fe6e..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/crypto.rs +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 -use std::hash::Hash; -use std::str::FromStr; - -use enum_dispatch::enum_dispatch; -use strum::EnumString; -use schemars::JsonSchema; -use derive_more::{AsRef, AsMut, From}; -use eyre::{eyre, Report}; - -use fastcrypto::{ - bls12381::min_sig::{ - BLS12381AggregateSignature, BLS12381AggregateSignatureAsBytes, BLS12381KeyPair, - BLS12381PrivateKey, BLS12381PublicKey, BLS12381Signature, - }, ed25519::{ - Ed25519KeyPair, Ed25519PrivateKey, Ed25519PublicKey, Ed25519PublicKeyAsBytes, - Ed25519Signature - }, encoding::{Base64, Bech32, Encoding}, error::{FastCryptoError, FastCryptoResult}, hash::{Blake2b256, HashFunction}, secp256k1::{Secp256k1KeyPair, Secp256k1PublicKey, Secp256k1PublicKeyAsBytes, Secp256k1Signature}, secp256r1::{Secp256r1KeyPair, Secp256r1PublicKey, Secp256r1PublicKeyAsBytes, Secp256r1Signature}, traits::{Authenticator, EncodeDecodeBase64, KeyPair as KeypairTraits, Signer, ToFromBytes, VerifyingKey} -}; -use fastcrypto_zkp::zk_login_utils::Bn254FrElement; - -use serde::{Deserialize, Deserializer, Serializer}; -use serde::Serialize; -use serde_with::{serde_as, Bytes}; - -use crate::shared_crypto::intent::IntentMessage; - -use super::{ - base_types::IotaAddress, error::{IotaError, IotaResult}, iota_serde::Readable -}; - -const IOTA_PRIV_KEY_PREFIX: &str = "iotaprivkey"; - -// Authority Objects -pub type AuthorityKeyPair = BLS12381KeyPair; -pub type AuthorityPublicKey = BLS12381PublicKey; -pub type AuthorityPrivateKey = BLS12381PrivateKey; -pub type AuthoritySignature = BLS12381Signature; -pub type AggregateAuthoritySignature = BLS12381AggregateSignature; -pub type AggregateAuthoritySignatureAsBytes = BLS12381AggregateSignatureAsBytes; - -// TODO(joyqvq): prefix these types with Default, DefaultAccountKeyPair etc -pub type AccountKeyPair = Ed25519KeyPair; -pub type AccountPublicKey = Ed25519PublicKey; -pub type AccountPrivateKey = Ed25519PrivateKey; - -pub type NetworkKeyPair = Ed25519KeyPair; -pub type NetworkPublicKey = Ed25519PublicKey; -pub type NetworkPrivateKey = Ed25519PrivateKey; - -pub type DefaultHash = Blake2b256; - -// Account Keys -// -// * The following section defines the keypairs that are used by -// * accounts to interact with Iota. -// * Currently we support eddsa and ecdsa on Iota. - -#[expect(clippy::large_enum_variant)] -#[derive(Debug, From, PartialEq, Eq)] -pub enum IotaKeyPair { - Ed25519(Ed25519KeyPair), - Secp256k1(Secp256k1KeyPair), - Secp256r1(Secp256r1KeyPair), -} - -impl IotaKeyPair { - pub fn public(&self) -> PublicKey { - match self { - IotaKeyPair::Ed25519(kp) => PublicKey::Ed25519(kp.public().into()), - IotaKeyPair::Secp256k1(kp) => PublicKey::Secp256k1(kp.public().into()), - IotaKeyPair::Secp256r1(kp) => PublicKey::Secp256r1(kp.public().into()), - } - } - - pub fn copy(&self) -> Self { - match self { - IotaKeyPair::Ed25519(kp) => kp.copy().into(), - IotaKeyPair::Secp256k1(kp) => kp.copy().into(), - IotaKeyPair::Secp256r1(kp) => kp.copy().into(), - } - } -} - -impl EncodeDecodeBase64 for IotaKeyPair { - fn encode_base64(&self) -> String { - Base64::encode(self.to_bytes()) - } - - fn decode_base64(value: &str) -> FastCryptoResult { - let bytes = Base64::decode(value)?; - Self::from_bytes(&bytes).map_err(|_| FastCryptoError::InvalidInput) - } -} -impl IotaKeyPair { - pub fn to_bytes(&self) -> Vec { - let mut bytes: Vec = Vec::new(); - bytes.push(self.public().flag()); - - match self { - IotaKeyPair::Ed25519(kp) => { - bytes.extend_from_slice(kp.as_bytes()); - } - IotaKeyPair::Secp256k1(kp) => { - bytes.extend_from_slice(kp.as_bytes()); - } - IotaKeyPair::Secp256r1(kp) => { - bytes.extend_from_slice(kp.as_bytes()); - } - } - bytes - } - - pub fn from_bytes(bytes: &[u8]) -> Result { - match SignatureScheme::from_flag_byte(bytes.first().ok_or_else(|| eyre!("Invalid length"))?) - { - Ok(x) => match x { - SignatureScheme::ED25519 => Ok(IotaKeyPair::Ed25519(Ed25519KeyPair::from_bytes( - bytes.get(1..).ok_or_else(|| eyre!("Invalid length"))?, - )?)), - SignatureScheme::Secp256k1 => { - Ok(IotaKeyPair::Secp256k1(Secp256k1KeyPair::from_bytes( - bytes.get(1..).ok_or_else(|| eyre!("Invalid length"))?, - )?)) - } - SignatureScheme::Secp256r1 => { - Ok(IotaKeyPair::Secp256r1(Secp256r1KeyPair::from_bytes( - bytes.get(1..).ok_or_else(|| eyre!("Invalid length"))?, - )?)) - } - _ => Err(eyre!("Invalid flag byte")), - }, - _ => Err(eyre!("Invalid bytes")), - } - } - - pub fn to_bytes_no_flag(&self) -> Vec { - match self { - IotaKeyPair::Ed25519(kp) => kp.as_bytes().to_vec(), - IotaKeyPair::Secp256k1(kp) => kp.as_bytes().to_vec(), - IotaKeyPair::Secp256r1(kp) => kp.as_bytes().to_vec(), - } - } - - /// Encode a IotaKeyPair as `flag || privkey` in Bech32 starting with - /// "iotaprivkey" to a string. Note that the pubkey is not encoded. - pub fn encode(&self) -> Result { - Bech32::encode(self.to_bytes(), IOTA_PRIV_KEY_PREFIX).map_err(|e| eyre!(e)) - } - - /// Decode a IotaKeyPair from `flag || privkey` in Bech32 starting with - /// "iotaprivkey" to IotaKeyPair. The public key is computed directly from - /// the private key bytes. - pub fn decode(value: &str) -> Result { - let bytes = Bech32::decode(value, IOTA_PRIV_KEY_PREFIX)?; - Self::from_bytes(&bytes) - } -} - -impl Serialize for IotaKeyPair { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let s = self.encode_base64(); - serializer.serialize_str(&s) - } -} - -impl<'de> Deserialize<'de> for IotaKeyPair { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - use serde::de::Error; - let s = String::deserialize(deserializer)?; - IotaKeyPair::decode_base64(&s).map_err(|e| Error::custom(e.to_string())) - } -} - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub enum PublicKey { - Ed25519(Ed25519PublicKeyAsBytes), - Secp256k1(Secp256k1PublicKeyAsBytes), - Secp256r1(Secp256r1PublicKeyAsBytes), - ZkLogin(ZkLoginPublicIdentifier), - Passkey(Secp256r1PublicKeyAsBytes), -} - -/// A wrapper struct to retrofit in [enum PublicKey] for zkLogin. -/// Useful to construct [struct MultiSigPublicKey]. -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct ZkLoginPublicIdentifier(pub Vec); // #[schemars(with = "Base64")] - -impl ZkLoginPublicIdentifier { - /// Consists of iss_bytes_len || iss_bytes || padded_32_byte_address_seed. - pub fn new(iss: &str, address_seed: &Bn254FrElement) -> IotaResult { - let mut bytes = Vec::new(); - let iss_bytes = iss.as_bytes(); - bytes.extend([iss_bytes.len() as u8]); - bytes.extend(iss_bytes); - bytes.extend(address_seed.padded()); - - Ok(Self(bytes)) - } -} -impl AsRef<[u8]> for PublicKey { - fn as_ref(&self) -> &[u8] { - match self { - PublicKey::Ed25519(pk) => &pk.0, - PublicKey::Secp256k1(pk) => &pk.0, - PublicKey::Secp256r1(pk) => &pk.0, - PublicKey::ZkLogin(z) => &z.0, - PublicKey::Passkey(pk) => &pk.0, - } - } -} - -impl EncodeDecodeBase64 for PublicKey { - fn encode_base64(&self) -> String { - let mut bytes: Vec = Vec::new(); - bytes.extend_from_slice(&[self.flag()]); - bytes.extend_from_slice(self.as_ref()); - Base64::encode(&bytes[..]) - } - - fn decode_base64(value: &str) -> FastCryptoResult { - let bytes = Base64::decode(value)?; - match bytes.first() { - Some(x) => { - if x == &SignatureScheme::ED25519.flag() { - let pk: Ed25519PublicKey = - Ed25519PublicKey::from_bytes(bytes.get(1..).ok_or( - FastCryptoError::InputLengthWrong(Ed25519PublicKey::LENGTH + 1), - )?)?; - Ok(PublicKey::Ed25519((&pk).into())) - } else if x == &SignatureScheme::Secp256k1.flag() { - let pk = Secp256k1PublicKey::from_bytes(bytes.get(1..).ok_or( - FastCryptoError::InputLengthWrong(Secp256k1PublicKey::LENGTH + 1), - )?)?; - Ok(PublicKey::Secp256k1((&pk).into())) - } else if x == &SignatureScheme::Secp256r1.flag() { - let pk = Secp256r1PublicKey::from_bytes(bytes.get(1..).ok_or( - FastCryptoError::InputLengthWrong(Secp256r1PublicKey::LENGTH + 1), - )?)?; - Ok(PublicKey::Secp256r1((&pk).into())) - } else if x == &SignatureScheme::PasskeyAuthenticator.flag() { - let pk = Secp256r1PublicKey::from_bytes(bytes.get(1..).ok_or( - FastCryptoError::InputLengthWrong(Secp256r1PublicKey::LENGTH + 1), - )?)?; - Ok(PublicKey::Passkey((&pk).into())) - } else { - Err(FastCryptoError::InvalidInput) - } - } - _ => Err(FastCryptoError::InvalidInput), - } - } -} - -impl PublicKey { - pub fn flag(&self) -> u8 { - self.scheme().flag() - } - - pub fn try_from_bytes( - curve: SignatureScheme, - key_bytes: &[u8], - ) -> Result { - match curve { - SignatureScheme::ED25519 => Ok(PublicKey::Ed25519( - (&Ed25519PublicKey::from_bytes(key_bytes)?).into(), - )), - SignatureScheme::Secp256k1 => Ok(PublicKey::Secp256k1( - (&Secp256k1PublicKey::from_bytes(key_bytes)?).into(), - )), - SignatureScheme::Secp256r1 => Ok(PublicKey::Secp256r1( - (&Secp256r1PublicKey::from_bytes(key_bytes)?).into(), - )), - SignatureScheme::PasskeyAuthenticator => Ok(PublicKey::Passkey( - (&Secp256r1PublicKey::from_bytes(key_bytes)?).into(), - )), - _ => Err(eyre!("Unsupported curve")), - } - } - - pub fn scheme(&self) -> SignatureScheme { - match self { - PublicKey::Ed25519(_) => SignatureScheme::ED25519, // Equals Ed25519IotaSignature::SCHEME - PublicKey::Secp256k1(_) => SignatureScheme::Secp256k1, // Equals Secp256k1IotaSignature::SCHEME - PublicKey::Secp256r1(_) => SignatureScheme::Secp256r1, // Equals Secp256r1IotaSignature::SCHEME - PublicKey::ZkLogin(_) => SignatureScheme::ZkLoginAuthenticator, - PublicKey::Passkey(_) => SignatureScheme::PasskeyAuthenticator, - } - } -} - -/// Defines the compressed version of the public key that we pass around -/// in IOTA. -#[serde_as] -#[derive( -Copy, -Clone, -PartialEq, -Eq, -Hash, -PartialOrd, -Ord, -Serialize, -Deserialize, -Debug // schemars::JsonSchema and AsRef are omitted here, having Debug instead -)] -pub struct AuthorityPublicKeyBytes( - #[serde_as(as = "Readable")] - pub [u8; AuthorityPublicKey::LENGTH], -); - -// Enums for signature scheme signatures -#[enum_dispatch] -#[derive(Clone, JsonSchema, Debug, PartialEq, Eq, Hash)] -pub enum Signature { - Ed25519IotaSignature, - Secp256k1IotaSignature, - Secp256r1IotaSignature, -} - -impl Serialize for Signature { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let bytes = self.as_ref(); - - if serializer.is_human_readable() { - let s = Base64::encode(bytes); - serializer.serialize_str(&s) - } else { - serializer.serialize_bytes(bytes) - } - } -} - -impl<'de> Deserialize<'de> for Signature { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - use serde::de::Error; - - let bytes = if deserializer.is_human_readable() { - let s = String::deserialize(deserializer)?; - Base64::decode(&s).map_err(|e| Error::custom(e.to_string()))? - } else { - let data: Vec = Vec::deserialize(deserializer)?; - data - }; - - Self::from_bytes(&bytes).map_err(|e| Error::custom(e.to_string())) - } -} - -impl AsRef<[u8]> for Signature { - fn as_ref(&self) -> &[u8] { - match self { - Signature::Ed25519IotaSignature(sig) => sig.as_ref(), - Signature::Secp256k1IotaSignature(sig) => sig.as_ref(), - Signature::Secp256r1IotaSignature(sig) => sig.as_ref(), - } - } -} -impl AsMut<[u8]> for Signature { - fn as_mut(&mut self) -> &mut [u8] { - match self { - Signature::Ed25519IotaSignature(sig) => sig.as_mut(), - Signature::Secp256k1IotaSignature(sig) => sig.as_mut(), - Signature::Secp256r1IotaSignature(sig) => sig.as_mut(), - } - } -} - -impl ToFromBytes for Signature { - fn from_bytes(bytes: &[u8]) -> Result { - match bytes.first() { - Some(x) => { - if x == &Ed25519IotaSignature::SCHEME.flag() { - Ok(::from_bytes(bytes)?.into()) - } else if x == &Secp256k1IotaSignature::SCHEME.flag() { - Ok(::from_bytes(bytes)?.into()) - } else if x == &Secp256r1IotaSignature::SCHEME.flag() { - Ok(::from_bytes(bytes)?.into()) - } else { - Err(FastCryptoError::InvalidInput) - } - } - _ => Err(FastCryptoError::InvalidInput), - } - } -} - -// Ed25519 Iota Signature port -// - -#[serde_as] -#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq, Hash, AsRef, AsMut)] -#[as_ref(forward)] -#[as_mut(forward)] -pub struct Ed25519IotaSignature( - #[schemars(with = "Base64")] - #[serde_as(as = "Readable")] - [u8; Ed25519PublicKey::LENGTH + Ed25519Signature::LENGTH + 1], -); - -// Implementation useful for simplify testing when mock signature is needed -impl Default for Ed25519IotaSignature { - fn default() -> Self { - Self([0; Ed25519PublicKey::LENGTH + Ed25519Signature::LENGTH + 1]) - } -} - -impl IotaSignatureInner for Ed25519IotaSignature { - type Sig = Ed25519Signature; - type PubKey = Ed25519PublicKey; - type KeyPair = Ed25519KeyPair; - const LENGTH: usize = Ed25519PublicKey::LENGTH + Ed25519Signature::LENGTH + 1; -} - -impl IotaPublicKey for Ed25519PublicKey { - const SIGNATURE_SCHEME: SignatureScheme = SignatureScheme::ED25519; -} - -impl ToFromBytes for Ed25519IotaSignature { - fn from_bytes(bytes: &[u8]) -> Result { - if bytes.len() != Self::LENGTH { - return Err(FastCryptoError::InputLengthWrong(Self::LENGTH)); - } - let mut sig_bytes = [0; Self::LENGTH]; - sig_bytes.copy_from_slice(bytes); - Ok(Self(sig_bytes)) - } -} - -// Secp256k1 Iota Signature port -// -#[serde_as] -#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq, Hash, AsRef, AsMut)] -#[as_ref(forward)] -#[as_mut(forward)] -pub struct Secp256k1IotaSignature( - #[schemars(with = "Base64")] - #[serde_as(as = "Readable")] - [u8; Secp256k1PublicKey::LENGTH + Secp256k1Signature::LENGTH + 1], -); - -impl IotaSignatureInner for Secp256k1IotaSignature { - type Sig = Secp256k1Signature; - type PubKey = Secp256k1PublicKey; - type KeyPair = Secp256k1KeyPair; - const LENGTH: usize = Secp256k1PublicKey::LENGTH + Secp256k1Signature::LENGTH + 1; -} - -impl IotaPublicKey for Secp256k1PublicKey { - const SIGNATURE_SCHEME: SignatureScheme = SignatureScheme::Secp256k1; -} - -impl ToFromBytes for Secp256k1IotaSignature { - fn from_bytes(bytes: &[u8]) -> Result { - if bytes.len() != Self::LENGTH { - return Err(FastCryptoError::InputLengthWrong(Self::LENGTH)); - } - let mut sig_bytes = [0; Self::LENGTH]; - sig_bytes.copy_from_slice(bytes); - Ok(Self(sig_bytes)) - } -} - -// Secp256r1 Iota Signature port -// -#[serde_as] -#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq, Hash, AsRef, AsMut)] -#[as_ref(forward)] -#[as_mut(forward)] -pub struct Secp256r1IotaSignature( - #[schemars(with = "Base64")] - #[serde_as(as = "Readable")] - [u8; Secp256r1PublicKey::LENGTH + Secp256r1Signature::LENGTH + 1], -); - -impl IotaSignatureInner for Secp256r1IotaSignature { - type Sig = Secp256r1Signature; - type PubKey = Secp256r1PublicKey; - type KeyPair = Secp256r1KeyPair; - const LENGTH: usize = Secp256r1PublicKey::LENGTH + Secp256r1Signature::LENGTH + 1; -} - -impl IotaPublicKey for Secp256r1PublicKey { - const SIGNATURE_SCHEME: SignatureScheme = SignatureScheme::Secp256r1; -} - -impl ToFromBytes for Secp256r1IotaSignature { - fn from_bytes(bytes: &[u8]) -> Result { - if bytes.len() != Self::LENGTH { - return Err(FastCryptoError::InputLengthWrong(Self::LENGTH)); - } - let mut sig_bytes = [0; Self::LENGTH]; - sig_bytes.copy_from_slice(bytes); - Ok(Self(sig_bytes)) - } -} - -// This struct exists due to the limitations of the `enum_dispatch` library. -// -pub trait IotaSignatureInner: Sized + ToFromBytes + PartialEq + Eq + Hash { - type Sig: Authenticator; - type PubKey: VerifyingKey + IotaPublicKey; - type KeyPair: KeypairTraits; - - const LENGTH: usize = Self::Sig::LENGTH + Self::PubKey::LENGTH + 1; - const SCHEME: SignatureScheme = Self::PubKey::SIGNATURE_SCHEME; - - /// Returns the deserialized signature and deserialized pubkey. - fn get_verification_inputs(&self) -> IotaResult<(Self::Sig, Self::PubKey)> { - let pk = Self::PubKey::from_bytes(self.public_key_bytes()) - .map_err(|_| IotaError::KeyConversion("Invalid public key".to_string()))?; - - // deserialize the signature - let signature = Self::Sig::from_bytes(self.signature_bytes()).map_err(|_| { - IotaError::InvalidSignature { - error: "Fail to get pubkey and sig".to_string(), - } - })?; - - Ok((signature, pk)) - } - - fn new(kp: &Self::KeyPair, message: &[u8]) -> Self { - let sig = Signer::sign(kp, message); - - let mut signature_bytes: Vec = Vec::new(); - signature_bytes - .extend_from_slice(&[::SIGNATURE_SCHEME.flag()]); - signature_bytes.extend_from_slice(sig.as_ref()); - signature_bytes.extend_from_slice(kp.public().as_ref()); - Self::from_bytes(&signature_bytes[..]) - .expect("Serialized signature did not have expected size") - } -} - -pub trait IotaPublicKey: VerifyingKey { - const SIGNATURE_SCHEME: SignatureScheme; -} - -#[enum_dispatch(Signature)] -pub trait IotaSignature: Sized + ToFromBytes { - fn signature_bytes(&self) -> &[u8]; - fn public_key_bytes(&self) -> &[u8]; - fn scheme(&self) -> SignatureScheme; - - fn verify_secure( - &self, - value: &IntentMessage, - author: IotaAddress, - scheme: SignatureScheme, - ) -> IotaResult<()> - where - T: Serialize; -} - -impl IotaSignature for S { - fn signature_bytes(&self) -> &[u8] { - // Access array slice is safe because the array bytes is initialized as - // flag || signature || pubkey with its defined length. - &self.as_ref()[1..1 + S::Sig::LENGTH] - } - - fn public_key_bytes(&self) -> &[u8] { - // Access array slice is safe because the array bytes is initialized as - // flag || signature || pubkey with its defined length. - &self.as_ref()[S::Sig::LENGTH + 1..] - } - - fn scheme(&self) -> SignatureScheme { - S::PubKey::SIGNATURE_SCHEME - } - - fn verify_secure( - &self, - value: &IntentMessage, - author: IotaAddress, - scheme: SignatureScheme, - ) -> Result<(), IotaError> - where - T: Serialize, - { - let mut hasher = DefaultHash::default(); - hasher.update(bcs::to_bytes(&value).expect("Message serialization should not fail")); - let digest = hasher.finalize().digest; - - let (sig, pk) = &self.get_verification_inputs()?; - match scheme { - SignatureScheme::ZkLoginAuthenticator => {} // Pass this check because zk login does - // not derive address from pubkey. - _ => { - let address = IotaAddress::from(pk); - if author != address { - return Err(IotaError::IncorrectSigner { - error: format!( - "Incorrect signer, expected {:?}, got {:?}", - author, address - ), - }); - } - } - } - - pk.verify(&digest, sig) - .map_err(|e| IotaError::InvalidSignature { - error: format!("Fail to verify user sig {}", e), - }) - } -} - -#[derive(Clone, Copy, Deserialize, Serialize, Debug, EnumString, strum::Display)] -#[strum(serialize_all = "lowercase")] -pub enum SignatureScheme { - ED25519, - Secp256k1, - Secp256r1, - BLS12381, // This is currently not supported for user Iota Address. - MultiSig, - ZkLoginAuthenticator, - PasskeyAuthenticator, -} - -impl SignatureScheme { - pub fn flag(&self) -> u8 { - match self { - SignatureScheme::ED25519 => 0x00, - SignatureScheme::Secp256k1 => 0x01, - SignatureScheme::Secp256r1 => 0x02, - SignatureScheme::MultiSig => 0x03, - SignatureScheme::BLS12381 => 0x04, // This is currently not supported for user Iota - // Address. - SignatureScheme::ZkLoginAuthenticator => 0x05, - SignatureScheme::PasskeyAuthenticator => 0x06, - } - } - - /// Takes as input an hasher and updates it with a flag byte if the input - /// scheme is not ED25519; it does nothing otherwise. - pub fn update_hasher_with_flag(&self, hasher: &mut DefaultHash) { - match self { - SignatureScheme::ED25519 => (), - _ => hasher.update([self.flag()]), - }; - } - - pub fn from_flag(flag: &str) -> Result { - let byte_int = flag - .parse::() - .map_err(|_| IotaError::KeyConversion("Invalid key scheme".to_string()))?; - Self::from_flag_byte(&byte_int) - } - - pub fn from_flag_byte(byte_int: &u8) -> Result { - match byte_int { - 0x00 => Ok(SignatureScheme::ED25519), - 0x01 => Ok(SignatureScheme::Secp256k1), - 0x02 => Ok(SignatureScheme::Secp256r1), - 0x03 => Ok(SignatureScheme::MultiSig), - 0x04 => Ok(SignatureScheme::BLS12381), - 0x05 => Ok(SignatureScheme::ZkLoginAuthenticator), - 0x06 => Ok(SignatureScheme::PasskeyAuthenticator), - _ => Err(IotaError::KeyConversion("Invalid key scheme".to_string())), - } - } -} - -impl FromStr for Signature { - type Err = eyre::Report; - fn from_str(s: &str) -> Result { - Self::decode_base64(s).map_err(|e| eyre!("Fail to decode base64 {}", e.to_string())) - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/digests.rs b/identity_iota_interaction/src/sdk_types/iota_types/digests.rs deleted file mode 100644 index 4b3dc51bfe..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/digests.rs +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::fmt; - -use schemars::JsonSchema; -use serde::Deserialize; -use serde::Serialize; -use serde_with::{serde_as, Bytes}; - -use fastcrypto::encoding::{Base58, Encoding}; - -use super::iota_serde::Readable; - -/// A representation of a 32 byte digest -#[serde_as] -#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] -pub struct Digest( - #[schemars(with = "Base58")] - #[serde_as(as = "Readable")] - [u8; 32], -); - -impl Digest { - pub const ZERO: Self = Digest([0; 32]); - - pub const fn new(digest: [u8; 32]) -> Self { - Self(digest) - } - - pub fn generate(mut rng: R) -> Self { - let mut bytes = [0; 32]; - rng.fill_bytes(&mut bytes); - Self(bytes) - } - - pub fn random() -> Self { - Self::generate(rand::thread_rng()) - } - - pub const fn inner(&self) -> &[u8; 32] { - &self.0 - } - - pub const fn into_inner(self) -> [u8; 32] { - self.0 - } - - pub fn next_lexicographical(&self) -> Option { - let mut next_digest = *self; - let pos = next_digest.0.iter().rposition(|&byte| byte != 255)?; - next_digest.0[pos] += 1; - next_digest - .0 - .iter_mut() - .skip(pos + 1) - .for_each(|byte| *byte = 0); - Some(next_digest) - } -} - -impl AsRef<[u8]> for Digest { - fn as_ref(&self) -> &[u8] { - &self.0 - } -} - -impl AsRef<[u8; 32]> for Digest { - fn as_ref(&self) -> &[u8; 32] { - &self.0 - } -} - -impl fmt::Display for Digest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - // TODO avoid the allocation - f.write_str(&Base58::encode(self.0)) - } -} - -impl fmt::Debug for Digest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(self, f) - } -} - -impl fmt::LowerHex for Digest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if f.alternate() { - write!(f, "0x")?; - } - - for byte in self.0 { - write!(f, "{:02x}", byte)?; - } - - Ok(()) - } -} - -impl fmt::UpperHex for Digest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if f.alternate() { - write!(f, "0x")?; - } - - for byte in self.0 { - write!(f, "{:02X}", byte)?; - } - - Ok(()) - } -} - - -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] -pub struct CheckpointContentsDigest(Digest); - -impl CheckpointContentsDigest { - pub const fn new(digest: [u8; 32]) -> Self { - Self(Digest::new(digest)) - } - - pub fn generate(rng: R) -> Self { - Self(Digest::generate(rng)) - } - - pub fn random() -> Self { - Self(Digest::random()) - } - - pub const fn inner(&self) -> &[u8; 32] { - self.0.inner() - } - - pub const fn into_inner(self) -> [u8; 32] { - self.0.into_inner() - } - - pub fn base58_encode(&self) -> String { - Base58::encode(self.0) - } - - pub fn next_lexicographical(&self) -> Option { - self.0.next_lexicographical().map(Self) - } -} - -impl AsRef<[u8]> for CheckpointContentsDigest { - fn as_ref(&self) -> &[u8] { - self.0.as_ref() - } -} - -impl AsRef<[u8; 32]> for CheckpointContentsDigest { - fn as_ref(&self) -> &[u8; 32] { - self.0.as_ref() - } -} - -impl From for [u8; 32] { - fn from(digest: CheckpointContentsDigest) -> Self { - digest.into_inner() - } -} - -impl From<[u8; 32]> for CheckpointContentsDigest { - fn from(digest: [u8; 32]) -> Self { - Self::new(digest) - } -} - -impl fmt::Display for CheckpointContentsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&self.0, f) - } -} - -impl fmt::Debug for CheckpointContentsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple("CheckpointContentsDigest") - .field(&self.0) - .finish() - } -} - -impl std::str::FromStr for CheckpointContentsDigest { - type Err = anyhow::Error; - - fn from_str(s: &str) -> Result { - let mut result = [0; 32]; - let buffer = Base58::decode(s).map_err(|e| anyhow::anyhow!(e))?; - if buffer.len() != 32 { - return Err(anyhow::anyhow!("Invalid digest length. Expected 32 bytes")); - } - result.copy_from_slice(&buffer); - Ok(CheckpointContentsDigest::new(result)) - } -} - -impl fmt::LowerHex for CheckpointContentsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::LowerHex::fmt(&self.0, f) - } -} - -impl fmt::UpperHex for CheckpointContentsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::UpperHex::fmt(&self.0, f) - } -} - -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] -pub struct TransactionDigest(Digest); - -impl Default for TransactionDigest { - fn default() -> Self { - Self::ZERO - } -} - -impl TransactionDigest { - pub const ZERO: Self = Self(Digest::ZERO); - - pub const fn new(digest: [u8; 32]) -> Self { - Self(Digest::new(digest)) - } - - /// A digest we use to signify the parent transaction was the genesis, - /// ie. for an object there is no parent digest. - /// Note that this is not the same as the digest of the genesis transaction, - /// which cannot be known ahead of time. - // TODO(https://github.com/iotaledger/iota/issues/65): we can pick anything here - pub const fn genesis_marker() -> Self { - Self::ZERO - } - - pub fn generate(rng: R) -> Self { - Self(Digest::generate(rng)) - } - - pub fn random() -> Self { - Self(Digest::random()) - } - - pub fn inner(&self) -> &[u8; 32] { - self.0.inner() - } - - pub fn into_inner(self) -> [u8; 32] { - self.0.into_inner() - } - - pub fn base58_encode(&self) -> String { - Base58::encode(self.0) - } - - pub fn next_lexicographical(&self) -> Option { - self.0.next_lexicographical().map(Self) - } -} - -impl fmt::Display for TransactionDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&self.0, f) - } -} - -impl fmt::Debug for TransactionDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple("TransactionDigest").field(&self.0).finish() - } -} - -impl fmt::LowerHex for TransactionDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::LowerHex::fmt(&self.0, f) - } -} - -impl fmt::UpperHex for TransactionDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::UpperHex::fmt(&self.0, f) - } -} - -impl TryFrom<&[u8]> for TransactionDigest { - type Error = super::error::IotaError; - - fn try_from(bytes: &[u8]) -> Result { - let arr: [u8; 32] = bytes - .try_into() - .map_err(|_| super::error::IotaError::InvalidTransactionDigest)?; - Ok(Self::new(arr)) - } -} - -impl std::str::FromStr for TransactionDigest { - type Err = anyhow::Error; - - fn from_str(s: &str) -> Result { - let mut result = [0; 32]; - let buffer = Base58::decode(s).map_err(|e| anyhow::anyhow!(e))?; - if buffer.len() != 32 { - return Err(anyhow::anyhow!("Invalid digest length. Expected 32 bytes")); - } - result.copy_from_slice(&buffer); - Ok(TransactionDigest::new(result)) - } -} - -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] -pub struct TransactionEffectsDigest(Digest); - -impl TransactionEffectsDigest { - pub const ZERO: Self = Self(Digest::ZERO); - - pub const fn new(digest: [u8; 32]) -> Self { - Self(Digest::new(digest)) - } - - pub fn generate(rng: R) -> Self { - Self(Digest::generate(rng)) - } - - pub fn random() -> Self { - Self(Digest::random()) - } - - pub const fn inner(&self) -> &[u8; 32] { - self.0.inner() - } - - pub const fn into_inner(self) -> [u8; 32] { - self.0.into_inner() - } - - pub fn base58_encode(&self) -> String { - Base58::encode(self.0) - } - - pub fn next_lexicographical(&self) -> Option { - self.0.next_lexicographical().map(Self) - } -} - -impl AsRef<[u8]> for TransactionEffectsDigest { - fn as_ref(&self) -> &[u8] { - self.0.as_ref() - } -} - -impl AsRef<[u8; 32]> for TransactionEffectsDigest { - fn as_ref(&self) -> &[u8; 32] { - self.0.as_ref() - } -} - -impl From for [u8; 32] { - fn from(digest: TransactionEffectsDigest) -> Self { - digest.into_inner() - } -} - -impl From<[u8; 32]> for TransactionEffectsDigest { - fn from(digest: [u8; 32]) -> Self { - Self::new(digest) - } -} - -impl fmt::Display for TransactionEffectsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&self.0, f) - } -} - -impl fmt::Debug for TransactionEffectsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple("TransactionEffectsDigest") - .field(&self.0) - .finish() - } -} - -impl fmt::LowerHex for TransactionEffectsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::LowerHex::fmt(&self.0, f) - } -} - -impl fmt::UpperHex for TransactionEffectsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::UpperHex::fmt(&self.0, f) - } -} - -#[serde_as] -#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone, Hash, Serialize, Deserialize, JsonSchema)] -pub struct TransactionEventsDigest(Digest); - -impl TransactionEventsDigest { - pub const ZERO: Self = Self(Digest::ZERO); - - pub const fn new(digest: [u8; 32]) -> Self { - Self(Digest::new(digest)) - } - - pub fn random() -> Self { - Self(Digest::random()) - } - - pub fn next_lexicographical(&self) -> Option { - self.0.next_lexicographical().map(Self) - } - - pub fn into_inner(self) -> [u8; 32] { - self.0.into_inner() - } -} - -impl fmt::Debug for TransactionEventsDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple("TransactionEventsDigest") - .field(&self.0) - .finish() - } -} - -impl AsRef<[u8]> for TransactionEventsDigest { - fn as_ref(&self) -> &[u8] { - self.0.as_ref() - } -} - -impl AsRef<[u8; 32]> for TransactionEventsDigest { - fn as_ref(&self) -> &[u8; 32] { - self.0.as_ref() - } -} - -impl std::str::FromStr for TransactionEventsDigest { - type Err = anyhow::Error; - - fn from_str(s: &str) -> Result { - let mut result = [0; 32]; - let buffer = Base58::decode(s).map_err(|e| anyhow::anyhow!(e))?; - if buffer.len() != 32 { - return Err(anyhow::anyhow!("Invalid digest length. Expected 32 bytes")); - } - result.copy_from_slice(&buffer); - Ok(Self::new(result)) - } -} - -// Each object has a unique digest -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] -pub struct ObjectDigest(Digest); - -impl fmt::Display for ObjectDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&self.0, f) - } -} - -impl fmt::Debug for ObjectDigest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "o#{}", self.0) - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/dynamic_field.rs b/identity_iota_interaction/src/sdk_types/iota_types/dynamic_field.rs deleted file mode 100644 index fa3c16d6a6..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/dynamic_field.rs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{ - fmt, - fmt::{Display, Formatter}, -}; - -use fastcrypto::{encoding::Base64}; - -use crate::ident_str; - -use super::super::move_core_types::{ - // annotated_value::{MoveStruct, MoveValue}, - identifier::IdentStr, - language_storage::{StructTag, TypeTag}, -}; - -use serde::{Deserialize, Serialize}; -use serde_json::Value; -use serde_with::{serde_as, DisplayFromStr}; - -use super::{ - base_types::{ObjectID, SequenceNumber}, - digests::{ObjectDigest}, - error::{IotaError, IotaResult}, - id::UID, - iota_serde::{IotaTypeTag, Readable}, - //object::Object, - //storage::ObjectStore, - IOTA_FRAMEWORK_ADDRESS, -}; - -const DYNAMIC_FIELD_MODULE_NAME: &IdentStr = ident_str!("dynamic_field"); -const DYNAMIC_FIELD_FIELD_STRUCT_NAME: &IdentStr = ident_str!("Field"); - -const DYNAMIC_OBJECT_FIELD_MODULE_NAME: &IdentStr = ident_str!("dynamic_object_field"); -const DYNAMIC_OBJECT_FIELD_WRAPPER_STRUCT_NAME: &IdentStr = ident_str!("Wrapper"); - -/// Rust version of the Move iota::dynamic_field::Field type -#[derive(Clone, Serialize, Deserialize, Debug)] -pub struct Field { - pub id: UID, - pub name: N, - pub value: V, -} - -#[serde_as] -#[derive(Clone, Serialize, Deserialize, Debug)] -#[serde(rename_all = "camelCase")] -pub struct DynamicFieldInfo { - pub name: DynamicFieldName, - #[serde_as(as = "Readable")] - pub bcs_name: Vec, - pub type_: DynamicFieldType, - pub object_type: String, - pub object_id: ObjectID, - pub version: SequenceNumber, - pub digest: ObjectDigest, -} - -#[serde_as] -#[derive(Clone, Serialize, Deserialize, Debug)] -#[serde(rename_all = "camelCase")] -pub struct DynamicFieldName { - #[serde_as(as = "Readable")] - pub type_: TypeTag, - // Bincode does not like serde_json::Value, rocksdb will not insert the value without - // serializing value as string. TODO: investigate if this can be removed after switch to - // BCS. - #[serde_as(as = "Readable<_, DisplayFromStr>")] - pub value: Value, -} - -impl Display for DynamicFieldName { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "{}: {}", self.type_, self.value) - } -} - -#[derive(Clone, Serialize, Deserialize, Ord, PartialOrd, Eq, PartialEq, Debug)] -pub enum DynamicFieldType { - #[serde(rename_all = "camelCase")] - DynamicField, - DynamicObject, -} - -impl Display for DynamicFieldType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - DynamicFieldType::DynamicField => write!(f, "DynamicField"), - DynamicFieldType::DynamicObject => write!(f, "DynamicObject"), - } - } -} - -impl DynamicFieldInfo { - pub fn is_dynamic_field(tag: &StructTag) -> bool { - tag.address == IOTA_FRAMEWORK_ADDRESS - && tag.module.as_ident_str() == DYNAMIC_FIELD_MODULE_NAME - && tag.name.as_ident_str() == DYNAMIC_FIELD_FIELD_STRUCT_NAME - } - - pub fn is_dynamic_object_field_wrapper(tag: &StructTag) -> bool { - tag.address == IOTA_FRAMEWORK_ADDRESS - && tag.module.as_ident_str() == DYNAMIC_OBJECT_FIELD_MODULE_NAME - && tag.name.as_ident_str() == DYNAMIC_OBJECT_FIELD_WRAPPER_STRUCT_NAME - } - - pub fn dynamic_field_type(key: TypeTag, value: TypeTag) -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - name: DYNAMIC_FIELD_FIELD_STRUCT_NAME.to_owned(), - module: DYNAMIC_FIELD_MODULE_NAME.to_owned(), - type_params: vec![key, value], - } - } - - pub fn dynamic_object_field_wrapper(key: TypeTag) -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - module: DYNAMIC_OBJECT_FIELD_MODULE_NAME.to_owned(), - name: DYNAMIC_OBJECT_FIELD_WRAPPER_STRUCT_NAME.to_owned(), - type_params: vec![key], - } - } - - pub fn try_extract_field_name( - tag: &StructTag, - type_: &DynamicFieldType, - ) -> IotaResult { - match (type_, tag.type_params.first()) { - (DynamicFieldType::DynamicField, Some(name_type)) => Ok(name_type.clone()), - (DynamicFieldType::DynamicObject, Some(TypeTag::Struct(s))) => Ok(s - .type_params - .first() - .ok_or_else(|| IotaError::ObjectDeserialization { - error: format!("Error extracting dynamic object name from object: {tag}"), - })? - .clone()), - _ => Err(IotaError::ObjectDeserialization { - error: format!("Error extracting dynamic object name from object: {tag}"), - }), - } - } - - pub fn try_extract_field_value(tag: &StructTag) -> IotaResult { - match tag.type_params.last() { - Some(value_type) => Ok(value_type.clone()), - None => Err(IotaError::ObjectDeserialization { - error: format!("Error extracting dynamic object value from object: {tag}"), - }), - } - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/error.rs b/identity_iota_interaction/src/sdk_types/iota_types/error.rs deleted file mode 100644 index afcb184015..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/error.rs +++ /dev/null @@ -1,943 +0,0 @@ -// Copyright (c) 2021, Facebook, Inc. and its affiliates -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{collections::BTreeMap, fmt::Debug}; - -use serde::{Deserialize, Serialize}; -use strum::{AsRefStr, IntoStaticStr}; -use thiserror::Error; - -use super::super::{ - rpc_types::CheckpointSequenceNumber, -}; -use super::{ - base_types::*, - digests::{ObjectDigest, TransactionDigest, TransactionEffectsDigest, TransactionEventsDigest, - CheckpointContentsDigest}, - execution_status::{CommandArgumentError, ExecutionFailureStatus}, - object::Owner, -}; - -pub const TRANSACTION_NOT_FOUND_MSG_PREFIX: &str = "Could not find the referenced transaction"; -pub const TRANSACTIONS_NOT_FOUND_MSG_PREFIX: &str = "Could not find the referenced transactions"; - -#[macro_export] -macro_rules! fp_bail { - ($e:expr) => { - return Err($e) - }; -} - -#[macro_export(local_inner_macros)] -macro_rules! fp_ensure { - ($cond:expr, $e:expr) => { - if !($cond) { - fp_bail!($e); - } - }; -} - -#[macro_export] -macro_rules! exit_main { - ($result:expr) => { - match $result { - Ok(_) => (), - Err(err) => { - let err = format!("{:?}", err); - println!("{}", err.bold().red()); - std::process::exit(1); - } - } - }; -} - -#[macro_export] -macro_rules! make_invariant_violation { - ($($args:expr),* $(,)?) => {{ - if cfg!(debug_assertions) { - panic!($($args),*) - } - ExecutionError::invariant_violation(format!($($args),*)) - }} -} - -#[macro_export] -macro_rules! invariant_violation { - ($($args:expr),* $(,)?) => { - return Err(make_invariant_violation!($($args),*).into()) - }; -} - -#[macro_export] -macro_rules! assert_invariant { - ($cond:expr, $($args:expr),* $(,)?) => {{ - if !$cond { - invariant_violation!($($args),*) - } - }}; -} - -#[derive( - Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Error, Hash, AsRefStr, IntoStaticStr, -)] -pub enum UserInputError { - #[error("Mutable object {object_id} cannot appear more than one in one transaction")] - MutableObjectUsedMoreThanOnce { object_id: ObjectID }, - #[error("Wrong number of parameters for the transaction")] - ObjectInputArityViolation, - #[error( - "Could not find the referenced object {:?} at version {:?}", - object_id, - version - )] - ObjectNotFound { - object_id: ObjectID, - version: Option, - }, - #[error( - "Object {provided_obj_ref:?} is not available for consumption, its current version: {current_version:?}" - )] - ObjectVersionUnavailableForConsumption { - provided_obj_ref: ObjectRef, - current_version: SequenceNumber, - }, - #[error("Package verification failed: {err:?}")] - PackageVerificationTimedout { err: String }, - #[error("Dependent package not found on-chain: {package_id:?}")] - DependentPackageNotFound { package_id: ObjectID }, - #[error("Mutable parameter provided, immutable parameter expected")] - ImmutableParameterExpected { object_id: ObjectID }, - #[error("Size limit exceeded: {limit} is {value}")] - SizeLimitExceeded { limit: String, value: String }, - #[error( - "Object {child_id:?} is owned by object {parent_id:?}. \ - Objects owned by other objects cannot be used as input arguments" - )] - InvalidChildObjectArgument { - child_id: ObjectID, - parent_id: ObjectID, - }, - #[error( - "Invalid Object digest for object {object_id:?}. Expected digest : {expected_digest:?}" - )] - InvalidObjectDigest { - object_id: ObjectID, - expected_digest: ObjectDigest, - }, - #[error("Sequence numbers above the maximal value are not usable for transfers")] - InvalidSequenceNumber, - #[error("A move object is expected, instead a move package is passed: {object_id}")] - MovePackageAsObject { object_id: ObjectID }, - #[error("A move package is expected, instead a move object is passed: {object_id}")] - MoveObjectAsPackage { object_id: ObjectID }, - #[error("Transaction was not signed by the correct sender: {}", error)] - IncorrectUserSignature { error: String }, - - #[error("Object used as shared is not shared")] - NotSharedObject, - #[error("The transaction inputs contain duplicated ObjectRef's")] - DuplicateObjectRefInput, - - // Gas related errors - #[error("Transaction gas payment missing")] - MissingGasPayment, - #[error("Gas object is not an owned object with owner: {:?}", owner)] - GasObjectNotOwnedObject { owner: Owner }, - #[error("Gas budget: {:?} is higher than max: {:?}", gas_budget, max_budget)] - GasBudgetTooHigh { gas_budget: u64, max_budget: u64 }, - #[error("Gas budget: {:?} is lower than min: {:?}", gas_budget, min_budget)] - GasBudgetTooLow { gas_budget: u64, min_budget: u64 }, - #[error( - "Balance of gas object {:?} is lower than the needed amount: {:?}", - gas_balance, - needed_gas_amount - )] - GasBalanceTooLow { - gas_balance: u128, - needed_gas_amount: u128, - }, - #[error("Transaction kind does not support Sponsored Transaction")] - UnsupportedSponsoredTransactionKind, - #[error( - "Gas price {:?} under reference gas price (RGP) {:?}", - gas_price, - reference_gas_price - )] - GasPriceUnderRGP { - gas_price: u64, - reference_gas_price: u64, - }, - #[error("Gas price cannot exceed {:?} nanos", max_gas_price)] - GasPriceTooHigh { max_gas_price: u64 }, - #[error("Object {object_id} is not a gas object")] - InvalidGasObject { object_id: ObjectID }, - #[error("Gas object does not have enough balance to cover minimal gas spend")] - InsufficientBalanceToCoverMinimalGas, - - #[error( - "Could not find the referenced object {:?} as the asked version {:?} is higher than the latest {:?}", - object_id, - asked_version, - latest_version - )] - ObjectSequenceNumberTooHigh { - object_id: ObjectID, - asked_version: SequenceNumber, - latest_version: SequenceNumber, - }, - #[error("Object deleted at reference {:?}", object_ref)] - ObjectDeleted { object_ref: ObjectRef }, - #[error("Invalid Batch Transaction: {}", error)] - InvalidBatchTransaction { error: String }, - #[error("This Move function is currently disabled and not available for call")] - BlockedMoveFunction, - #[error("Empty input coins for Pay related transaction")] - EmptyInputCoins, - - #[error( - "IOTA payment transactions use first input coin for gas payment, but found a different gas object" - )] - UnexpectedGasPaymentObject, - - #[error("Wrong initial version given for shared object")] - SharedObjectStartingVersionMismatch, - - #[error( - "Attempt to transfer object {object_id} that does not have public transfer. Object transfer must be done instead using a distinct Move function call" - )] - TransferObjectWithoutPublicTransfer { object_id: ObjectID }, - - #[error( - "TransferObjects, MergeCoin, and Publish cannot have empty arguments. \ - If MakeMoveVec has empty arguments, it must have a type specified" - )] - EmptyCommandInput, - - #[error("Transaction is denied: {}", error)] - TransactionDenied { error: String }, - - #[error("Feature is not supported: {0}")] - Unsupported(String), - - #[error("Query transactions with move function input error: {0}")] - MoveFunctionInput(String), - - #[error("Verified checkpoint not found for sequence number: {0}")] - VerifiedCheckpointNotFound(CheckpointSequenceNumber), - - #[error("Verified checkpoint not found for digest: {0}")] - VerifiedCheckpointDigestNotFound(String), - - #[error("Latest checkpoint sequence number not found")] - LatestCheckpointSequenceNumberNotFound, - - #[error("Checkpoint contents not found for digest: {0}")] - CheckpointContentsNotFound(CheckpointContentsDigest), - - #[error("Genesis transaction not found")] - GenesisTransactionNotFound, - - #[error("Transaction {0} not found")] - TransactionCursorNotFound(u64), - - #[error( - "Object {:?} is a system object and cannot be accessed by user transactions", - object_id - )] - InaccessibleSystemObject { object_id: ObjectID }, - #[error( - "{max_publish_commands} max publish/upgrade commands allowed, {publish_count} provided" - )] - MaxPublishCountExceeded { - max_publish_commands: u64, - publish_count: u64, - }, - - #[error("Immutable parameter provided, mutable parameter expected")] - MutableParameterExpected { object_id: ObjectID }, - - #[error("Address {address:?} is denied for coin {coin_type}")] - AddressDeniedForCoin { - address: IotaAddress, - coin_type: String, - }, - - #[error("Commands following a command with Random can only be TransferObjects or MergeCoins")] - PostRandomCommandRestrictions, - - // Soft Bundle related errors - #[error( - "Number of transactions exceeds the maximum allowed ({:?}) in a Soft Bundle", - limit - )] - TooManyTransactionsInSoftBundle { limit: u64 }, - #[error("Transaction {:?} in Soft Bundle contains no shared objects", digest)] - NoSharedObject { digest: TransactionDigest }, - #[error("Transaction {:?} in Soft Bundle has already been executed", digest)] - AlreadyExecuted { digest: TransactionDigest }, - #[error("At least one certificate in Soft Bundle has already been processed")] - CertificateAlreadyProcessed, - #[error( - "Gas price for transaction {:?} in Soft Bundle mismatch: want {:?}, have {:?}", - digest, - expected, - actual - )] - GasPriceMismatch { - digest: TransactionDigest, - expected: u64, - actual: u64, - }, - - #[error("Coin type is globally paused for use: {coin_type}")] - CoinTypeGlobalPause { coin_type: String }, -} - -#[derive( - Eq, - PartialEq, - Clone, - Debug, - Serialize, - Deserialize, - Hash, - AsRefStr, - IntoStaticStr, - Error, -)] -#[serde(tag = "code", rename = "ObjectResponseError", rename_all = "camelCase")] -pub enum IotaObjectResponseError { - #[error("Object {:?} does not exist", object_id)] - NotExists { object_id: ObjectID }, - #[error("Cannot find dynamic field for parent object {:?}", parent_object_id)] - DynamicFieldNotFound { parent_object_id: ObjectID }, - #[error( - "Object has been deleted object_id: {:?} at version: {:?} in digest {:?}", - object_id, - version, - digest - )] - Deleted { - object_id: ObjectID, - /// Object version. - version: SequenceNumber, - /// Base64 string representing the object digest - digest: ObjectDigest, - }, - #[error("Unknown Error")] - Unknown, - #[error("Display Error: {:?}", error)] - Display { error: String }, - // TODO: also integrate IotaPastObjectResponse (VersionNotFound, VersionTooHigh) -} - -/// Custom error type for Iota. -#[derive( - Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Error, Hash, AsRefStr, IntoStaticStr, -)] -pub enum IotaError { - #[error("Error checking transaction input objects: {:?}", error)] - UserInput { error: UserInputError }, - - #[error("Error checking transaction object: {:?}", error)] - IotaObjectResponse { error: IotaObjectResponseError }, - - #[error("Expecting a single owner, shared ownership found")] - UnexpectedOwnerType, - - #[error("There are already {queue_len} transactions pending, above threshold of {threshold}")] - TooManyTransactionsPendingExecution { queue_len: usize, threshold: usize }, - - #[error("There are too many transactions pending in consensus")] - TooManyTransactionsPendingConsensus, - - #[error( - "Input {object_id} already has {queue_len} transactions pending, above threshold of {threshold}" - )] - TooManyTransactionsPendingOnObject { - object_id: ObjectID, - queue_len: usize, - threshold: usize, - }, - - #[error( - "Input {object_id} has a transaction {txn_age_sec} seconds old pending, above threshold of {threshold} seconds" - )] - TooOldTransactionPendingOnObject { - object_id: ObjectID, - txn_age_sec: u64, - threshold: u64, - }, - - #[error("Soft bundle must only contain transactions of UserTransaction kind")] - InvalidTxKindInSoftBundle, - - // Signature verification - #[error("Signature is not valid: {}", error)] - InvalidSignature { error: String }, - #[error("Required Signature from {expected} is absent {:?}", actual)] - SignerSignatureAbsent { - expected: String, - actual: Vec, - }, - #[error("Expect {expected} signer signatures but got {actual}")] - SignerSignatureNumberMismatch { expected: usize, actual: usize }, - #[error("Value was not signed by the correct sender: {}", error)] - IncorrectSigner { error: String }, - #[error( - "Value was not signed by a known authority. signer: {:?}, index: {:?}, committee: {committee}", - signer, - index - )] - UnknownSigner { - signer: Option, - index: Option, - committee: Box, // Committee is not available for wasm32 - }, - #[error( - "Validator {:?} responded multiple signatures for the same message, conflicting: {:?}", - signer, - conflicting_sig - )] - StakeAggregatorRepeatedSigner { - signer: AuthorityName, - conflicting_sig: bool, - }, - // TODO: Used for distinguishing between different occurrences of invalid signatures, to allow - // retries in some cases. - #[error( - "Signature is not valid, but a retry may result in a valid one: {}", - error - )] - PotentiallyTemporarilyInvalidSignature { error: String }, - - // Certificate verification and execution - #[error( - "Signature or certificate from wrong epoch, expected {expected_epoch}, got {actual_epoch}" - )] - WrongEpoch { - expected_epoch: EpochId, - actual_epoch: EpochId, - }, - #[error("Signatures in a certificate must form a quorum")] - CertificateRequiresQuorum, - #[error("Transaction certificate processing failed: {err}")] - ErrorWhileProcessingCertificate { err: String }, - #[error( - "Failed to get a quorum of signed effects when processing transaction: {effects_map:?}" - )] - QuorumFailedToGetEffectsQuorumWhenProcessingTransaction { - effects_map: BTreeMap, StakeUnit)>, - }, - #[error( - "Failed to verify Tx certificate with executed effects, error: {error:?}, validator: {validator_name:?}" - )] - FailedToVerifyTxCertWithExecutedEffects { - validator_name: AuthorityName, - error: String, - }, - #[error("Transaction is already finalized but with different user signatures")] - TxAlreadyFinalizedWithDifferentUserSigs, - - // Account access - #[error("Invalid authenticator")] - InvalidAuthenticator, - #[error("Invalid address")] - InvalidAddress, - #[error("Invalid transaction digest.")] - InvalidTransactionDigest, - - #[error("Invalid digest length. Expected {expected}, got {actual}")] - InvalidDigestLength { expected: usize, actual: usize }, - #[error("Invalid DKG message size")] - InvalidDkgMessageSize, - - #[error("Unexpected message.")] - UnexpectedMessage, - - // Move module publishing related errors - #[error("Failed to verify the Move module, reason: {error:?}.")] - ModuleVerificationFailure { error: String }, - #[error("Failed to deserialize the Move module, reason: {error:?}.")] - ModuleDeserializationFailure { error: String }, - #[error("Failed to publish the Move module(s), reason: {error}")] - ModulePublishFailure { error: String }, - #[error("Failed to build Move modules: {error}.")] - ModuleBuildFailure { error: String }, - - // Move call related errors - #[error("Function resolution failure: {error:?}.")] - FunctionNotFound { error: String }, - #[error("Module not found in package: {module_name:?}.")] - ModuleNotFound { module_name: String }, - #[error("Type error while binding function arguments: {error:?}.")] - Type { error: String }, - #[error("Circular object ownership detected")] - CircularObjectOwnership, - - // Internal state errors - #[error("Attempt to re-initialize a transaction lock for objects {:?}.", refs)] - ObjectLockAlreadyInitialized { refs: Vec }, - #[error( - "Object {obj_ref:?} already locked by a different transaction: {pending_transaction:?}" - )] - ObjectLockConflict { - obj_ref: ObjectRef, - pending_transaction: TransactionDigest, - }, - #[error( - "Objects {obj_refs:?} are already locked by a transaction from a future epoch {locked_epoch:?}), attempt to override with a transaction from epoch {new_epoch:?}" - )] - ObjectLockedAtFutureEpoch { - obj_refs: Vec, - locked_epoch: EpochId, - new_epoch: EpochId, - locked_by_tx: TransactionDigest, - }, - #[error("{TRANSACTION_NOT_FOUND_MSG_PREFIX} [{:?}].", digest)] - TransactionNotFound { digest: TransactionDigest }, - #[error("{TRANSACTIONS_NOT_FOUND_MSG_PREFIX} [{:?}].", digests)] - TransactionsNotFound { digests: Vec }, - #[error("Could not find the referenced transaction events [{digest:?}].")] - TransactionEventsNotFound { digest: TransactionEventsDigest }, - #[error( - "Attempt to move to `Executed` state an transaction that has already been executed: {:?}.", - digest - )] - TransactionAlreadyExecuted { digest: TransactionDigest }, - #[error("Object ID did not have the expected type")] - BadObjectType { error: String }, - #[error("Fail to retrieve Object layout for {st}")] - FailObjectLayout { st: String }, - - #[error("Execution invariant violated")] - ExecutionInvariantViolation, - #[error("Validator {authority:?} is faulty in a Byzantine manner: {reason:?}")] - ByzantineAuthoritySuspicion { - authority: AuthorityName, - reason: String, - }, - #[error( - "Attempted to access {object} through parent {given_parent}, \ - but it's actual parent is {actual_owner}" - )] - InvalidChildObjectAccess { - object: ObjectID, - given_parent: ObjectID, - actual_owner: Owner, - }, - - #[error("Authority Error: {error:?}")] - GenericAuthority { error: String }, - - // GenericBridge is not available - - #[error("Failed to dispatch subscription: {error:?}")] - FailedToDispatchSubscription { error: String }, - - #[error("Failed to serialize Owner: {error:?}")] - OwnerFailedToSerialize { error: String }, - - #[error("Failed to deserialize fields into JSON: {error:?}")] - ExtraFieldFailedToDeserialize { error: String }, - - #[error("Failed to execute transaction locally by Orchestrator: {error:?}")] - TransactionOrchestratorLocalExecution { error: String }, - - // Errors returned by authority and client read API's - #[error("Failure serializing transaction in the requested format: {:?}", error)] - TransactionSerialization { error: String }, - #[error("Failure serializing object in the requested format: {:?}", error)] - ObjectSerialization { error: String }, - #[error("Failure deserializing object in the requested format: {:?}", error)] - ObjectDeserialization { error: String }, - #[error("Event store component is not active on this node")] - NoEventStore, - - // Client side error - #[error("Too many authority errors were detected for {}: {:?}", action, errors)] - TooManyIncorrectAuthorities { - errors: Vec<(AuthorityName, IotaError)>, - action: String, - }, - #[error("Invalid transaction range query to the fullnode: {:?}", error)] - FullNodeInvalidTxRangeQuery { error: String }, - - // Errors related to the authority-consensus interface. - #[error("Failed to submit transaction to consensus: {0}")] - FailedToSubmitToConsensus(String), - #[error("Failed to connect with consensus node: {0}")] - ConsensusConnectionBroken(String), - #[error("Failed to execute handle_consensus_transaction on Iota: {0}")] - HandleConsensusTransactionFailure(String), - - // Cryptography errors. - #[error("Signature key generation error: {0}")] - SignatureKeyGen(String), - #[error("Key Conversion Error: {0}")] - KeyConversion(String), - #[error("Invalid Private Key provided")] - InvalidPrivateKey, - - // Unsupported Operations on Fullnode - #[error("Fullnode does not support handle_certificate")] - FullNodeCantHandleCertificate, - - // Epoch related errors. - #[error("Validator temporarily stopped processing transactions due to epoch change")] - ValidatorHaltedAtEpochEnd, - #[error("Operations for epoch {0} have ended")] - EpochEnded(EpochId), - #[error("Error when advancing epoch: {:?}", error)] - AdvanceEpoch { error: String }, - - #[error("Transaction Expired")] - TransactionExpired, - - // These are errors that occur when an RPC fails and is simply the utf8 message sent in a - // Tonic::Status - #[error("{1} - {0}")] - Rpc(String, String), - - #[error("Method not allowed")] - InvalidRpcMethod, - - // TODO: We should fold this into UserInputError::Unsupported. - #[error("Use of disabled feature: {:?}", error)] - UnsupportedFeature { error: String }, - - #[error("Unable to communicate with the Quorum Driver channel: {:?}", error)] - QuorumDriverCommunication { error: String }, - - #[error("Operation timed out")] - Timeout, - - #[error("Error executing {0}")] - Execution(String), - - #[error("Invalid committee composition")] - InvalidCommittee(String), - - #[error("Missing committee information for epoch {0}")] - MissingCommitteeAtEpoch(EpochId), - - #[error("Index store not available on this Fullnode.")] - IndexStoreNotAvailable, - - #[error("Failed to read dynamic field from table in the object store: {0}")] - DynamicFieldRead(String), - - #[error("Failed to read or deserialize system state related data structures on-chain: {0}")] - IotaSystemStateRead(String), - - #[error("Failed to read or deserialize bridge related data structures on-chain: {0}")] - IotaBridgeRead(String), - - #[error("Unexpected version error: {0}")] - UnexpectedVersion(String), - - #[error("Message version is not supported at the current protocol version: {error}")] - WrongMessageVersion { error: String }, - - #[error("unknown error: {0}")] - Unknown(String), - - #[error("Failed to perform file operation: {0}")] - FileIO(String), - - #[error("Failed to get JWK")] - JWKRetrieval, - - #[error("Storage error: {0}")] - Storage(String), - - #[error( - "Validator cannot handle the request at the moment. Please retry after at least {retry_after_secs} seconds." - )] - ValidatorOverloadedRetryAfter { retry_after_secs: u64 }, - - #[error("Too many requests")] - TooManyRequests, - - #[error("The request did not contain a certificate")] - NoCertificateProvided, -} - -#[repr(u64)] -#[expect(non_camel_case_types)] -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] -/// Sub-status codes for the `UNKNOWN_VERIFICATION_ERROR` VM Status Code which -/// provides more context TODO: add more Vm Status errors. We use -/// `UNKNOWN_VERIFICATION_ERROR` as a catchall for now. -pub enum VMMVerifierErrorSubStatusCode { - MULTIPLE_RETURN_VALUES_NOT_ALLOWED = 0, - INVALID_OBJECT_CREATION = 1, -} - -#[repr(u64)] -#[expect(non_camel_case_types)] -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] -/// Sub-status codes for the `MEMORY_LIMIT_EXCEEDED` VM Status Code which -/// provides more context -pub enum VMMemoryLimitExceededSubStatusCode { - EVENT_COUNT_LIMIT_EXCEEDED = 0, - EVENT_SIZE_LIMIT_EXCEEDED = 1, - NEW_ID_COUNT_LIMIT_EXCEEDED = 2, - DELETED_ID_COUNT_LIMIT_EXCEEDED = 3, - TRANSFER_ID_COUNT_LIMIT_EXCEEDED = 4, - OBJECT_RUNTIME_CACHE_LIMIT_EXCEEDED = 5, - OBJECT_RUNTIME_STORE_LIMIT_EXCEEDED = 6, - TOTAL_EVENT_SIZE_LIMIT_EXCEEDED = 7, -} - -pub type IotaResult = Result; -pub type UserInputResult = Result; - -// iota_protocol_config::Error is not available - -impl From for IotaError { - fn from(error: ExecutionError) -> Self { - IotaError::Execution(error.to_string()) - } -} - -// Status, TypedStoreError, crate::storage::error::Error are not available - -impl From for IotaError { - fn from(kind: ExecutionErrorKind) -> Self { - ExecutionError::from_kind(kind).into() - } -} - -impl From<&str> for IotaError { - fn from(error: &str) -> Self { - IotaError::GenericAuthority { - error: error.to_string(), - } - } -} - -impl From for IotaError { - fn from(error: String) -> Self { - IotaError::GenericAuthority { error } - } -} - -impl TryFrom for UserInputError { - type Error = anyhow::Error; - - fn try_from(err: IotaError) -> Result { - match err { - IotaError::UserInput { error } => Ok(error), - other => anyhow::bail!("error {:?} is not UserInput", other), - } - } -} - -impl From for IotaError { - fn from(error: UserInputError) -> Self { - IotaError::UserInput { error } - } -} - -impl From for IotaError { - fn from(error: IotaObjectResponseError) -> Self { - IotaError::IotaObjectResponse { error } - } -} - -impl IotaError { - pub fn individual_error_indicates_epoch_change(&self) -> bool { - matches!( - self, - IotaError::ValidatorHaltedAtEpochEnd | IotaError::MissingCommitteeAtEpoch(_) - ) - } - - /// Returns if the error is retryable and if the error's retryability is - /// explicitly categorized. - /// There should be only a handful of retryable errors. For now we list - /// common non-retryable error below to help us find more retryable - /// errors in logs. - pub fn is_retryable(&self) -> (bool, bool) { - let retryable = match self { - IotaError::Rpc { .. } => true, - - // Reconfig error - IotaError::ValidatorHaltedAtEpochEnd => true, - IotaError::MissingCommitteeAtEpoch(..) => true, - IotaError::WrongEpoch { .. } => true, - IotaError::EpochEnded { .. } => true, - - IotaError::UserInput { error } => { - match error { - // Only ObjectNotFound and DependentPackageNotFound is potentially retryable - UserInputError::ObjectNotFound { .. } => true, - UserInputError::DependentPackageNotFound { .. } => true, - _ => false, - } - } - - IotaError::PotentiallyTemporarilyInvalidSignature { .. } => true, - - // Overload errors - IotaError::TooManyTransactionsPendingExecution { .. } => true, - IotaError::TooManyTransactionsPendingOnObject { .. } => true, - IotaError::TooOldTransactionPendingOnObject { .. } => true, - IotaError::TooManyTransactionsPendingConsensus => true, - IotaError::ValidatorOverloadedRetryAfter { .. } => true, - - // Non retryable error - IotaError::Execution(..) => false, - IotaError::ByzantineAuthoritySuspicion { .. } => false, - IotaError::QuorumFailedToGetEffectsQuorumWhenProcessingTransaction { .. } => false, - IotaError::TxAlreadyFinalizedWithDifferentUserSigs => false, - IotaError::FailedToVerifyTxCertWithExecutedEffects { .. } => false, - IotaError::ObjectLockConflict { .. } => false, - - // NB: This is not an internal overload, but instead an imposed rate - // limit / blocking of a client. It must be non-retryable otherwise - // we will make the threat worse through automatic retries. - IotaError::TooManyRequests => false, - - // For all un-categorized errors, return here with categorized = false. - _ => return (false, false), - }; - - (retryable, true) - } - - pub fn is_object_or_package_not_found(&self) -> bool { - match self { - IotaError::UserInput { error } => { - matches!( - error, - UserInputError::ObjectNotFound { .. } - | UserInputError::DependentPackageNotFound { .. } - ) - } - _ => false, - } - } - - pub fn is_overload(&self) -> bool { - matches!( - self, - IotaError::TooManyTransactionsPendingExecution { .. } - | IotaError::TooManyTransactionsPendingOnObject { .. } - | IotaError::TooOldTransactionPendingOnObject { .. } - | IotaError::TooManyTransactionsPendingConsensus - ) - } - - pub fn is_retryable_overload(&self) -> bool { - matches!(self, IotaError::ValidatorOverloadedRetryAfter { .. }) - } - - pub fn retry_after_secs(&self) -> u64 { - match self { - IotaError::ValidatorOverloadedRetryAfter { retry_after_secs } => *retry_after_secs, - _ => 0, - } - } -} - -impl Ord for IotaError { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - Ord::cmp(self.as_ref(), other.as_ref()) - } -} - -impl PartialOrd for IotaError { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - -type BoxError = Box; - -pub type ExecutionErrorKind = ExecutionFailureStatus; - -#[derive(Debug)] -pub struct ExecutionError { - inner: Box, -} - -#[derive(Debug)] -struct ExecutionErrorInner { - kind: ExecutionErrorKind, - source: Option, - command: Option, -} - -impl ExecutionError { - pub fn new(kind: ExecutionErrorKind, source: Option) -> Self { - Self { - inner: Box::new(ExecutionErrorInner { - kind, - source, - command: None, - }), - } - } - - pub fn new_with_source>(kind: ExecutionErrorKind, source: E) -> Self { - Self::new(kind, Some(source.into())) - } - - pub fn invariant_violation>(source: E) -> Self { - Self::new_with_source(ExecutionFailureStatus::InvariantViolation, source) - } - - pub fn with_command_index(mut self, command: CommandIndex) -> Self { - self.inner.command = Some(command); - self - } - - pub fn from_kind(kind: ExecutionErrorKind) -> Self { - Self::new(kind, None) - } - - pub fn kind(&self) -> &ExecutionErrorKind { - &self.inner.kind - } - - pub fn command(&self) -> Option { - self.inner.command - } - - pub fn source(&self) -> &Option { - &self.inner.source - } - - pub fn to_execution_status(&self) -> (ExecutionFailureStatus, Option) { - (self.kind().clone(), self.command()) - } -} - -impl std::fmt::Display for ExecutionError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ExecutionError: {:?}", self) - } -} - -impl std::error::Error for ExecutionError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - self.inner.source.as_ref().map(|e| &**e as _) - } -} - -impl From for ExecutionError { - fn from(kind: ExecutionErrorKind) -> Self { - Self::from_kind(kind) - } -} - -pub fn command_argument_error(e: CommandArgumentError, arg_idx: usize) -> ExecutionError { - ExecutionError::from_kind(ExecutionErrorKind::command_argument_error( - e, - arg_idx as u16, - )) -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/event.rs b/identity_iota_interaction/src/sdk_types/iota_types/event.rs deleted file mode 100644 index ddf02a23cf..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/event.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::str::FromStr; - -use serde::{Deserialize, Serialize}; -use serde_with::serde_as; -use anyhow::ensure; - -use super::{ - digests::TransactionDigest, - iota_serde::{Readable, BigInt}, -}; - -/// Unique ID of an IOTA Event, the ID is a combination of tx seq number and -/// event seq number, the ID is local to this particular fullnode and will be -/// different from other fullnode. -#[serde_as] -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Hash)] -#[serde(rename_all = "camelCase")] -pub struct EventID { - pub tx_digest: TransactionDigest, - #[serde_as(as = "Readable, _>")] - pub event_seq: u64, -} - -impl From<(TransactionDigest, u64)> for EventID { - fn from((tx_digest_num, event_seq_number): (TransactionDigest, u64)) -> Self { - Self { - tx_digest: tx_digest_num as TransactionDigest, - event_seq: event_seq_number, - } - } -} - -impl From for String { - fn from(id: EventID) -> Self { - format!("{:?}:{}", id.tx_digest, id.event_seq) - } -} - -impl TryFrom for EventID { - type Error = anyhow::Error; - - fn try_from(value: String) -> Result { - let values = value.split(':').collect::>(); - ensure!(values.len() == 2, "Malformed EventID : {value}"); - Ok(( - TransactionDigest::from_str(values[0])?, - u64::from_str(values[1])?, - ) - .into()) - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/execution_status.rs b/identity_iota_interaction/src/sdk_types/iota_types/execution_status.rs deleted file mode 100644 index 9471ec477f..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/execution_status.rs +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::fmt::{self, Display, Formatter}; - -use super::super::move_core_types::language_storage::ModuleId; -use serde::{Deserialize, Serialize}; -use thiserror::Error; - -use super::base_types::{ObjectID, IotaAddress, TypeParameterIndex, CodeOffset}; - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "lowercase")] // Needed for QuorumDriverTrait implementation in IotaClientTsSdk -pub enum ExecutionStatus { - Success, - /// Gas used in the failed case, and the error. - Failure { - /// The error - error: ExecutionFailureStatus, - /// Which command the error occurred - command: Option, - }, -} - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)] -pub struct CongestedObjects(pub Vec); - -impl fmt::Display for CongestedObjects { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - for obj in &self.0 { - write!(f, "{}, ", obj)?; - } - Ok(()) - } -} - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Error)] //, EnumVariantOrder)] -pub enum ExecutionFailureStatus { - // General transaction errors - #[error("Insufficient Gas.")] - InsufficientGas, - #[error("Invalid Gas Object. Possibly not address-owned or possibly not an IOTA coin.")] - InvalidGasObject, - #[error("INVARIANT VIOLATION.")] - InvariantViolation, - #[error("Attempted to used feature that is not supported yet")] - FeatureNotYetSupported, - #[error( - "Move object with size {object_size} is larger \ - than the maximum object size {max_object_size}" - )] - MoveObjectTooBig { - object_size: u64, - max_object_size: u64, - }, - #[error( - "Move package with size {object_size} is larger than the \ - maximum object size {max_object_size}" - )] - MovePackageTooBig { - object_size: u64, - max_object_size: u64, - }, - #[error("Circular Object Ownership, including object {object}.")] - CircularObjectOwnership { object: ObjectID }, - - // Coin errors - #[error("Insufficient coin balance for operation.")] - InsufficientCoinBalance, - #[error("The coin balance overflows u64")] - CoinBalanceOverflow, - - // Publish/Upgrade errors - #[error( - "Publish Error, Non-zero Address. \ - The modules in the package must have their self-addresses set to zero." - )] - PublishErrorNonZeroAddress, - - #[error( - "IOTA Move Bytecode Verification Error. \ - Please run the IOTA Move Verifier for more information." - )] - IotaMoveVerificationError, - - // Errors from the Move VM - // - // Indicates an error from a non-abort instruction - #[error( - "Move Primitive Runtime Error. Location: {0}. \ - Arithmetic error, stack overflow, max value depth, etc." - )] - MovePrimitiveRuntimeError(MoveLocationOpt), - #[error("Move Runtime Abort. Location: {0}, Abort Code: {1}")] - MoveAbort(MoveLocation, u64), - #[error( - "Move Bytecode Verification Error. \ - Please run the Bytecode Verifier for more information." - )] - VMVerificationOrDeserializationError, - #[error("MOVE VM INVARIANT VIOLATION.")] - VMInvariantViolation, - - // Programmable Transaction Errors - #[error("Function Not Found.")] - FunctionNotFound, - #[error( - "Arity mismatch for Move function. \ - The number of arguments does not match the number of parameters" - )] - ArityMismatch, - #[error( - "Type arity mismatch for Move function. \ - Mismatch between the number of actual versus expected type arguments." - )] - TypeArityMismatch, - #[error("Non Entry Function Invoked. Move Call must start with an entry function")] - NonEntryFunctionInvoked, - #[error("Invalid command argument at {arg_idx}. {kind}")] - CommandArgumentError { - arg_idx: u16, - kind: CommandArgumentError, - }, - #[error("Error for type argument at index {argument_idx}: {kind}")] - TypeArgumentError { - argument_idx: TypeParameterIndex, - kind: TypeArgumentError, - }, - #[error( - "Unused result without the drop ability. \ - Command result {result_idx}, return value {secondary_idx}" - )] - UnusedValueWithoutDrop { result_idx: u16, secondary_idx: u16 }, - #[error( - "Invalid public Move function signature. \ - Unsupported return type for return value {idx}" - )] - InvalidPublicFunctionReturnType { idx: u16 }, - #[error("Invalid Transfer Object, object does not have public transfer.")] - InvalidTransferObject, - - // Post-execution errors - // - // Indicates the effects from the transaction are too large - #[error( - "Effects of size {current_size} bytes too large. \ - Limit is {max_size} bytes" - )] - EffectsTooLarge { current_size: u64, max_size: u64 }, - - #[error( - "Publish/Upgrade Error, Missing dependency. \ - A dependency of a published or upgraded package has not been assigned an on-chain \ - address." - )] - PublishUpgradeMissingDependency, - - #[error( - "Publish/Upgrade Error, Dependency downgrade. \ - Indirect (transitive) dependency of published or upgraded package has been assigned an \ - on-chain version that is less than the version required by one of the package's \ - transitive dependencies." - )] - PublishUpgradeDependencyDowngrade, - - #[error("Invalid package upgrade. {upgrade_error}")] - PackageUpgradeError { upgrade_error: PackageUpgradeError }, - - // Indicates the transaction tried to write objects too large to storage - #[error( - "Written objects of {current_size} bytes too large. \ - Limit is {max_size} bytes" - )] - WrittenObjectsTooLarge { current_size: u64, max_size: u64 }, - - #[error("Certificate is on the deny list")] - CertificateDenied, - - #[error( - "IOTA Move Bytecode Verification Timeout. \ - Please run the IOTA Move Verifier for more information." - )] - IotaMoveVerificationTimeout, - - #[error("The shared object operation is not allowed.")] - SharedObjectOperationNotAllowed, - - #[error("Certificate cannot be executed due to a dependency on a deleted shared object")] - InputObjectDeleted, - - #[error("Certificate is cancelled due to congestion on shared objects: {congested_objects}")] - ExecutionCancelledDueToSharedObjectCongestion { congested_objects: CongestedObjects }, - - #[error("Address {address:?} is denied for coin {coin_type}")] - AddressDeniedForCoin { - address: IotaAddress, - coin_type: String, - }, - - #[error("Coin type is globally paused for use: {coin_type}")] - CoinTypeGlobalPause { coin_type: String }, - - #[error("Certificate is cancelled because randomness could not be generated this epoch")] - ExecutionCancelledDueToRandomnessUnavailable, - // NOTE: if you want to add a new enum, - // please add it at the end for Rust SDK backward compatibility. -} - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Hash)] -pub struct MoveLocation { - pub module: ModuleId, - pub function: u16, - pub instruction: CodeOffset, - pub function_name: Option, -} - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Hash)] -pub struct MoveLocationOpt(pub Option); - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Hash, Error)] -pub enum CommandArgumentError { - #[error("The type of the value does not match the expected type")] - TypeMismatch, - #[error("The argument cannot be deserialized into a value of the specified type")] - InvalidBCSBytes, - #[error("The argument cannot be instantiated from raw bytes")] - InvalidUsageOfPureArg, - #[error( - "Invalid argument to private entry function. \ - These functions cannot take arguments from other Move functions" - )] - InvalidArgumentToPrivateEntryFunction, - #[error("Out of bounds access to input or result vector {idx}")] - IndexOutOfBounds { idx: u16 }, - #[error( - "Out of bounds secondary access to result vector \ - {result_idx} at secondary index {secondary_idx}" - )] - SecondaryIndexOutOfBounds { result_idx: u16, secondary_idx: u16 }, - #[error( - "Invalid usage of result {result_idx}, \ - expected a single result but found either no return values or multiple." - )] - InvalidResultArity { result_idx: u16 }, - #[error( - "Invalid taking of the Gas coin. \ - It can only be used by-value with TransferObjects" - )] - InvalidGasCoinUsage, - #[error( - "Invalid usage of value. \ - Mutably borrowed values require unique usage. \ - Immutably borrowed values cannot be taken or borrowed mutably. \ - Taken values cannot be used again." - )] - InvalidValueUsage, - #[error("Immutable objects cannot be passed by-value.")] - InvalidObjectByValue, - #[error("Immutable objects cannot be passed by mutable reference, &mut.")] - InvalidObjectByMutRef, - #[error( - "Shared object operations such a wrapping, freezing, or converting to owned are not \ - allowed." - )] - SharedObjectOperationNotAllowed, -} - -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Hash, Error)] -pub enum PackageUpgradeError { - #[error("Unable to fetch package at {package_id}")] - UnableToFetchPackage { package_id: ObjectID }, - #[error("Object {object_id} is not a package")] - NotAPackage { object_id: ObjectID }, - #[error("New package is incompatible with previous version")] - IncompatibleUpgrade, - #[error("Digest in upgrade ticket and computed digest disagree")] - DigestDoesNotMatch { digest: Vec }, - #[error("Upgrade policy {policy} is not a valid upgrade policy")] - UnknownUpgradePolicy { policy: u8 }, - #[error("Package ID {package_id} does not match package ID in upgrade ticket {ticket_id}")] - PackageIDDoesNotMatch { - package_id: ObjectID, - ticket_id: ObjectID, - }, -} - -#[derive(Eq, PartialEq, Clone, Copy, Debug, Serialize, Deserialize, Hash, Error)] -pub enum TypeArgumentError { - #[error("A type was not found in the module specified.")] - TypeNotFound, - #[error("A type provided did not match the specified constraints.")] - ConstraintNotSatisfied, -} - -impl ExecutionFailureStatus { - pub fn command_argument_error(kind: CommandArgumentError, arg_idx: u16) -> Self { - Self::CommandArgumentError { arg_idx, kind } - } -} - -impl Display for MoveLocationOpt { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match &self.0 { - None => write!(f, "UNKNOWN"), - Some(l) => write!(f, "{l}"), - } - } -} - -impl Display for MoveLocation { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - let Self { - module, - function, - instruction, - function_name, - } = self; - if let Some(fname) = function_name { - write!( - f, - "{module}::{fname} (function index {function}) at offset {instruction}" - ) - } else { - write!( - f, - "{module} in function definition {function} at offset {instruction}" - ) - } - } -} - -impl ExecutionStatus { - pub fn new_failure( - error: ExecutionFailureStatus, - command: Option, - ) -> ExecutionStatus { - ExecutionStatus::Failure { error, command } - } - - pub fn is_ok(&self) -> bool { - matches!(self, ExecutionStatus::Success { .. }) - } - - pub fn is_err(&self) -> bool { - matches!(self, ExecutionStatus::Failure { .. }) - } - - pub fn unwrap(&self) { - match self { - ExecutionStatus::Success => {} - ExecutionStatus::Failure { .. } => { - panic!("Unable to unwrap() on {:?}", self); - } - } - } - - pub fn unwrap_err(self) -> (ExecutionFailureStatus, Option) { - match self { - ExecutionStatus::Success { .. } => { - panic!("Unable to unwrap() on {:?}", self); - } - ExecutionStatus::Failure { error, command } => (error, command), - } - } -} - -pub type CommandIndex = usize; diff --git a/identity_iota_interaction/src/sdk_types/iota_types/gas.rs b/identity_iota_interaction/src/sdk_types/iota_types/gas.rs deleted file mode 100644 index 3165ad2002..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/gas.rs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; -use serde_with::serde_as; -use super::iota_serde::{BigInt, Readable}; - -/// Summary of the charges in a transaction. -/// Storage is charged independently of computation. -/// There are 3 parts to the storage charges: -/// `storage_cost`: it is the charge of storage at the time the transaction -/// is executed. The cost of storage is the number of -/// bytes of the objects being mutated multiplied by a -/// variable storage cost per byte `storage_rebate`: this is the amount -/// a user gets back when manipulating an object. The -/// `storage_rebate` is the `storage_cost` for an object minus fees. -/// `non_refundable_storage_fee`: not all the value of the object storage -/// cost is given back to user and there -/// is a small fraction that is kept by -/// the system. This value tracks that charge. -/// -/// When looking at a gas cost summary the amount charged to the user is -/// `computation_cost + storage_cost - storage_rebate` -/// and that is the amount that is deducted from the gas coins. -/// `non_refundable_storage_fee` is collected from the objects being -/// mutated/deleted and it is tracked by the system in storage funds. -/// -/// Objects deleted, including the older versions of objects mutated, have -/// the storage field on the objects added up to a pool of "potential -/// rebate". This rebate then is reduced by the "nonrefundable rate" -/// such that: `potential_rebate(storage cost of deleted/mutated -/// objects) = storage_rebate + non_refundable_storage_fee` - -#[serde_as] -#[derive(Eq, PartialEq, Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] -#[serde(rename_all = "camelCase")] -pub struct GasCostSummary { - /// Cost of computation/execution - #[schemars(with = "BigInt")] - #[serde_as(as = "Readable, _>")] - pub computation_cost: u64, - /// The burned component of the computation/execution costs - #[schemars(with = "BigInt")] - #[serde_as(as = "Readable, _>")] - pub computation_cost_burned: u64, - /// Storage cost, it's the sum of all storage cost for all objects - /// created or mutated. - #[schemars(with = "BigInt")] - #[serde_as(as = "Readable, _>")] - pub storage_cost: u64, - /// The amount of storage cost refunded to the user for all objects - /// deleted or mutated in the transaction. - #[schemars(with = "BigInt")] - #[serde_as(as = "Readable, _>")] - pub storage_rebate: u64, - /// The fee for the rebate. The portion of the storage rebate kept by - /// the system. - #[schemars(with = "BigInt")] - #[serde_as(as = "Readable, _>")] - pub non_refundable_storage_fee: u64, -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/gas_coin.rs b/identity_iota_interaction/src/sdk_types/iota_types/gas_coin.rs deleted file mode 100644 index b8cafc9720..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/gas_coin.rs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::Deserialize; -use serde::Serialize; - -use crate::ident_str; - -use super::super::move_core_types::language_storage::{StructTag, TypeTag}; -use super::super::move_core_types::identifier::IdentStr; -use super::super::move_core_types::annotated_value::MoveStructLayout; - -use super::super::types::IOTA_FRAMEWORK_ADDRESS; - -use super::coin::{Coin, TreasuryCap}; -use super::base_types::{ObjectID}; -use super::id::UID; -use super::balance::{Balance, Supply}; -use std::fmt::{Display, Formatter}; - -/// The number of Nanos per IOTA token -pub const NANOS_PER_IOTA: u64 = 1_000_000_000; - -/// Total supply in IOTA at genesis, after the migration from a Stardust ledger, -/// before any inflation mechanism -pub const STARDUST_TOTAL_SUPPLY_IOTA: u64 = 4_600_000_000; - -// Note: cannot use checked arithmetic here since `const unwrap` is still -// unstable. -/// Total supply at genesis denominated in Nanos, after the migration from a -/// Stardust ledger, before any inflation mechanism -pub const STARDUST_TOTAL_SUPPLY_NANOS: u64 = STARDUST_TOTAL_SUPPLY_IOTA * NANOS_PER_IOTA; - -pub const GAS_MODULE_NAME: &IdentStr = ident_str!("iota"); -pub const GAS_STRUCT_NAME: &IdentStr = ident_str!("IOTA"); -pub const GAS_TREASURY_CAP_STRUCT_NAME: &IdentStr = ident_str!("IotaTreasuryCap"); - -pub struct GAS {} -impl GAS { - pub fn type_() -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - name: GAS_STRUCT_NAME.to_owned(), - module: GAS_MODULE_NAME.to_owned(), - type_params: Vec::new(), - } - } - - pub fn type_tag() -> TypeTag { - TypeTag::Struct(Box::new(Self::type_())) - } - - pub fn is_gas(other: &StructTag) -> bool { - &Self::type_() == other - } - - pub fn is_gas_type(other: &TypeTag) -> bool { - match other { - TypeTag::Struct(s) => Self::is_gas(s), - _ => false, - } - } -} - -/// Rust version of the Move iota::coin::Coin type -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct GasCoin(pub Coin); - -impl GasCoin { - pub fn new(id: ObjectID, value: u64) -> Self { - Self(Coin::new(UID::new(id), value)) - } - - pub fn value(&self) -> u64 { - self.0.value() - } - - pub fn type_() -> StructTag { - Coin::type_(TypeTag::Struct(Box::new(GAS::type_()))) - } - - /// Return `true` if `s` is the type of a gas coin (i.e., - /// 0x2::coin::Coin<0x2::iota::IOTA>) - pub fn is_gas_coin(s: &StructTag) -> bool { - Coin::is_coin(s) && s.type_params.len() == 1 && GAS::is_gas_type(&s.type_params[0]) - } - - /// Return `true` if `s` is the type of a gas balance (i.e., - /// 0x2::balance::Balance<0x2::iota::IOTA>) - pub fn is_gas_balance(s: &StructTag) -> bool { - Balance::is_balance(s) - && s.type_params.len() == 1 - && GAS::is_gas_type(&s.type_params[0]) - } - - pub fn id(&self) -> &ObjectID { - self.0.id() - } - - pub fn to_bcs_bytes(&self) -> Vec { - bcs::to_bytes(&self).unwrap() - } - - // MoveObject is not available for wasm32 - // - // pub fn to_object(&self, version: SequenceNumber) -> MoveObject { - // MoveObject::new_gas_coin(version, *self.id(), self.value()) - // } - - pub fn layout() -> MoveStructLayout { - Coin::layout(TypeTag::Struct(Box::new(GAS::type_()))) - } -} - -impl Display for GasCoin { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "Coin {{ id: {}, value: {} }}", self.id(), self.value()) - } -} - -// Rust version of the IotaTreasuryCap type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct IotaTreasuryCap { - pub inner: TreasuryCap, -} - -impl IotaTreasuryCap { - pub fn type_() -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - module: GAS_MODULE_NAME.to_owned(), - name: GAS_TREASURY_CAP_STRUCT_NAME.to_owned(), - type_params: Vec::new(), - } - } - - /// Returns the `TreasuryCap` object ID. - pub fn id(&self) -> &ObjectID { - self.inner.id.object_id() - } - - /// Returns the total `Supply` of `Coin`. - pub fn total_supply(&self) -> &Supply { - &self.inner.total_supply - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/governance.rs b/identity_iota_interaction/src/sdk_types/iota_types/governance.rs deleted file mode 100644 index e9ed0fe3e8..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/governance.rs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::Deserialize; -use serde::Serialize; - -use crate::ident_str; - -use super::super::move_core_types::language_storage::StructTag; -use super::super::move_core_types::identifier::IdentStr; - -use super::gas_coin::NANOS_PER_IOTA; -use super::balance::Balance; -use super::IOTA_SYSTEM_ADDRESS; -use super::base_types::{ObjectID, EpochId}; -use super::id::{UID, ID}; - -/// Maximum number of active validators at any moment. -/// We do not allow the number of validators in any epoch to go above this. -pub const MAX_VALIDATOR_COUNT: u64 = 150; - -/// Lower-bound on the amount of stake required to become a validator. -/// -/// 2 million IOTA -pub const MIN_VALIDATOR_JOINING_STAKE_NANOS: u64 = 2_000_000 * NANOS_PER_IOTA; - -/// Validators with stake amount below `validator_low_stake_threshold` are -/// considered to have low stake and will be escorted out of the validator set -/// after being below this threshold for more than -/// `validator_low_stake_grace_period` number of epochs. -/// -/// 1.5 million IOTA -pub const VALIDATOR_LOW_STAKE_THRESHOLD_NANOS: u64 = 1_500_000 * NANOS_PER_IOTA; - -/// Validators with stake below `validator_very_low_stake_threshold` will be -/// removed immediately at epoch change, no grace period. -/// -/// 1 million IOTA -pub const VALIDATOR_VERY_LOW_STAKE_THRESHOLD_NANOS: u64 = 1_000_000 * NANOS_PER_IOTA; - -/// A validator can have stake below `validator_low_stake_threshold` -/// for this many epochs before being kicked out. -pub const VALIDATOR_LOW_STAKE_GRACE_PERIOD: u64 = 7; - -pub const STAKING_POOL_MODULE_NAME: &IdentStr = ident_str!("staking_pool"); -pub const STAKED_IOTA_STRUCT_NAME: &IdentStr = ident_str!("StakedIota"); - -pub const ADD_STAKE_MUL_COIN_FUN_NAME: &IdentStr = ident_str!("request_add_stake_mul_coin"); -pub const ADD_STAKE_FUN_NAME: &IdentStr = ident_str!("request_add_stake"); -pub const WITHDRAW_STAKE_FUN_NAME: &IdentStr = ident_str!("request_withdraw_stake"); - -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct StakedIota { - id: UID, - pool_id: ID, - stake_activation_epoch: u64, - principal: Balance, -} - -impl StakedIota { - pub fn type_() -> StructTag { - StructTag { - address: IOTA_SYSTEM_ADDRESS, - module: STAKING_POOL_MODULE_NAME.to_owned(), - name: STAKED_IOTA_STRUCT_NAME.to_owned(), - type_params: vec![], - } - } - - pub fn is_staked_iota(s: &StructTag) -> bool { - s.address == IOTA_SYSTEM_ADDRESS - && s.module.as_ident_str() == STAKING_POOL_MODULE_NAME - && s.name.as_ident_str() == STAKED_IOTA_STRUCT_NAME - && s.type_params.is_empty() - } - - pub fn id(&self) -> ObjectID { - self.id.id.bytes - } - - pub fn pool_id(&self) -> ObjectID { - self.pool_id.bytes - } - - pub fn activation_epoch(&self) -> EpochId { - self.stake_activation_epoch - } - - pub fn request_epoch(&self) -> EpochId { - // TODO: this might change when we implement warm up period. - self.stake_activation_epoch.saturating_sub(1) - } - - pub fn principal(&self) -> u64 { - self.principal.value() - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/id.rs b/identity_iota_interaction/src/sdk_types/iota_types/id.rs deleted file mode 100644 index b8727295a7..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/id.rs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::{Deserialize, Serialize}; - -use crate::ident_str; - -use super::super::{ - move_core_types::{ - account_address::AccountAddress, - identifier::IdentStr, - language_storage::{StructTag, TypeTag}, - annotated_value::{MoveStructLayout, MoveFieldLayout, MoveTypeLayout}, - }, -}; - -use super::{ - base_types::ObjectID, - MoveTypeTagTrait, - IOTA_FRAMEWORK_ADDRESS, -}; - -pub const OBJECT_MODULE_NAME_STR: &str = "object"; -pub const OBJECT_MODULE_NAME: &IdentStr = ident_str!(OBJECT_MODULE_NAME_STR); -pub const UID_STRUCT_NAME: &IdentStr = ident_str!("UID"); -pub const ID_STRUCT_NAME: &IdentStr = ident_str!("ID"); -pub const RESOLVED_IOTA_ID: (&AccountAddress, &IdentStr, &IdentStr) = - (&IOTA_FRAMEWORK_ADDRESS, OBJECT_MODULE_NAME, ID_STRUCT_NAME); - -/// Rust version of the Move iota::object::Info type -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct UID { - pub id: ID, -} - -/// Rust version of the Move iota::object::ID type -#[derive(Debug, Hash, Serialize, Deserialize, Clone, Eq, PartialEq)] -#[serde(transparent)] -pub struct ID { - pub bytes: ObjectID, -} - -impl UID { - pub fn new(bytes: ObjectID) -> Self { - Self { - id: { ID::new(bytes) }, - } - } - - pub fn type_() -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - module: OBJECT_MODULE_NAME.to_owned(), - name: UID_STRUCT_NAME.to_owned(), - type_params: Vec::new(), - } - } - - pub fn object_id(&self) -> &ObjectID { - &self.id.bytes - } - - pub fn to_bcs_bytes(&self) -> Vec { - bcs::to_bytes(&self).unwrap() - } - - pub fn layout() -> MoveStructLayout { - MoveStructLayout { - type_: Self::type_(), - fields: vec![MoveFieldLayout::new( - ident_str!("id").to_owned(), - MoveTypeLayout::Struct(Box::new(ID::layout())), - )], - } - } -} - -impl ID { - pub fn new(object_id: ObjectID) -> Self { - Self { bytes: object_id } - } - - pub fn type_() -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - module: OBJECT_MODULE_NAME.to_owned(), - name: ID_STRUCT_NAME.to_owned(), - type_params: Vec::new(), - } - } - - pub fn layout() -> MoveStructLayout { - MoveStructLayout { - type_: Self::type_(), - fields: vec![MoveFieldLayout::new( - ident_str!("bytes").to_owned(), - MoveTypeLayout::Address, - )], - } - } -} - -impl MoveTypeTagTrait for ID { - fn get_type_tag() -> TypeTag { - TypeTag::Struct(Box::new(Self::type_())) - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/iota_serde.rs b/identity_iota_interaction/src/sdk_types/iota_types/iota_serde.rs deleted file mode 100644 index f931a3dd0c..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/iota_serde.rs +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{ - fmt, - fmt::{Debug, Display, Formatter, Write}, - marker::PhantomData, - ops::Deref, - str::FromStr, -}; -use std::marker::Sized; -use std::string::{String, ToString}; -use std::result::Result::Ok; -#[allow(unused)] // Kept in sync with original source, so keep as is. -use std::option::Option; -use std::option::Option::Some; - -use fastcrypto::encoding::Hex; -use serde::{ - self, - de::{Deserializer, Error}, - ser::{Error as SerError, Serializer}, - Deserialize, Serialize, -}; -use serde_with::{serde_as, DeserializeAs, DisplayFromStr, SerializeAs}; -use schemars::JsonSchema; - -use Result; - -use super::super::move_core_types::{ - account_address::AccountAddress, - language_storage::{StructTag, TypeTag} -}; - -#[allow(unused)] // Kept in sync with original source, so keep as is. -use super::{IOTA_FRAMEWORK_ADDRESS, MOVE_STDLIB_ADDRESS, IOTA_SYSTEM_ADDRESS, - STARDUST_ADDRESS, IOTA_SYSTEM_STATE_ADDRESS, IOTA_CLOCK_ADDRESS }; -use super::parse_iota_struct_tag; -use super::parse_iota_type_tag; - -/// The minimum and maximum protocol versions supported by this build. -const MIN_PROTOCOL_VERSION: u64 = 1; // Originally defined in crates/iota-protocol-config/src/lib.rs -pub const MAX_PROTOCOL_VERSION: u64 = 1; // Originally defined in crates/iota-protocol-config/src/lib.rs - -// ----------------------------------------------------------------------------------------- -// Originally contained in crates/iota-protocol-config/src/lib.rs -// ----------------------------------------------------------------------------------------- - -// Record history of protocol version allocations here: -// -// Version 1: Original version. -// Version 2: Don't redistribute slashed staking rewards, fix computation of -// SystemEpochInfoEventV1. -#[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] -pub struct ProtocolVersion(u64); - -impl ProtocolVersion { - // The minimum and maximum protocol version supported by this binary. - // Counterintuitively, this constant may change over time as support for old - // protocol versions is removed from the source. This ensures that when a - // new network (such as a testnet) is created, its genesis committee will - // use a protocol version that is actually supported by the binary. - pub const MIN: Self = Self(MIN_PROTOCOL_VERSION); - - pub const MAX: Self = Self(MAX_PROTOCOL_VERSION); - - #[allow(unused)] // Kept in sync with original source, so keep as is. - #[cfg(not(msim))] - const MAX_ALLOWED: Self = Self::MAX; - - // We create 3 additional "fake" versions in simulator builds so that we can - // test upgrades. - #[cfg(msim)] - pub const MAX_ALLOWED: Self = Self(MAX_PROTOCOL_VERSION + 3); - - pub fn new(v: u64) -> Self { - Self(v) - } - - pub const fn as_u64(&self) -> u64 { - self.0 - } - - // For serde deserialization - we don't define a Default impl because there - // isn't a single universally appropriate default value. - pub fn max() -> Self { - Self::MAX - } -} - -impl From for ProtocolVersion { - fn from(v: u64) -> Self { - Self::new(v) - } -} - -// ----------------------------------------------------------------------------------------- -// End of originally contained in crates/iota-protocol-config/src/lib.rs section -// ----------------------------------------------------------------------------------------- - -#[inline] -fn to_custom_error<'de, D, E>(e: E) -> D::Error - where - E: Debug, - D: Deserializer<'de>, -{ - Error::custom(format!("byte deserialization failed, cause by: {:?}", e)) -} - -/// Use with serde_as to control serde for human-readable serialization and -/// deserialization `H` : serde_as SerializeAs/DeserializeAs delegation for -/// human readable in/output `R` : serde_as SerializeAs/DeserializeAs delegation -/// for non-human readable in/output -/// -/// # Example: -/// -/// ```text -/// #[serde_as] -/// #[derive(Deserialize, Serialize)] -/// struct Example(#[serde_as(as = "Readable")] [u8; 20]); -/// ``` -/// -/// The above example will delegate human-readable serde to `DisplayFromStr` -/// and array tuple (default) for non-human-readable serializer. -pub struct Readable { - human_readable: PhantomData, - non_human_readable: PhantomData, -} - -impl SerializeAs for Readable - where - H: SerializeAs, - R: SerializeAs, -{ - fn serialize_as(value: &T, serializer: S) -> Result - where - S: Serializer, - { - if serializer.is_human_readable() { - H::serialize_as(value, serializer) - } else { - R::serialize_as(value, serializer) - } - } -} - -impl<'de, R, H, T> DeserializeAs<'de, T> for Readable - where - H: DeserializeAs<'de, T>, - R: DeserializeAs<'de, T>, -{ - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - if deserializer.is_human_readable() { - H::deserialize_as(deserializer) - } else { - R::deserialize_as(deserializer) - } - } -} - -/// custom serde for AccountAddress -pub struct HexAccountAddress; - -impl SerializeAs for HexAccountAddress { - fn serialize_as(value: &AccountAddress, serializer: S) -> Result - where - S: Serializer, - { - Hex::serialize_as(value, serializer) - } -} - -impl<'de> DeserializeAs<'de, AccountAddress> for HexAccountAddress { - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - if s.starts_with("0x") { - AccountAddress::from_hex_literal(&s) - } else { - AccountAddress::from_hex(&s) - } - .map_err(to_custom_error::<'de, D, _>) - } -} - -/// Serializes a bitmap according to the roaring bitmap on-disk standard. -/// -pub struct IotaBitmap; - -pub struct IotaStructTag; - -impl SerializeAs for IotaStructTag { - fn serialize_as(value: &StructTag, serializer: S) -> Result - where - S: Serializer, - { - let f = to_iota_struct_tag_string(value).map_err(S::Error::custom)?; - f.serialize(serializer) - } -} - -const IOTA_ADDRESSES: [AccountAddress; 7] = [ - AccountAddress::ZERO, - AccountAddress::ONE, - IOTA_FRAMEWORK_ADDRESS, - IOTA_SYSTEM_ADDRESS, - STARDUST_ADDRESS, - IOTA_SYSTEM_STATE_ADDRESS, - IOTA_CLOCK_ADDRESS, -]; -/// Serialize StructTag as a string, retaining the leading zeros in the address. -pub fn to_iota_struct_tag_string(value: &StructTag) -> Result { - let mut f = String::new(); - // trim leading zeros if address is in IOTA_ADDRESSES - let address = if IOTA_ADDRESSES.contains(&value.address) { - value.address.short_str_lossless() - } else { - value.address.to_canonical_string(/* with_prefix */ false) - }; - - write!(f, "0x{}::{}::{}", address, value.module, value.name)?; - if let Some(first_ty) = value.type_params.first() { - write!(f, "<")?; - write!(f, "{}", to_iota_type_tag_string(first_ty)?)?; - for ty in value.type_params.iter().skip(1) { - write!(f, ", {}", to_iota_type_tag_string(ty)?)?; - } - write!(f, ">")?; - } - Ok(f) -} - -fn to_iota_type_tag_string(value: &TypeTag) -> Result { - match value { - TypeTag::Vector(t) => Ok(format!("vector<{}>", to_iota_type_tag_string(t)?)), - TypeTag::Struct(s) => to_iota_struct_tag_string(s), - _ => Ok(value.to_string()), - } -} - -impl<'de> DeserializeAs<'de, StructTag> for IotaStructTag { - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - parse_iota_struct_tag(&s).map_err(D::Error::custom) - } -} - -pub struct IotaTypeTag; - -impl SerializeAs for IotaTypeTag { - fn serialize_as(value: &TypeTag, serializer: S) -> Result - where - S: Serializer, - { - let s = to_iota_type_tag_string(value).map_err(S::Error::custom)?; - s.serialize(serializer) - } -} - -impl<'de> DeserializeAs<'de, TypeTag> for IotaTypeTag { - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - parse_iota_type_tag(&s).map_err(D::Error::custom) - } -} - - -#[serde_as] -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Copy, JsonSchema)] -pub struct BigInt( - #[schemars(with = "String")] - #[serde_as(as = "DisplayFromStr")] - T, -) -where - T: Display + FromStr, - ::Err: Display; - -impl BigInt - where - T: Display + FromStr, - ::Err: Display, -{ - pub fn into_inner(self) -> T { - self.0 - } -} - -impl SerializeAs for BigInt - where - T: Display + FromStr + Copy, - ::Err: Display, -{ - fn serialize_as(value: &T, serializer: S) -> Result - where - S: Serializer, - { - BigInt(*value).serialize(serializer) - } -} - -impl<'de, T> DeserializeAs<'de, T> for BigInt - where - T: Display + FromStr + Copy, - ::Err: Display, -{ - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - Ok(*BigInt::deserialize(deserializer)?) - } -} - -impl From for BigInt - where - T: Display + FromStr, - ::Err: Display, -{ - fn from(v: T) -> BigInt { - BigInt(v) - } -} - -impl Deref for BigInt - where - T: Display + FromStr, - ::Err: Display, -{ - type Target = T; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl Display for BigInt - where - T: Display + FromStr, - ::Err: Display, -{ - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "{}", self.0) - } -} - -#[serde_as] -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Copy, JsonSchema)] -pub struct SequenceNumber(#[schemars(with = "BigInt")] u64); - -impl SerializeAs for SequenceNumber { - fn serialize_as( - value: &super::base_types::SequenceNumber, - serializer: S, - ) -> Result - where - S: Serializer, - { - let s = value.value().to_string(); - s.serialize(serializer) - } -} - -impl<'de> DeserializeAs<'de, super::base_types::SequenceNumber> for SequenceNumber { - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let b = BigInt::deserialize(deserializer)?; - Ok(super::base_types::SequenceNumber::from_u64(*b)) - } -} - -#[serde_as] -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Copy)] -#[serde(rename = "ProtocolVersion")] -pub struct AsProtocolVersion(u64); - -impl SerializeAs for AsProtocolVersion { - fn serialize_as(value: &ProtocolVersion, serializer: S) -> Result - where - S: Serializer, - { - let s = value.as_u64().to_string(); - s.serialize(serializer) - } -} - -impl<'de> DeserializeAs<'de, ProtocolVersion> for AsProtocolVersion { - fn deserialize_as(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let b = BigInt::::deserialize(deserializer)?; - Ok(ProtocolVersion::from(*b)) - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/iota_types_lib.rs b/identity_iota_interaction/src/sdk_types/iota_types/iota_types_lib.rs deleted file mode 100644 index a9501dade1..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/iota_types_lib.rs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[allow(unused)] // Kept in sync with original source, so keep as is. -use serde::{Deserialize, Serialize}; -use super::super::move_core_types::{ - account_address::AccountAddress, - language_storage::{TypeTag, StructTag}, -}; -use super::base_types::{ObjectID, SequenceNumber, IotaAddress}; -use super::object::OBJECT_START_VERSION; - -macro_rules! built_in_ids { - ($($addr:ident / $id:ident = $init:expr);* $(;)?) => { - $( - pub const $addr: AccountAddress = builtin_address($init); - pub const $id: ObjectID = ObjectID::from_address($addr); - )* - } -} - -macro_rules! built_in_pkgs { - ($($addr:ident / $id:ident = $init:expr);* $(;)?) => { - built_in_ids! { $($addr / $id = $init;)* } - pub const SYSTEM_PACKAGE_ADDRESSES: &[AccountAddress] = &[$($addr),*]; - pub fn is_system_package(addr: impl Into) -> bool { - matches!(addr.into(), $($addr)|*) - } - } -} - -built_in_pkgs! { - MOVE_STDLIB_ADDRESS / MOVE_STDLIB_PACKAGE_ID = 0x1; - IOTA_FRAMEWORK_ADDRESS / IOTA_FRAMEWORK_PACKAGE_ID = 0x2; - IOTA_SYSTEM_ADDRESS / IOTA_SYSTEM_PACKAGE_ID = 0x3; - BRIDGE_ADDRESS / BRIDGE_PACKAGE_ID = 0xb; - STARDUST_ADDRESS / STARDUST_PACKAGE_ID = 0x107a; -} - -built_in_ids! { - IOTA_SYSTEM_STATE_ADDRESS / IOTA_SYSTEM_STATE_OBJECT_ID = 0x5; - IOTA_CLOCK_ADDRESS / IOTA_CLOCK_OBJECT_ID = 0x6; - IOTA_AUTHENTICATOR_STATE_ADDRESS / IOTA_AUTHENTICATOR_STATE_OBJECT_ID = 0x7; - IOTA_RANDOMNESS_STATE_ADDRESS / IOTA_RANDOMNESS_STATE_OBJECT_ID = 0x8; - IOTA_BRIDGE_ADDRESS / IOTA_BRIDGE_OBJECT_ID = 0x9; - IOTA_DENY_LIST_ADDRESS / IOTA_DENY_LIST_OBJECT_ID = 0x403; -} - -pub const IOTA_SYSTEM_STATE_OBJECT_SHARED_VERSION: SequenceNumber = OBJECT_START_VERSION; -pub const IOTA_CLOCK_OBJECT_SHARED_VERSION: SequenceNumber = OBJECT_START_VERSION; -pub const IOTA_AUTHENTICATOR_STATE_OBJECT_SHARED_VERSION: SequenceNumber = OBJECT_START_VERSION; - -const fn builtin_address(suffix: u16) -> AccountAddress { - let mut addr = [0u8; AccountAddress::LENGTH]; - let [hi, lo] = suffix.to_be_bytes(); - addr[AccountAddress::LENGTH - 2] = hi; - addr[AccountAddress::LENGTH - 1] = lo; - AccountAddress::new(addr) -} - -/// Parse `s` as a struct type: A fully-qualified name, optionally followed by a -/// list of type parameters (types -- see `parse_iota_type_tag`, separated by -/// commas, surrounded by angle brackets). Parsing succeeds if and only if `s` -/// matches this format exactly, with no remaining input. This function is -/// intended for use within the authority codebase. -pub fn parse_iota_struct_tag(s: &str) -> anyhow::Result { - use super::super::move_core_types::parsing::types::ParsedStructType; - ParsedStructType::parse(s)?.into_struct_tag(&resolve_address) -} - -/// Parse `s` as a type: Either a struct type (see `parse_iota_struct_tag`), a -/// primitive type, or a vector with a type parameter. Parsing succeeds if and -/// only if `s` matches this format exactly, with no remaining input. This -/// function is intended for use within the authority codebase. -pub fn parse_iota_type_tag(s: &str) -> anyhow::Result { - use super::super::move_core_types::parsing::types::ParsedType; - ParsedType::parse(s)?.into_type_tag(&resolve_address) -} - -/// Resolve well-known named addresses into numeric addresses. -pub fn resolve_address(addr: &str) -> Option { - match addr { - "std" => Some(MOVE_STDLIB_ADDRESS), - "iota" => Some(IOTA_FRAMEWORK_ADDRESS), - "iota_system" => Some(IOTA_SYSTEM_ADDRESS), - "stardust" => Some(STARDUST_ADDRESS), - "bridge" => Some(BRIDGE_ADDRESS), - _ => None, - } -} - -pub trait MoveTypeTagTrait { - fn get_type_tag() -> TypeTag; -} - -impl MoveTypeTagTrait for u8 { - fn get_type_tag() -> TypeTag { - TypeTag::U8 - } -} - -impl MoveTypeTagTrait for u64 { - fn get_type_tag() -> TypeTag { - TypeTag::U64 - } -} - -impl MoveTypeTagTrait for ObjectID { - fn get_type_tag() -> TypeTag { - TypeTag::Address - } -} - -impl MoveTypeTagTrait for IotaAddress { - fn get_type_tag() -> TypeTag { - TypeTag::Address - } -} - -impl MoveTypeTagTrait for Vec { - fn get_type_tag() -> TypeTag { - TypeTag::Vector(Box::new(T::get_type_tag())) - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/mod.rs b/identity_iota_interaction/src/sdk_types/iota_types/mod.rs deleted file mode 100644 index 8f75e8f724..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/mod.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub mod balance; -pub mod base_types; -pub mod coin; -pub mod collection_types; -pub mod crypto; -pub mod digests; -pub mod dynamic_field; -pub mod error; -pub mod event; -pub mod execution_status; -pub mod gas_coin; -pub mod governance; -pub mod id; -pub mod iota_serde; -pub mod iota_types_lib; -pub mod move_package; -pub mod object; -pub mod quorum_driver_types; -pub mod stardust; -pub mod timelock; -pub mod transaction; -pub mod gas; -pub mod storage; - -pub use iota_types_lib::*; -pub use super::move_core_types::{identifier::Identifier, language_storage::TypeTag}; \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/move_package.rs b/identity_iota_interaction/src/sdk_types/iota_types/move_package.rs deleted file mode 100644 index e7f63eb303..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/move_package.rs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::BTreeMap; - -use serde::Deserialize; -use serde::Serialize; -use serde_with::{serde_as, Bytes}; - -use super::base_types::{ObjectID, SequenceNumber}; - -/// Identifies a struct and the module it was defined in -#[derive( -Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Deserialize, Serialize, Hash)] -pub struct TypeOrigin { - pub module_name: String, - // `struct_name` alias to support backwards compatibility with the old name - #[serde(alias = "struct_name")] - pub datatype_name: String, - pub package: ObjectID, -} - -/// Upgraded package info for the linkage table -#[derive(Eq, PartialEq, Debug, Clone, Deserialize, Serialize, Hash)] -pub struct UpgradeInfo { - /// ID of the upgraded packages - pub upgraded_id: ObjectID, - /// Version of the upgraded package - pub upgraded_version: SequenceNumber, -} - -// serde_bytes::ByteBuf is an analog of Vec with built-in fast -// serialization. -#[serde_as] -#[derive(Eq, PartialEq, Debug, Clone, Deserialize, Serialize, Hash)] -pub struct MovePackage { - pub(crate) id: ObjectID, - /// Most move packages are uniquely identified by their ID (i.e. there is - /// only one version per ID), but the version is still stored because - /// one package may be an upgrade of another (at a different ID), in - /// which case its version will be one greater than the version of the - /// upgraded package. - /// - /// Framework packages are an exception to this rule -- all versions of the - /// framework packages exist at the same ID, at increasing versions. - /// - /// In all cases, packages are referred to by move calls using just their - /// ID, and they are always loaded at their latest version. - pub(crate) version: SequenceNumber, - // TODO use session cache - #[serde_as(as = "BTreeMap<_, Bytes>")] - pub(crate) module_map: BTreeMap>, - - /// Maps struct/module to a package version where it was first defined, - /// stored as a vector for simple serialization and deserialization. - pub(crate) type_origin_table: Vec, - - // For each dependency, maps original package ID to the info about the (upgraded) dependency - // version that this package is using - pub(crate) linkage_table: BTreeMap, -} - -impl MovePackage { - pub fn id(&self) -> ObjectID { - self.id - } - - pub fn version(&self) -> SequenceNumber { - self.version - } - - pub fn serialized_module_map(&self) -> &BTreeMap> { - &self.module_map - } - - pub fn type_origin_table(&self) -> &Vec { - &self.type_origin_table - } - - pub fn linkage_table(&self) -> &BTreeMap { - &self.linkage_table - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/object.rs b/identity_iota_interaction/src/sdk_types/iota_types/object.rs deleted file mode 100644 index 1c9c7930cb..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/object.rs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::fmt::{Display, Formatter}; - -use schemars::JsonSchema; -use serde::Deserialize; -use serde::Serialize; - -use super::base_types::{IotaAddress, SequenceNumber, ObjectID}; -use super::error::{IotaResult, IotaError}; - -pub const OBJECT_START_VERSION: SequenceNumber = SequenceNumber::from_u64(1); - -#[derive( -Eq, PartialEq, Debug, Clone, Copy, Deserialize, Serialize, Hash, Ord, PartialOrd, JsonSchema)] -pub enum Owner { - /// Object is exclusively owned by a single address, and is mutable. - AddressOwner(IotaAddress), - /// Object is exclusively owned by a single object, and is mutable. - /// The object ID is converted to IotaAddress as IotaAddress is universal. - ObjectOwner(IotaAddress), - /// Object is shared, can be used by any address, and is mutable. - Shared { - /// The version at which the object became shared - initial_shared_version: SequenceNumber, - }, - /// Object is immutable, and hence ownership doesn't matter. - Immutable, -} - -impl Owner { - // NOTE: only return address of AddressOwner, otherwise return error, - // ObjectOwner's address is converted from object id, thus we will skip it. - pub fn get_address_owner_address(&self) -> IotaResult { - match self { - Self::AddressOwner(address) => Ok(*address), - Self::Shared { .. } | Self::Immutable | Self::ObjectOwner(_) => { - Err(IotaError::UnexpectedOwnerType) - } - } - } - - // NOTE: this function will return address of both AddressOwner and ObjectOwner, - // address of ObjectOwner is converted from object id, even though the type is - // IotaAddress. - pub fn get_owner_address(&self) -> IotaResult { - match self { - Self::AddressOwner(address) | Self::ObjectOwner(address) => Ok(*address), - Self::Shared { .. } | Self::Immutable => Err(IotaError::UnexpectedOwnerType), - } - } - - pub fn is_immutable(&self) -> bool { - matches!(self, Owner::Immutable) - } - - pub fn is_address_owned(&self) -> bool { - matches!(self, Owner::AddressOwner(_)) - } - - pub fn is_child_object(&self) -> bool { - matches!(self, Owner::ObjectOwner(_)) - } - - pub fn is_shared(&self) -> bool { - matches!(self, Owner::Shared { .. }) - } -} - -impl PartialEq for Owner { - fn eq(&self, other: &IotaAddress) -> bool { - match self { - Self::AddressOwner(address) => address == other, - Self::ObjectOwner(_) | Self::Shared { .. } | Self::Immutable => false, - } - } -} - -impl PartialEq for Owner { - fn eq(&self, other: &ObjectID) -> bool { - let other_id: IotaAddress = (*other).into(); - match self { - Self::ObjectOwner(id) => id == &other_id, - Self::AddressOwner(_) | Self::Shared { .. } | Self::Immutable => false, - } - } -} - -impl Display for Owner { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Self::AddressOwner(address) => { - write!(f, "Account Address ( {} )", address) - } - Self::ObjectOwner(address) => { - write!(f, "Object ID: ( {} )", address) - } - Self::Immutable => { - write!(f, "Immutable") - } - Self::Shared { - initial_shared_version, - } => { - write!(f, "Shared( {} )", initial_shared_version.value()) - } - } - } -} diff --git a/identity_iota_interaction/src/sdk_types/iota_types/quorum_driver_types.rs b/identity_iota_interaction/src/sdk_types/iota_types/quorum_driver_types.rs deleted file mode 100644 index 3eb37fcbbe..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/quorum_driver_types.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2021, Facebook, Inc. and its affiliates -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::{Serialize, Deserialize}; - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub enum ExecuteTransactionRequestType { - WaitForEffectsCert, - WaitForLocalExecution, -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/stardust/mod.rs b/identity_iota_interaction/src/sdk_types/iota_types/stardust/mod.rs deleted file mode 100644 index f6606f3f82..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/stardust/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub mod output; diff --git a/identity_iota_interaction/src/sdk_types/iota_types/stardust/output/mod.rs b/identity_iota_interaction/src/sdk_types/iota_types/stardust/output/mod.rs deleted file mode 100644 index 28d547dcf2..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/stardust/output/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub mod nft; - -pub use nft::*; \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/stardust/output/nft.rs b/identity_iota_interaction/src/sdk_types/iota_types/stardust/output/nft.rs deleted file mode 100644 index b53b83d546..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/stardust/output/nft.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::ident_str; - -use crate::sdk_types::move_types::language_storage::StructTag; -use crate::sdk_types::move_types::identifier::IdentStr; - -use super::super::super::STARDUST_ADDRESS; - -pub const IRC27_MODULE_NAME: &IdentStr = ident_str!("irc27"); -pub const NFT_MODULE_NAME: &IdentStr = ident_str!("nft"); -pub const NFT_OUTPUT_MODULE_NAME: &IdentStr = ident_str!("nft_output"); -pub const NFT_OUTPUT_STRUCT_NAME: &IdentStr = ident_str!("NftOutput"); -pub const NFT_STRUCT_NAME: &IdentStr = ident_str!("Nft"); -pub const IRC27_STRUCT_NAME: &IdentStr = ident_str!("Irc27Metadata"); -pub const NFT_DYNAMIC_OBJECT_FIELD_KEY: &[u8] = b"nft"; -pub const NFT_DYNAMIC_OBJECT_FIELD_KEY_TYPE: &str = "vector"; - -pub struct Nft {} - -impl Nft { - /// Returns the struct tag that represents the fully qualified path of an - /// [`Nft`] in its move package. - pub fn tag() -> StructTag { - StructTag { - address: STARDUST_ADDRESS.into(), - module: NFT_MODULE_NAME.to_owned(), - name: NFT_STRUCT_NAME.to_owned(), - type_params: Vec::new(), - } - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/storage.rs b/identity_iota_interaction/src/sdk_types/iota_types/storage.rs deleted file mode 100644 index 2d6ca38ea3..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/storage.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::{Deserialize, Serialize}; - -#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)] -pub enum WriteKind { - /// The object was in storage already but has been modified - Mutate, - /// The object was created in this transaction - Create, - /// The object was previously wrapped in another object, but has been - /// restored to storage - Unwrap, -} - -#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)] -pub enum DeleteKind { - /// An object is provided in the call input, and gets deleted. - Normal, - /// An object is not provided in the call input, but gets unwrapped - /// from another object, and then gets deleted. - UnwrapThenDelete, - /// An object is provided in the call input, and gets wrapped into another - /// object. - Wrap, -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/timelock/mod.rs b/identity_iota_interaction/src/sdk_types/iota_types/timelock/mod.rs deleted file mode 100644 index 9e825bb774..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/timelock/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub mod timelock; -pub mod timelocked_staked_iota; \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/timelock/timelock.rs b/identity_iota_interaction/src/sdk_types/iota_types/timelock/timelock.rs deleted file mode 100644 index 65772e9e91..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/timelock/timelock.rs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::Deserialize; -use serde::Serialize; - -use crate::ident_str; - -#[allow(unused)] // Kept in sync with original source, so keep as is. -use crate::sdk_types::move_types::{ - language_storage::{TypeTag, StructTag}, - identifier::{IdentStr}, -}; - -#[allow(unused)] // Kept in sync with original source, so keep as is. -use super::super::{ - IOTA_FRAMEWORK_ADDRESS, - IOTA_SYSTEM_ADDRESS, - base_types::{ObjectID, EpochId}, - balance::Balance, - governance::StakedIota, - id::UID, - error::IotaError, -}; - -#[allow(unused)] // Kept in sync with original source, so keep as is. -use super::timelocked_staked_iota::{TIMELOCKED_STAKED_IOTA_MODULE_NAME, TIMELOCKED_STAKED_IOTA_STRUCT_NAME}; - -pub const TIMELOCK_MODULE_NAME: &IdentStr = ident_str!("timelock"); -pub const TIMELOCK_STRUCT_NAME: &IdentStr = ident_str!("TimeLock"); - -/// Rust version of the Move stardust::TimeLock type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct TimeLock { - id: UID, - /// The locked object. - locked: T, - /// This is the epoch time stamp of when the lock expires. - expiration_timestamp_ms: u64, - /// Timelock related label. - label: Option, -} - -impl TimeLock { - /// Constructor. - pub fn new(id: UID, locked: T, expiration_timestamp_ms: u64, label: Option) -> Self { - Self { - id, - locked, - expiration_timestamp_ms, - label, - } - } - - /// Get the TimeLock's `type`. - pub fn type_(type_param: TypeTag) -> StructTag { - StructTag { - address: IOTA_FRAMEWORK_ADDRESS, - module: TIMELOCK_MODULE_NAME.to_owned(), - name: TIMELOCK_STRUCT_NAME.to_owned(), - type_params: vec![type_param], - } - } - - /// Get the TimeLock's `id`. - pub fn id(&self) -> &ObjectID { - self.id.object_id() - } - - /// Get the TimeLock's `locked` object. - pub fn locked(&self) -> &T { - &self.locked - } - - /// Get the TimeLock's `expiration_timestamp_ms`. - pub fn expiration_timestamp_ms(&self) -> u64 { - self.expiration_timestamp_ms - } - - /// Get the TimeLock's `label``. - pub fn label(&self) -> &Option { - &self.label - } -} - -impl<'de, T> TimeLock - where - T: Serialize + Deserialize<'de>, -{ - /// Create a `TimeLock` from BCS bytes. - pub fn from_bcs_bytes(content: &'de [u8]) -> Result { - bcs::from_bytes(content).map_err(|err| IotaError::ObjectDeserialization { - error: format!("Unable to deserialize TimeLock object: {:?}", err), - }) - } - - /// Serialize a `TimeLock` as a `Vec` of BCS. - pub fn to_bcs_bytes(&self) -> Vec { - bcs::to_bytes(&self).unwrap() - } -} - -/// Is this other StructTag representing a TimeLock? -pub fn is_timelock(other: &StructTag) -> bool { - other.address == IOTA_FRAMEWORK_ADDRESS - && other.module.as_ident_str() == TIMELOCK_MODULE_NAME - && other.name.as_ident_str() == TIMELOCK_STRUCT_NAME -} - -/// Is this other StructTag representing a `TimeLock>`? -pub fn is_timelocked_balance(other: &StructTag) -> bool { - if !is_timelock(other) { - return false; - } - - if other.type_params.len() != 1 { - return false; - } - - match &other.type_params[0] { - TypeTag::Struct(tag) => Balance::is_balance(tag), - _ => false, - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/timelock/timelocked_staked_iota.rs b/identity_iota_interaction/src/sdk_types/iota_types/timelock/timelocked_staked_iota.rs deleted file mode 100644 index 2c052b9f6b..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/timelock/timelocked_staked_iota.rs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use serde::{Deserialize, Serialize}; -use crate::ident_str; -use crate::sdk_types::move_types::identifier::IdentStr; -use crate::sdk_types::move_types::language_storage::StructTag; -use super::super::{ - IOTA_SYSTEM_ADDRESS, - base_types::{ObjectID, EpochId}, - governance::StakedIota, - id::UID, -}; - -pub const TIMELOCKED_STAKED_IOTA_MODULE_NAME: &IdentStr = ident_str!("timelocked_staking"); -pub const TIMELOCKED_STAKED_IOTA_STRUCT_NAME: &IdentStr = ident_str!("TimelockedStakedIota"); - -/// Rust version of the Move -/// stardust::timelocked_staked_iota::TimelockedStakedIota type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct TimelockedStakedIota { - id: UID, - /// A self-custodial object holding the staked IOTA tokens. - staked_iota: StakedIota, - /// This is the epoch time stamp of when the lock expires. - expiration_timestamp_ms: u64, - /// Timelock related label. - label: Option, -} - -impl TimelockedStakedIota { - /// Get the TimeLock's `type`. - pub fn type_() -> StructTag { - StructTag { - address: IOTA_SYSTEM_ADDRESS, - module: TIMELOCKED_STAKED_IOTA_MODULE_NAME.to_owned(), - name: TIMELOCKED_STAKED_IOTA_STRUCT_NAME.to_owned(), - type_params: vec![], - } - } - - /// Is this other StructTag representing a TimelockedStakedIota? - pub fn is_timelocked_staked_iota(s: &StructTag) -> bool { - s.address == IOTA_SYSTEM_ADDRESS - && s.module.as_ident_str() == TIMELOCKED_STAKED_IOTA_MODULE_NAME - && s.name.as_ident_str() == TIMELOCKED_STAKED_IOTA_STRUCT_NAME - && s.type_params.is_empty() - } - - /// Get the TimelockedStakedIota's `id`. - pub fn id(&self) -> ObjectID { - self.id.id.bytes - } - - /// Get the wrapped StakedIota's `pool_id`. - pub fn pool_id(&self) -> ObjectID { - self.staked_iota.pool_id() - } - - /// Get the wrapped StakedIota's `activation_epoch`. - pub fn activation_epoch(&self) -> EpochId { - self.staked_iota.activation_epoch() - } - - /// Get the wrapped StakedIota's `request_epoch`. - pub fn request_epoch(&self) -> EpochId { - // TODO: this might change when we implement warm up period. - self.staked_iota.activation_epoch().saturating_sub(1) - } - - /// Get the wrapped StakedIota's `principal`. - pub fn principal(&self) -> u64 { - self.staked_iota.principal() - } - - /// Get the TimelockedStakedIota's `expiration_timestamp_ms`. - pub fn expiration_timestamp_ms(&self) -> u64 { - self.expiration_timestamp_ms - } - - /// Get the TimelockedStakedIota's `label``. - pub fn label(&self) -> &Option { - &self.label - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/iota_types/transaction.rs b/identity_iota_interaction/src/sdk_types/iota_types/transaction.rs deleted file mode 100644 index 379e4f1d33..0000000000 --- a/identity_iota_interaction/src/sdk_types/iota_types/transaction.rs +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) 2021, Facebook, Inc. and its affiliates -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::fmt::{Display, Formatter}; -use std::vec::Vec; - -use enum_dispatch::enum_dispatch; -use nonempty::NonEmpty; -use serde::{Deserialize, Serialize}; -use strum::IntoStaticStr; - - -use super::super::move_core_types::identifier::Identifier; -use super::super::move_core_types::language_storage::TypeTag; - -use super::base_types::{EpochId, IotaAddress, ObjectID, ObjectRef, SequenceNumber}; -use super::error::UserInputError; -use super::{ - IOTA_AUTHENTICATOR_STATE_OBJECT_ID, IOTA_AUTHENTICATOR_STATE_OBJECT_SHARED_VERSION, IOTA_CLOCK_OBJECT_ID, IOTA_CLOCK_OBJECT_SHARED_VERSION, IOTA_SYSTEM_STATE_OBJECT_ID, IOTA_SYSTEM_STATE_OBJECT_SHARED_VERSION -}; - -pub const TEST_ONLY_GAS_UNIT_FOR_TRANSFER: u64 = 10_000; -pub const TEST_ONLY_GAS_UNIT_FOR_OBJECT_BASICS: u64 = 50_000; -pub const TEST_ONLY_GAS_UNIT_FOR_PUBLISH: u64 = 50_000; -pub const TEST_ONLY_GAS_UNIT_FOR_STAKING: u64 = 50_000; -pub const TEST_ONLY_GAS_UNIT_FOR_GENERIC: u64 = 50_000; -pub const TEST_ONLY_GAS_UNIT_FOR_SPLIT_COIN: u64 = 10_000; -// For some transactions we may either perform heavy operations or touch -// objects that are storage expensive. That may happen (and often is the case) -// because the object touched are set up in genesis and carry no storage cost -// (and thus rebate) on first usage. -pub const TEST_ONLY_GAS_UNIT_FOR_HEAVY_COMPUTATION_STORAGE: u64 = 5_000_000; - -pub const GAS_PRICE_FOR_SYSTEM_TX: u64 = 1; - -pub const DEFAULT_VALIDATOR_GAS_PRICE: u64 = 1000; - -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] -pub enum CallArg { - // contains no structs or objects - Pure(Vec), - // an object - Object(ObjectArg), -} - -impl CallArg { - pub const IOTA_SYSTEM_MUT: Self = Self::Object(ObjectArg::IOTA_SYSTEM_MUT); - pub const CLOCK_IMM: Self = Self::Object(ObjectArg::SharedObject { - id: IOTA_CLOCK_OBJECT_ID, - initial_shared_version: IOTA_CLOCK_OBJECT_SHARED_VERSION, - mutable: false, - }); - pub const CLOCK_MUT: Self = Self::Object(ObjectArg::SharedObject { - id: IOTA_CLOCK_OBJECT_ID, - initial_shared_version: IOTA_CLOCK_OBJECT_SHARED_VERSION, - mutable: true, - }); - pub const AUTHENTICATOR_MUT: Self = Self::Object(ObjectArg::SharedObject { - id: IOTA_AUTHENTICATOR_STATE_OBJECT_ID, - initial_shared_version: IOTA_AUTHENTICATOR_STATE_OBJECT_SHARED_VERSION, - mutable: true, - }); -} - -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)] -pub enum ObjectArg { - // A Move object, either immutable, or owned mutable. - ImmOrOwnedObject(ObjectRef), - // A Move object that's shared. - // SharedObject::mutable controls whether caller asks for a mutable reference to shared - // object. - SharedObject { - id: ObjectID, - initial_shared_version: SequenceNumber, - mutable: bool, - }, - // A Move object that can be received in this transaction. - Receiving(ObjectRef), -} - -impl ObjectArg { - pub const IOTA_SYSTEM_MUT: Self = Self::SharedObject { - id: IOTA_SYSTEM_STATE_OBJECT_ID, - initial_shared_version: IOTA_SYSTEM_STATE_OBJECT_SHARED_VERSION, - mutable: true, - }; -} - -/// A series of commands where the results of one command can be used in future -/// commands -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] -pub struct ProgrammableTransaction { - /// Input objects or primitive values - pub inputs: Vec, - /// The commands to be executed sequentially. A failure in any command will - /// result in the failure of the entire transaction. - pub commands: Vec, -} - -/// A single command in a programmable transaction. -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] -pub enum Command { - /// A call to either an entry or a public Move function - MoveCall(Box), - /// `(Vec, address)` - /// It sends n-objects to the specified address. These objects must have - /// store (public transfer) and either the previous owner must be an - /// address or the object must be newly created. - TransferObjects(Vec, Argument), - /// `(&mut Coin, Vec)` -> `Vec>` - /// It splits off some amounts into a new coins with those amounts - SplitCoins(Argument, Vec), - /// `(&mut Coin, Vec>)` - /// It merges n-coins into the first coin - MergeCoins(Argument, Vec), - /// Publishes a Move package. It takes the package bytes and a list of the - /// package's transitive dependencies to link against on-chain. - Publish(Vec>, Vec), - /// `forall T: Vec -> vector` - /// Given n-values of the same type, it constructs a vector. For non objects - /// or an empty vector, the type tag must be specified. - MakeMoveVec(Option, Vec), - /// Upgrades a Move package - /// Takes (in order): - /// 1. A vector of serialized modules for the package. - /// 2. A vector of object ids for the transitive dependencies of the new - /// package. - /// 3. The object ID of the package being upgraded. - /// 4. An argument holding the `UpgradeTicket` that must have been produced - /// from an earlier command in the same programmable transaction. - Upgrade(Vec>, Vec, ObjectID, Argument), -} - -/// An argument to a programmable transaction command -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)] -pub enum Argument { - /// The gas coin. The gas coin can only be used by-ref, except for with - /// `TransferObjects`, which can use it by-value. - GasCoin, - /// One of the input objects or primitive values (from - /// `ProgrammableTransaction` inputs) - Input(u16), - /// The result of another command (from `ProgrammableTransaction` commands) - Result(u16), - /// Like a `Result` but it accesses a nested result. Currently, the only - /// usage of this is to access a value from a Move call with multiple - /// return values. - NestedResult(u16, u16), -} - -/// The command for calling a Move function, either an entry function or a -/// public function (which cannot return references). -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] -pub struct ProgrammableMoveCall { - /// The package containing the module and function. - pub package: ObjectID, - /// The specific module in the package containing the function. - pub module: Identifier, - /// The function to be called. - pub function: Identifier, - /// The type arguments to the function. - pub type_arguments: Vec, - /// The arguments to the function. - pub arguments: Vec, -} - -impl Display for Argument { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Argument::GasCoin => write!(f, "GasCoin"), - Argument::Input(i) => write!(f, "Input({i})"), - Argument::Result(i) => write!(f, "Result({i})"), - Argument::NestedResult(i, j) => write!(f, "NestedResult({i},{j})"), - } - } -} - -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize, IntoStaticStr)] -pub enum TransactionKind { - /// A transaction that allows the interleaving of native commands and Move - /// calls - ProgrammableTransaction(ProgrammableTransaction), -} - -#[derive(Debug, PartialEq, Eq)] -pub struct SharedInputObject { - pub id: ObjectID, - pub initial_shared_version: SequenceNumber, - pub mutable: bool, -} - -impl SharedInputObject { - pub const IOTA_SYSTEM_OBJ: Self = Self { - id: IOTA_SYSTEM_STATE_OBJECT_ID, - initial_shared_version: IOTA_SYSTEM_STATE_OBJECT_SHARED_VERSION, - mutable: true, - }; - - pub fn id(&self) -> ObjectID { - self.id - } - - pub fn into_id_and_version(self) -> (ObjectID, SequenceNumber) { - (self.id, self.initial_shared_version) - } -} - -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] -pub struct GasData { - pub payment: Vec, - pub owner: IotaAddress, - pub price: u64, - pub budget: u64, -} - -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)] -pub enum TransactionExpiration { - /// The transaction has no expiration - None, - /// Validators wont sign a transaction unless the expiration Epoch - /// is greater than or equal to the current epoch - Epoch(EpochId), -} - -#[enum_dispatch(TransactionDataAPI)] -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] -pub enum TransactionData { - V1(TransactionDataV1), - // When new variants are introduced, it is important that we check version support - // in the validity_check function based on the protocol config. -} - -#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] -pub struct TransactionDataV1 { - pub kind: TransactionKind, - pub sender: IotaAddress, - pub gas_data: GasData, - pub expiration: TransactionExpiration, -} - -impl TransactionData { - pub fn new( - kind: TransactionKind, - sender: IotaAddress, - gas_payment: ObjectRef, - gas_budget: u64, - gas_price: u64, - ) -> Self { - TransactionData::V1(TransactionDataV1 { - kind, - sender, - gas_data: GasData { - price: gas_price, - owner: sender, - payment: vec![gas_payment], - budget: gas_budget, - }, - expiration: TransactionExpiration::None, - }) - } - - pub fn new_with_gas_coins( - kind: TransactionKind, - sender: IotaAddress, - gas_payment: Vec, - gas_budget: u64, - gas_price: u64, - ) -> Self { - Self::new_with_gas_coins_allow_sponsor( - kind, - sender, - gas_payment, - gas_budget, - gas_price, - sender, - ) - } - - pub fn new_with_gas_coins_allow_sponsor( - kind: TransactionKind, - sender: IotaAddress, - gas_payment: Vec, - gas_budget: u64, - gas_price: u64, - gas_sponsor: IotaAddress, - ) -> Self { - TransactionData::V1(TransactionDataV1 { - kind, - sender, - gas_data: GasData { - price: gas_price, - owner: gas_sponsor, - payment: gas_payment, - budget: gas_budget, - }, - expiration: TransactionExpiration::None, - }) - } - - pub fn new_with_gas_data( - kind: TransactionKind, - sender: IotaAddress, - gas_data: GasData, - ) -> Self { - TransactionData::V1(TransactionDataV1 { - kind, - sender, - gas_data, - expiration: TransactionExpiration::None, - }) - } -} - -#[enum_dispatch] -pub trait TransactionDataAPI { - fn sender(&self) -> IotaAddress; - - // Note: this implies that SingleTransactionKind itself must be versioned, so - // that it can be shared across versions. This will be easy to do since it - // is already an enum. - fn kind(&self) -> &TransactionKind; - - // Used by programmable_transaction_builder - fn kind_mut(&mut self) -> &mut TransactionKind; - - // kind is moved out of often enough that this is worth it to special case. - fn into_kind(self) -> TransactionKind; - - /// Transaction signer and Gas owner - fn signers(&self) -> NonEmpty; - - fn gas_data(&self) -> &GasData; - - fn gas_data_mut(&mut self) -> &mut GasData; - - fn gas_owner(&self) -> IotaAddress; - - fn gas(&self) -> &[ObjectRef]; - - fn gas_price(&self) -> u64; - - fn gas_budget(&self) -> u64; - - fn expiration(&self) -> &TransactionExpiration; - -} - -impl TransactionDataAPI for TransactionDataV1 { - fn sender(&self) -> IotaAddress { - self.sender - } - - fn kind(&self) -> &TransactionKind { - &self.kind - } - - fn kind_mut(&mut self) -> &mut TransactionKind { - &mut self.kind - } - - fn into_kind(self) -> TransactionKind { - self.kind - } - - /// Transaction signer and Gas owner - fn signers(&self) -> NonEmpty { - let mut signers = NonEmpty::new(self.sender); - if self.gas_owner() != self.sender { - signers.push(self.gas_owner()); - } - signers - } - - fn gas_data(&self) -> &GasData { - &self.gas_data - } - - fn gas_owner(&self) -> IotaAddress { - self.gas_data.owner - } - - fn gas(&self) -> &[ObjectRef] { - &self.gas_data.payment - } - - fn gas_price(&self) -> u64 { - self.gas_data.price - } - - fn gas_budget(&self) -> u64 { - self.gas_data.budget - } - - fn expiration(&self) -> &TransactionExpiration { - &self.expiration - } - - fn gas_data_mut(&mut self) -> &mut GasData { - &mut self.gas_data - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, PartialOrd, Ord, Hash)] -pub enum InputObjectKind { - // A Move package, must be immutable. - MovePackage(ObjectID), - // A Move object, either immutable, or owned mutable. - ImmOrOwnedMoveObject(ObjectRef), - // A Move object that's shared and mutable. - SharedMoveObject { - id: ObjectID, - initial_shared_version: SequenceNumber, - mutable: bool, - }, -} - -impl InputObjectKind { - pub fn object_id(&self) -> ObjectID { - match self { - Self::MovePackage(id) => *id, - Self::ImmOrOwnedMoveObject((id, _, _)) => *id, - Self::SharedMoveObject { id, .. } => *id, - } - } - - pub fn version(&self) -> Option { - match self { - Self::MovePackage(..) => None, - Self::ImmOrOwnedMoveObject((_, version, _)) => Some(*version), - Self::SharedMoveObject { .. } => None, - } - } - - pub fn object_not_found_error(&self) -> UserInputError { - match *self { - Self::MovePackage(package_id) => { - UserInputError::DependentPackageNotFound { package_id } - } - Self::ImmOrOwnedMoveObject((object_id, version, _)) => UserInputError::ObjectNotFound { - object_id, - version: Some(version), - }, - Self::SharedMoveObject { id, .. } => UserInputError::ObjectNotFound { - object_id: id, - version: None, - }, - } - } - - pub fn is_shared_object(&self) -> bool { - matches!(self, Self::SharedMoveObject { .. }) - } - - pub fn is_mutable(&self) -> bool { - match self { - Self::MovePackage(..) => false, - Self::ImmOrOwnedMoveObject((_, _, _)) => true, - Self::SharedMoveObject { mutable, .. } => *mutable, - } - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/mod.rs b/identity_iota_interaction/src/sdk_types/mod.rs deleted file mode 100644 index 6d75bfa2de..0000000000 --- a/identity_iota_interaction/src/sdk_types/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[path = "iota_json_rpc_types/mod.rs"] -pub mod rpc_types; -#[path = "iota_types/mod.rs"] -pub mod types; -#[path = "move_core_types/mod.rs"] -pub mod move_types; - -pub mod shared_crypto; -pub mod error; -pub mod generated_types; - -pub(crate) use types as iota_types; -pub(crate) use move_types as move_core_types; -pub(crate) use rpc_types as iota_json_rpc_types; \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/account_address.rs b/identity_iota_interaction/src/sdk_types/move_core_types/account_address.rs deleted file mode 100644 index d52b191954..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/account_address.rs +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{convert::TryFrom, fmt, str::FromStr}; - -use hex::FromHex; -use rand::{rngs::OsRng, Rng}; -use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; - -/// A struct that represents an account address. -#[derive(Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Copy)] -pub struct AccountAddress([u8; AccountAddress::LENGTH]); - -impl AccountAddress { - pub const fn new(address: [u8; Self::LENGTH]) -> Self { - Self(address) - } - - /// The number of bytes in an address. - pub const LENGTH: usize = 32; - - /// Hex address: 0x0 - pub const ZERO: Self = Self([0u8; Self::LENGTH]); - - /// Hex address: 0x1 - pub const ONE: Self = Self::get_hex_address_one(); - - /// Hex address: 0x2 - pub const TWO: Self = Self::get_hex_address_two(); - - pub const fn from_suffix(suffix: u16) -> AccountAddress { - let mut addr = [0u8; AccountAddress::LENGTH]; - let [hi, lo] = suffix.to_be_bytes(); - addr[AccountAddress::LENGTH - 2] = hi; - addr[AccountAddress::LENGTH - 1] = lo; - AccountAddress::new(addr) - } - - const fn get_hex_address_one() -> Self { - let mut addr = [0u8; AccountAddress::LENGTH]; - addr[AccountAddress::LENGTH - 1] = 1u8; - Self(addr) - } - - const fn get_hex_address_two() -> Self { - let mut addr = [0u8; AccountAddress::LENGTH]; - addr[AccountAddress::LENGTH - 1] = 2u8; - Self(addr) - } - - pub fn random() -> Self { - let mut rng = OsRng; - let buf: [u8; Self::LENGTH] = rng.gen(); - Self(buf) - } - - /// Return a canonical string representation of the address - /// Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, - /// 20, or 32 depending on the Move platform) - /// e.g., 0000000000000000000000000000000a, *not* - /// 0x0000000000000000000000000000000a, 0xa, or 0xA Note: this function - /// is guaranteed to be stable, and this is suitable for use inside Move - /// native functions or the VM. However, one can pass with_prefix=true - /// to get its representation with the 0x prefix. - pub fn to_canonical_string(&self, with_prefix: bool) -> String { - self.to_canonical_display(with_prefix).to_string() - } - - /// Implements Display for the address, with the prefix 0x if with_prefix is - /// true. - pub fn to_canonical_display(&self, with_prefix: bool) -> impl fmt::Display + '_ { - struct HexDisplay<'a> { - data: &'a [u8], - with_prefix: bool, - } - - impl<'a> fmt::Display for HexDisplay<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if self.with_prefix { - write!(f, "0x{}", hex::encode(self.data)) - } else { - write!(f, "{}", hex::encode(self.data)) - } - } - } - HexDisplay { - data: &self.0, - with_prefix, - } - } - - pub fn short_str_lossless(&self) -> String { - let hex_str = hex::encode(self.0).trim_start_matches('0').to_string(); - if hex_str.is_empty() { - "0".to_string() - } else { - hex_str - } - } - - pub fn to_vec(&self) -> Vec { - self.0.to_vec() - } - - pub fn into_bytes(self) -> [u8; Self::LENGTH] { - self.0 - } - - pub fn from_hex_literal(literal: &str) -> Result { - if !literal.starts_with("0x") { - return Err(AccountAddressParseError); - } - - let hex_len = literal.len() - 2; - - // If the string is too short, pad it - if hex_len < Self::LENGTH * 2 { - let mut hex_str = String::with_capacity(Self::LENGTH * 2); - for _ in 0..Self::LENGTH * 2 - hex_len { - hex_str.push('0'); - } - hex_str.push_str(&literal[2..]); - AccountAddress::from_hex(hex_str) - } else { - AccountAddress::from_hex(&literal[2..]) - } - } - - pub fn to_hex_literal(&self) -> String { - format!("0x{}", self.short_str_lossless()) - } - - pub fn from_hex>(hex: T) -> Result { - <[u8; Self::LENGTH]>::from_hex(hex) - .map_err(|_| AccountAddressParseError) - .map(Self) - } - - pub fn to_hex(&self) -> String { - format!("{:x}", self) - } - - pub fn from_bytes>(bytes: T) -> Result { - <[u8; Self::LENGTH]>::try_from(bytes.as_ref()) - .map_err(|_| AccountAddressParseError) - .map(Self) - } - - // AbstractMemorySize is not available for wasm32 - // - // /// TODO (ade): use macro to enfornce determinism - // pub fn abstract_size_for_gas_metering(&self) -> AbstractMemorySize { - // AbstractMemorySize::new(Self::LENGTH as u64) - // } -} - -impl AsRef<[u8]> for AccountAddress { - fn as_ref(&self) -> &[u8] { - &self.0 - } -} - -impl std::ops::Deref for AccountAddress { - type Target = [u8; Self::LENGTH]; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl fmt::Display for AccountAddress { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - write!(f, "{:x}", self) - } -} - -impl fmt::Debug for AccountAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:x}", self) - } -} - -impl fmt::LowerHex for AccountAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if f.alternate() { - write!(f, "0x")?; - } - - for byte in &self.0 { - write!(f, "{:02x}", byte)?; - } - - Ok(()) - } -} - -impl fmt::UpperHex for AccountAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if f.alternate() { - write!(f, "0x")?; - } - - for byte in &self.0 { - write!(f, "{:02X}", byte)?; - } - - Ok(()) - } -} - -impl From<[u8; AccountAddress::LENGTH]> for AccountAddress { - fn from(bytes: [u8; AccountAddress::LENGTH]) -> Self { - Self::new(bytes) - } -} - -impl TryFrom<&[u8]> for AccountAddress { - type Error = AccountAddressParseError; - - /// Tries to convert the provided byte array into Address. - fn try_from(bytes: &[u8]) -> Result { - Self::from_bytes(bytes) - } -} - -impl TryFrom> for AccountAddress { - type Error = AccountAddressParseError; - - /// Tries to convert the provided byte buffer into Address. - fn try_from(bytes: Vec) -> Result { - Self::from_bytes(bytes) - } -} - -impl From for Vec { - fn from(addr: AccountAddress) -> Vec { - addr.0.to_vec() - } -} - -impl From<&AccountAddress> for Vec { - fn from(addr: &AccountAddress) -> Vec { - addr.0.to_vec() - } -} - -impl From for [u8; AccountAddress::LENGTH] { - fn from(addr: AccountAddress) -> Self { - addr.0 - } -} - -impl From<&AccountAddress> for [u8; AccountAddress::LENGTH] { - fn from(addr: &AccountAddress) -> Self { - addr.0 - } -} - -impl From<&AccountAddress> for String { - fn from(addr: &AccountAddress) -> String { - ::hex::encode(addr.as_ref()) - } -} - -impl TryFrom for AccountAddress { - type Error = AccountAddressParseError; - - fn try_from(s: String) -> Result { - Self::from_hex(s) - } -} - -impl FromStr for AccountAddress { - type Err = AccountAddressParseError; - - fn from_str(s: &str) -> Result { - // Accept 0xADDRESS or ADDRESS - if let Ok(address) = AccountAddress::from_hex_literal(s) { - Ok(address) - } else { - Self::from_hex(s) - } - } -} - -impl<'de> Deserialize<'de> for AccountAddress { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - if deserializer.is_human_readable() { - let s = ::deserialize(deserializer)?; - AccountAddress::from_str(&s).map_err(D::Error::custom) - } else { - // In order to preserve the Serde data model and help analysis tools, - // make sure to wrap our value in a container with the same name - // as the original type. - #[derive(::serde::Deserialize)] - #[serde(rename = "AccountAddress")] - struct Value([u8; AccountAddress::LENGTH]); - - let value = Value::deserialize(deserializer)?; - Ok(AccountAddress::new(value.0)) - } - } -} - -impl Serialize for AccountAddress { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - if serializer.is_human_readable() { - self.to_hex().serialize(serializer) - } else { - // See comment in deserialize. - serializer.serialize_newtype_struct("AccountAddress", &self.0) - } - } -} - -#[derive(Clone, Copy, Debug)] -pub struct AccountAddressParseError; - -impl fmt::Display for AccountAddressParseError { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - write!( - f, - "Unable to parse AccountAddress (must be hex string of length {})", - AccountAddress::LENGTH - ) - } -} - -impl std::error::Error for AccountAddressParseError {} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/annotated_value.rs b/identity_iota_interaction/src/sdk_types/move_core_types/annotated_value.rs deleted file mode 100644 index 09a4ceca5d..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/annotated_value.rs +++ /dev/null @@ -1,774 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{ - collections::BTreeMap, - fmt::{self, Debug}, - io::Cursor, -}; - -use anyhow::Result as AResult; -use serde::{ - Deserialize, Serialize, - de::Error as DeError, - ser::{SerializeMap, SerializeSeq, SerializeStruct}, -}; - -use super::{ - VARIANT_COUNT_MAX, - account_address::AccountAddress, - annotated_visitor::{Error as VError, ValueDriver, Visitor, visit_struct, visit_value}, - identifier::Identifier, - language_storage::{StructTag, TypeTag}, - runtime_value::{self as R, MOVE_STRUCT_FIELDS, MOVE_STRUCT_TYPE}, - u256, -}; - -/// In the `WithTypes` configuration, a Move struct gets serialized into a Serde -/// struct with this name -pub const MOVE_STRUCT_NAME: &str = "struct"; - -/// In the `WithTypes` configuration, a Move enum/struct gets serialized into a -/// Serde struct with this as the first field -pub const MOVE_DATA_TYPE: &str = "type"; - -/// In the `WithTypes` configuration, a Move struct gets serialized into a Serde -/// struct with this as the second field -pub const MOVE_DATA_FIELDS: &str = "fields"; - -/// In the `WithTypes` configuration, a Move enum gets serialized into a Serde -/// struct with this as the second field In the `WithFields` configuration, this -/// is the first field of the serialized enum -pub const MOVE_VARIANT_NAME: &str = "variant_name"; - -/// Field name for the tag of the variant -pub const MOVE_VARIANT_TAG_NAME: &str = "variant_tag"; - -/// In the `WithTypes` configuration, a Move enum gets serialized into a Serde -/// struct with this name -pub const MOVE_ENUM_NAME: &str = "enum"; - -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct MoveStruct { - pub type_: StructTag, - pub fields: Vec<(Identifier, MoveValue)>, -} - -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct MoveVariant { - pub type_: StructTag, - pub variant_name: Identifier, - pub tag: u16, - pub fields: Vec<(Identifier, MoveValue)>, -} - -#[derive(Debug, PartialEq, Eq, Clone)] -pub enum MoveValue { - U8(u8), - U64(u64), - U128(u128), - Bool(bool), - Address(AccountAddress), - Vector(Vec), - Struct(MoveStruct), - Signer(AccountAddress), - // NOTE: Added in bytecode version v6, do not reorder! - U16(u16), - U32(u32), - U256(u256::U256), - Variant(MoveVariant), -} - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] -pub struct MoveFieldLayout { - pub name: Identifier, - pub layout: MoveTypeLayout, -} - -impl MoveFieldLayout { - pub fn new(name: Identifier, layout: MoveTypeLayout) -> Self { - Self { name, layout } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] -pub struct MoveStructLayout { - /// An decorated representation with both types and human-readable field - /// names - pub type_: StructTag, - pub fields: Vec, -} - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] -pub struct MoveEnumLayout { - pub type_: StructTag, - pub variants: BTreeMap<(Identifier, u16), Vec>, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum MoveDatatypeLayout { - Struct(Box), - Enum(Box), -} - -impl MoveDatatypeLayout { - pub fn into_layout(self) -> MoveTypeLayout { - match self { - Self::Struct(s) => MoveTypeLayout::Struct(s), - Self::Enum(e) => MoveTypeLayout::Enum(e), - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] -pub enum MoveTypeLayout { - #[serde(rename(serialize = "bool", deserialize = "bool"))] - Bool, - #[serde(rename(serialize = "u8", deserialize = "u8"))] - U8, - #[serde(rename(serialize = "u64", deserialize = "u64"))] - U64, - #[serde(rename(serialize = "u128", deserialize = "u128"))] - U128, - #[serde(rename(serialize = "address", deserialize = "address"))] - Address, - #[serde(rename(serialize = "vector", deserialize = "vector"))] - Vector(Box), - #[serde(rename(serialize = "struct", deserialize = "struct"))] - Struct(Box), - #[serde(rename(serialize = "signer", deserialize = "signer"))] - Signer, - - // NOTE: Added in bytecode version v6, do not reorder! - #[serde(rename(serialize = "u16", deserialize = "u16"))] - U16, - #[serde(rename(serialize = "u32", deserialize = "u32"))] - U32, - #[serde(rename(serialize = "u256", deserialize = "u256"))] - U256, - #[serde(rename(serialize = "enum", deserialize = "enum"))] - Enum(Box), -} - -impl MoveStructLayout { - /// Returns `true` if and only if the layout is for `type_`. - pub fn is_type(&self, type_: &StructTag) -> bool { - self.type_ == *type_ - } -} - -impl MoveEnumLayout { - /// Returns `true` if and only if the layout is for `type_`. - pub fn is_type(&self, type_: &StructTag) -> bool { - self.type_ == *type_ - } -} - -impl MoveTypeLayout { - /// Returns `true` if and only if the layout is for `type_`. - pub fn is_type(&self, type_: &TypeTag) -> bool { - use MoveTypeLayout as L; - use TypeTag as T; - - match self { - L::Bool => matches!(type_, T::Bool), - L::U8 => matches!(type_, T::U8), - L::U16 => matches!(type_, T::U16), - L::U32 => matches!(type_, T::U32), - L::U64 => matches!(type_, T::U64), - L::U128 => matches!(type_, T::U128), - L::U256 => matches!(type_, T::U256), - L::Address => matches!(type_, T::Address), - L::Signer => matches!(type_, T::Signer), - L::Vector(l) => matches!(type_, T::Vector(t) if l.is_type(t)), - L::Struct(l) => matches!(type_, T::Struct(t) if l.is_type(t)), - L::Enum(l) => matches!(type_, T::Struct(t) if l.is_type(t)), - } - } -} - -impl MoveValue { - /// TODO (annotated-visitor): Port legacy uses of this method to - /// `BoundedVisitor`. - pub fn simple_deserialize(blob: &[u8], ty: &MoveTypeLayout) -> AResult { - Ok(bcs::from_bytes_seed(ty, blob)?) - } - - /// Deserialize `blob` as a Move value with the given `ty`-pe layout, and - /// visit its sub-structure with the given `visitor`. The visitor - /// dictates the return value that is built up during deserialization. - /// - /// # Nested deserialization - /// - /// Vectors and structs are nested structures that can be met during - /// deserialization. Visitors are passed a driver (`VecDriver` or - /// `StructDriver` correspondingly) which controls how nested elements - /// or fields are visited including whether a given nested element/field is - /// explored, which visitor to use (the visitor can pass `self` to - /// recursively explore them) and whether a given element is visited or - /// skipped. - /// - /// The visitor may leave elements unvisited at the end of the vector or - /// struct, which implicitly skips them. - /// - /// # Errors - /// - /// Deserialization can fail because of an issue in the serialized format - /// (data doesn't match layout, unexpected bytes or trailing bytes), or - /// a custom error expressed by the visitor. - pub fn visit_deserialize<'b, 'l, V: Visitor<'b, 'l>>( - blob: &'b [u8], - ty: &'l MoveTypeLayout, - visitor: &mut V, - ) -> AResult - where - V::Error: std::error::Error + Send + Sync + 'static, - { - let mut bytes = Cursor::new(blob); - let res = visit_value(&mut bytes, ty, visitor)?; - if bytes.position() as usize == blob.len() { - Ok(res) - } else { - let remaining = blob.len() - bytes.position() as usize; - Err(VError::TrailingBytes(remaining).into()) - } - } - - pub fn simple_serialize(&self) -> Option> { - bcs::to_bytes(self).ok() - } - - pub fn undecorate(self) -> R::MoveValue { - match self { - Self::Struct(s) => R::MoveValue::Struct(s.undecorate()), - Self::Variant(v) => R::MoveValue::Variant(v.undecorate()), - Self::Vector(vals) => { - R::MoveValue::Vector(vals.into_iter().map(MoveValue::undecorate).collect()) - } - MoveValue::U8(u) => R::MoveValue::U8(u), - MoveValue::U64(u) => R::MoveValue::U64(u), - MoveValue::U128(u) => R::MoveValue::U128(u), - MoveValue::Bool(b) => R::MoveValue::Bool(b), - MoveValue::Address(a) => R::MoveValue::Address(a), - MoveValue::Signer(s) => R::MoveValue::Signer(s), - MoveValue::U16(u) => R::MoveValue::U16(u), - MoveValue::U32(u) => R::MoveValue::U32(u), - MoveValue::U256(u) => R::MoveValue::U256(u), - } - } -} - -pub fn serialize_values<'a, I>(vals: I) -> Vec> -where - I: IntoIterator, -{ - vals.into_iter() - .map(|val| { - val.simple_serialize() - .expect("serialization should succeed") - }) - .collect() -} - -impl MoveStruct { - pub fn new(type_: StructTag, fields: Vec<(Identifier, MoveValue)>) -> Self { - Self { type_, fields } - } - - /// TODO (annotated-visitor): Port legacy uses of this method to - /// `BoundedVisitor`. - pub fn simple_deserialize(blob: &[u8], ty: &MoveStructLayout) -> AResult { - Ok(bcs::from_bytes_seed(ty, blob)?) - } - - /// Like `MoveValue::visit_deserialize` (see for details), but specialized - /// to visiting a struct (the `blob` is known to be a serialized Move - /// struct, and the layout is a `MoveStructLayout`). - pub fn visit_deserialize<'b, 'l, V: Visitor<'b, 'l>>( - blob: &'b [u8], - ty: &'l MoveStructLayout, - visitor: &mut V, - ) -> AResult - where - V::Error: std::error::Error + Send + Sync + 'static, - { - let mut bytes = Cursor::new(blob); - let driver = ValueDriver::new(&mut bytes, None); - let res = visit_struct(driver, ty, visitor)?; - if bytes.position() as usize == blob.len() { - Ok(res) - } else { - let remaining = blob.len() - bytes.position() as usize; - Err(VError::TrailingBytes(remaining).into()) - } - } - - pub fn into_fields(self) -> Vec { - self.fields.into_iter().map(|(_, v)| v).collect() - } - - pub fn undecorate(self) -> R::MoveStruct { - R::MoveStruct( - self.into_fields() - .into_iter() - .map(MoveValue::undecorate) - .collect(), - ) - } -} - -impl MoveVariant { - pub fn new( - type_: StructTag, - variant_name: Identifier, - tag: u16, - fields: Vec<(Identifier, MoveValue)>, - ) -> Self { - Self { - type_, - variant_name, - tag, - fields, - } - } - - pub fn simple_deserialize(blob: &[u8], ty: &MoveEnumLayout) -> AResult { - Ok(bcs::from_bytes_seed(ty, blob)?) - } - - pub fn into_fields(self) -> Vec { - self.fields.into_iter().map(|(_, v)| v).collect() - } - - pub fn undecorate(self) -> R::MoveVariant { - R::MoveVariant { - tag: self.tag, - fields: self - .into_fields() - .into_iter() - .map(MoveValue::undecorate) - .collect(), - } - } -} - -impl MoveStructLayout { - pub fn new(type_: StructTag, fields: Vec) -> Self { - Self { type_, fields } - } - - pub fn into_fields(self) -> Vec { - self.fields.into_iter().map(|f| f.layout).collect() - } -} - -impl<'d> serde::de::DeserializeSeed<'d> for &MoveTypeLayout { - type Value = MoveValue; - fn deserialize>( - self, - deserializer: D, - ) -> Result { - match self { - MoveTypeLayout::Bool => bool::deserialize(deserializer).map(MoveValue::Bool), - MoveTypeLayout::U8 => u8::deserialize(deserializer).map(MoveValue::U8), - MoveTypeLayout::U16 => u16::deserialize(deserializer).map(MoveValue::U16), - MoveTypeLayout::U32 => u32::deserialize(deserializer).map(MoveValue::U32), - MoveTypeLayout::U64 => u64::deserialize(deserializer).map(MoveValue::U64), - MoveTypeLayout::U128 => u128::deserialize(deserializer).map(MoveValue::U128), - MoveTypeLayout::U256 => u256::U256::deserialize(deserializer).map(MoveValue::U256), - MoveTypeLayout::Address => { - AccountAddress::deserialize(deserializer).map(MoveValue::Address) - } - MoveTypeLayout::Signer => { - AccountAddress::deserialize(deserializer).map(MoveValue::Signer) - } - MoveTypeLayout::Struct(ty) => Ok(MoveValue::Struct(ty.deserialize(deserializer)?)), - MoveTypeLayout::Enum(ty) => Ok(MoveValue::Variant(ty.deserialize(deserializer)?)), - MoveTypeLayout::Vector(layout) => Ok(MoveValue::Vector( - deserializer.deserialize_seq(VectorElementVisitor(layout))?, - )), - } - } -} - -struct VectorElementVisitor<'a>(&'a MoveTypeLayout); - -impl<'d, 'a> serde::de::Visitor<'d> for VectorElementVisitor<'a> { - type Value = Vec; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("Vector") - } - - fn visit_seq
(self, mut seq: A) -> Result - where - A: serde::de::SeqAccess<'d>, - { - let mut vals = Vec::new(); - while let Some(elem) = seq.next_element_seed(self.0)? { - vals.push(elem) - } - Ok(vals) - } -} - -struct DecoratedStructFieldVisitor<'a>(&'a [MoveFieldLayout]); - -impl<'d, 'a> serde::de::Visitor<'d> for DecoratedStructFieldVisitor<'a> { - type Value = Vec<(Identifier, MoveValue)>; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("Struct") - } - - fn visit_seq(self, mut seq: A) -> Result - where - A: serde::de::SeqAccess<'d>, - { - let mut vals = Vec::new(); - for (i, layout) in self.0.iter().enumerate() { - match seq.next_element_seed(layout)? { - Some(elem) => vals.push(elem), - None => return Err(A::Error::invalid_length(i, &self)), - } - } - Ok(vals) - } -} - -impl<'d> serde::de::DeserializeSeed<'d> for &MoveFieldLayout { - type Value = (Identifier, MoveValue); - - fn deserialize>( - self, - deserializer: D, - ) -> Result { - Ok((self.name.clone(), self.layout.deserialize(deserializer)?)) - } -} - -impl<'d> serde::de::DeserializeSeed<'d> for &MoveStructLayout { - type Value = MoveStruct; - - fn deserialize>( - self, - deserializer: D, - ) -> Result { - let fields = deserializer - .deserialize_tuple(self.fields.len(), DecoratedStructFieldVisitor(&self.fields))?; - Ok(MoveStruct { - type_: self.type_.clone(), - fields, - }) - } -} - -impl<'d> serde::de::DeserializeSeed<'d> for &MoveEnumLayout { - type Value = MoveVariant; - fn deserialize>( - self, - deserializer: D, - ) -> Result { - let (variant_name, tag, fields) = - deserializer.deserialize_tuple(2, DecoratedEnumFieldVisitor(&self.variants))?; - Ok(MoveVariant { - type_: self.type_.clone(), - variant_name, - tag, - fields, - }) - } -} - -struct DecoratedEnumFieldVisitor<'a>(&'a BTreeMap<(Identifier, u16), Vec>); - -impl<'d, 'a> serde::de::Visitor<'d> for DecoratedEnumFieldVisitor<'a> { - type Value = (Identifier, u16, Vec<(Identifier, MoveValue)>); - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("Enum") - } - - fn visit_seq(self, mut seq: A) -> Result - where - A: serde::de::SeqAccess<'d>, - { - let tag = match seq.next_element_seed(&MoveTypeLayout::U8)? { - Some(MoveValue::U8(tag)) if tag as u64 <= VARIANT_COUNT_MAX => tag as u16, - Some(MoveValue::U8(tag)) => return Err(A::Error::invalid_length(tag as usize, &self)), - Some(val) => { - return Err(A::Error::invalid_type( - serde::de::Unexpected::Other(&format!("{val:?}")), - &self, - )); - } - None => return Err(A::Error::invalid_length(0, &self)), - }; - - let Some(((variant_name, _), variant_layout)) = - self.0.iter().find(|((_, v_tag), _)| *v_tag == tag) - else { - return Err(A::Error::invalid_length(tag as usize, &self)); - }; - - let Some(fields) = seq.next_element_seed(&DecoratedVariantFieldLayout(variant_layout))? - else { - return Err(A::Error::invalid_length(1, &self)); - }; - - Ok((variant_name.clone(), tag, fields)) - } -} - -struct DecoratedVariantFieldLayout<'a>(&'a Vec); - -impl<'d, 'a> serde::de::DeserializeSeed<'d> for &DecoratedVariantFieldLayout<'a> { - type Value = Vec<(Identifier, MoveValue)>; - - fn deserialize>( - self, - deserializer: D, - ) -> Result { - deserializer.deserialize_tuple(self.0.len(), DecoratedStructFieldVisitor(self.0)) - } -} - -impl serde::Serialize for MoveValue { - fn serialize(&self, serializer: S) -> Result { - match self { - MoveValue::Struct(s) => s.serialize(serializer), - MoveValue::Variant(v) => v.serialize(serializer), - MoveValue::Bool(b) => serializer.serialize_bool(*b), - MoveValue::U8(i) => serializer.serialize_u8(*i), - MoveValue::U16(i) => serializer.serialize_u16(*i), - MoveValue::U32(i) => serializer.serialize_u32(*i), - MoveValue::U64(i) => serializer.serialize_u64(*i), - MoveValue::U128(i) => serializer.serialize_u128(*i), - MoveValue::U256(i) => i.serialize(serializer), - MoveValue::Address(a) => a.serialize(serializer), - MoveValue::Signer(a) => a.serialize(serializer), - MoveValue::Vector(v) => { - let mut t = serializer.serialize_seq(Some(v.len()))?; - for val in v { - t.serialize_element(val)?; - } - t.end() - } - } - } -} - -struct MoveFields<'a>(&'a [(Identifier, MoveValue)]); - -impl<'a> serde::Serialize for MoveFields<'a> { - fn serialize(&self, serializer: S) -> Result { - let mut t = serializer.serialize_map(Some(self.0.len()))?; - for (f, v) in self.0.iter() { - t.serialize_entry(f, v)?; - } - t.end() - } -} - -impl serde::Serialize for MoveStruct { - fn serialize(&self, serializer: S) -> Result { - // Serialize a Move struct as Serde struct type named `struct `with two fields - // named `type` and `fields`. `fields` will get serialized as a Serde - // map. Unfortunately, we can't serialize this in the logical way: as a - // Serde struct named `type` with a field for each of `fields` because - // serde insists that struct and field names be `'static &str`'s - let mut t = serializer.serialize_struct(MOVE_STRUCT_NAME, 2)?; - // serialize type as string (e.g., - // 0x0::ModuleName::StructName) instead of (e.g. - // { address: 0x0...0, module: ModuleName, name: StructName, type_args: - // [TypeArg1, TypeArg2]}) - t.serialize_field(MOVE_STRUCT_TYPE, &self.type_.to_string())?; - t.serialize_field(MOVE_STRUCT_FIELDS, &MoveFields(&self.fields))?; - t.end() - } -} - -impl serde::Serialize for MoveVariant { - fn serialize(&self, serializer: S) -> Result { - // Serialize an enum as: - // enum { "type": 0xC::module::enum_type, "variant_name": name, "variant_tag": - // tag, "fields": { ... } } - let mut t = serializer.serialize_struct(MOVE_ENUM_NAME, 4)?; - t.serialize_field(MOVE_DATA_TYPE, &self.type_.to_string())?; - t.serialize_field(MOVE_VARIANT_NAME, &self.variant_name.to_string())?; - t.serialize_field(MOVE_VARIANT_TAG_NAME, &MoveValue::U16(self.tag))?; - t.serialize_field(MOVE_DATA_FIELDS, &MoveFields(&self.fields))?; - t.end() - } -} - -impl fmt::Display for MoveTypeLayout { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - use MoveTypeLayout::*; - match self { - Bool => write!(f, "bool"), - U8 => write!(f, "u8"), - U16 => write!(f, "u16"), - U32 => write!(f, "u32"), - U64 => write!(f, "u64"), - U128 => write!(f, "u128"), - U256 => write!(f, "u256"), - Address => write!(f, "address"), - Signer => write!(f, "signer"), - Vector(typ) if f.alternate() => write!(f, "vector<{typ:#}>"), - Vector(typ) => write!(f, "vector<{typ}>"), - Struct(s) if f.alternate() => write!(f, "{s:#}"), - Struct(s) => write!(f, "{s}"), - Enum(e) if f.alternate() => write!(f, "{e:#}"), - Enum(e) => write!(f, "enum {}", e), - } - } -} - -/// Helper type that uses `T`'s `Display` implementation as its own `Debug` -/// implementation, to allow other `Display` implementations in this module to -/// take advantage of the structured formatting helpers that Rust uses for its -/// own debug types. -struct DebugAsDisplay<'a, T>(&'a T); -impl<'a, T: fmt::Display> fmt::Debug for DebugAsDisplay<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if f.alternate() { - write!(f, "{:#}", self.0) - } else { - write!(f, "{}", self.0) - } - } -} - -impl fmt::Display for MoveStructLayout { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - use DebugAsDisplay as DD; - write!(f, "struct ")?; - write!(f, "{} ", self.type_)?; - let mut map = f.debug_map(); - for field in &*self.fields { - map.entry(&DD(&field.name), &DD(&field.layout)); - } - map.finish() - } -} - -impl fmt::Display for MoveEnumLayout { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - use DebugAsDisplay as DD; - write!(f, "enum {} ", self.type_)?; - let mut vmap = f.debug_set(); - for ((variant_name, _), fields) in self.variants.iter() { - vmap.entry(&DD(&MoveVariantDisplay(variant_name.as_str(), fields))); - } - vmap.finish() - } -} - -struct MoveVariantDisplay<'a>(&'a str, &'a [MoveFieldLayout]); - -impl<'a> fmt::Display for MoveVariantDisplay<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - use DebugAsDisplay as DD; - let mut map = f.debug_struct(self.0); - for field in self.1 { - map.field(field.name.as_str(), &DD(&field.layout)); - } - map.finish() - } -} - -impl From<&MoveTypeLayout> for TypeTag { - fn from(val: &MoveTypeLayout) -> TypeTag { - match val { - MoveTypeLayout::Address => TypeTag::Address, - MoveTypeLayout::Bool => TypeTag::Bool, - MoveTypeLayout::U8 => TypeTag::U8, - MoveTypeLayout::U16 => TypeTag::U16, - MoveTypeLayout::U32 => TypeTag::U32, - MoveTypeLayout::U64 => TypeTag::U64, - MoveTypeLayout::U128 => TypeTag::U128, - MoveTypeLayout::U256 => TypeTag::U256, - MoveTypeLayout::Signer => TypeTag::Signer, - MoveTypeLayout::Vector(v) => { - let inner_type = &**v; - TypeTag::Vector(Box::new(inner_type.into())) - } - MoveTypeLayout::Struct(v) => TypeTag::Struct(Box::new(v.as_ref().into())), - MoveTypeLayout::Enum(e) => TypeTag::Struct(Box::new(e.as_ref().into())), - } - } -} - -impl From<&MoveStructLayout> for StructTag { - fn from(val: &MoveStructLayout) -> StructTag { - val.type_.clone() - } -} - -impl From<&MoveEnumLayout> for StructTag { - fn from(val: &MoveEnumLayout) -> StructTag { - val.type_.clone() - } -} - -impl fmt::Display for MoveValue { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - MoveValue::U8(u) => write!(f, "{}u8", u), - MoveValue::U16(u) => write!(f, "{}u16", u), - MoveValue::U32(u) => write!(f, "{}u32", u), - MoveValue::U64(u) => write!(f, "{}u64", u), - MoveValue::U128(u) => write!(f, "{}u128", u), - MoveValue::U256(u) => write!(f, "{}u256", u), - MoveValue::Bool(false) => write!(f, "false"), - MoveValue::Bool(true) => write!(f, "true"), - MoveValue::Address(a) => write!(f, "{}", a.to_hex_literal()), - MoveValue::Signer(a) => write!(f, "signer({})", a.to_hex_literal()), - MoveValue::Vector(v) => { - use DebugAsDisplay as DD; - write!(f, "vector")?; - let mut list = f.debug_list(); - for val in v { - list.entry(&DD(val)); - } - list.finish() - } - MoveValue::Struct(s) => fmt::Display::fmt(s, f), - MoveValue::Variant(v) => fmt::Display::fmt(v, f), - } - } -} - -impl fmt::Display for MoveStruct { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - use DebugAsDisplay as DD; - fmt::Display::fmt(&self.type_, f)?; - write!(f, " ")?; - let mut map = f.debug_map(); - for (field, value) in &self.fields { - map.entry(&DD(field), &DD(value)); - } - map.finish() - } -} - -impl fmt::Display for MoveVariant { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - use DebugAsDisplay as DD; - let MoveVariant { - type_, - variant_name, - tag: _, - fields, - } = self; - write!(f, "{}::{}", type_, variant_name)?; - let mut map = f.debug_map(); - for (field, value) in fields { - map.entry(&DD(field), &DD(value)); - } - map.finish() - } -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/annotated_visitor.rs b/identity_iota_interaction/src/sdk_types/move_core_types/annotated_visitor.rs deleted file mode 100644 index 354e38bf29..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/annotated_visitor.rs +++ /dev/null @@ -1,814 +0,0 @@ -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::io::{Cursor, Read}; - -use super::{ - VARIANT_COUNT_MAX, - account_address::AccountAddress, - annotated_value::{MoveEnumLayout, MoveFieldLayout, MoveStructLayout, MoveTypeLayout}, - identifier::IdentStr, - u256::U256, -}; - -/// Visitors can be used for building values out of a serialized Move struct or -/// value. -pub trait Visitor<'b, 'l> { - type Value; - - /// Visitors can return any error as long as it can represent an error from - /// the visitor itself. The easiest way to achieve this is to use - /// `thiserror`: - /// - /// ```rust,no_doc - /// #[derive(thiserror::Error)] - /// enum Error { - /// #[error(transparent)] - /// Visitor(#[from] annotated_visitor::Error) - /// - /// // Custom error variants ... - /// } - /// ``` - type Error: From; - - fn visit_u8( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u8, - ) -> Result; - - fn visit_u16( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u16, - ) -> Result; - - fn visit_u32( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u32, - ) -> Result; - - fn visit_u64( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u64, - ) -> Result; - - fn visit_u128( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u128, - ) -> Result; - - fn visit_u256( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: U256, - ) -> Result; - - fn visit_bool( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: bool, - ) -> Result; - - fn visit_address( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: AccountAddress, - ) -> Result; - - fn visit_signer( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: AccountAddress, - ) -> Result; - - fn visit_vector( - &mut self, - driver: &mut VecDriver<'_, 'b, 'l>, - ) -> Result; - - fn visit_struct( - &mut self, - driver: &mut StructDriver<'_, 'b, 'l>, - ) -> Result; - - fn visit_variant( - &mut self, - driver: &mut VariantDriver<'_, 'b, 'l>, - ) -> Result; -} - -/// A traversal is a special kind of visitor that doesn't return any values. The -/// trait comes with default implementations for every variant that do nothing, -/// allowing an implementor to focus on only the cases they care about. -/// -/// Note that the default implementation for structs and vectors recurse down -/// into their elements. A traversal that doesn't want to look inside structs -/// and vectors needs to provide a custom implementation with an empty body: -/// -/// ```rust,no_run -/// fn traverse_vector(&mut self, _: &mut VecDriver) -> Result<(), Self::Error> { -/// Ok(()) -/// } -/// ``` -pub trait Traversal<'b, 'l> { - type Error: From; - - fn traverse_u8( - &mut self, - _driver: &ValueDriver<'_, 'b, 'l>, - _value: u8, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_u16( - &mut self, - _driver: &ValueDriver<'_, 'b, 'l>, - _value: u16, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_u32( - &mut self, - _driver: &ValueDriver<'_, 'b, 'l>, - _value: u32, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_u64( - &mut self, - _driver: &ValueDriver<'_, 'b, 'l>, - _value: u64, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_u128( - &mut self, - _driver: &ValueDriver<'_, 'b, 'l>, - _value: u128, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_u256( - &mut self, - _driver: &ValueDriver<'_, 'b, 'l>, - _value: U256, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_bool( - &mut self, - _driver: &ValueDriver<'_, 'b, 'l>, - _value: bool, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_address( - &mut self, - _: &ValueDriver<'_, 'b, 'l>, - _: AccountAddress, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_signer( - &mut self, - _: &ValueDriver<'_, 'b, 'l>, - _: AccountAddress, - ) -> Result<(), Self::Error> { - Ok(()) - } - - fn traverse_vector(&mut self, driver: &mut VecDriver<'_, 'b, 'l>) -> Result<(), Self::Error> { - while driver.next_element(self)?.is_some() {} - Ok(()) - } - - fn traverse_struct( - &mut self, - driver: &mut StructDriver<'_, 'b, 'l>, - ) -> Result<(), Self::Error> { - while driver.next_field(self)?.is_some() {} - Ok(()) - } - - fn traverse_variant( - &mut self, - driver: &mut VariantDriver<'_, 'b, 'l>, - ) -> Result<(), Self::Error> { - while driver.next_field(self)?.is_some() {} - Ok(()) - } -} - -/// Default implementation converting any traversal into a visitor. -impl<'b, 'l, T: Traversal<'b, 'l> + ?Sized> Visitor<'b, 'l> for T { - type Value = (); - type Error = T::Error; - - fn visit_u8( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u8, - ) -> Result { - self.traverse_u8(driver, value) - } - - fn visit_u16( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u16, - ) -> Result { - self.traverse_u16(driver, value) - } - - fn visit_u32( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u32, - ) -> Result { - self.traverse_u32(driver, value) - } - - fn visit_u64( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u64, - ) -> Result { - self.traverse_u64(driver, value) - } - - fn visit_u128( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: u128, - ) -> Result { - self.traverse_u128(driver, value) - } - - fn visit_u256( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: U256, - ) -> Result { - self.traverse_u256(driver, value) - } - - fn visit_bool( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: bool, - ) -> Result { - self.traverse_bool(driver, value) - } - - fn visit_address( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: AccountAddress, - ) -> Result { - self.traverse_address(driver, value) - } - - fn visit_signer( - &mut self, - driver: &ValueDriver<'_, 'b, 'l>, - value: AccountAddress, - ) -> Result { - self.traverse_signer(driver, value) - } - - fn visit_vector( - &mut self, - driver: &mut VecDriver<'_, 'b, 'l>, - ) -> Result { - self.traverse_vector(driver) - } - - fn visit_struct( - &mut self, - driver: &mut StructDriver<'_, 'b, 'l>, - ) -> Result { - self.traverse_struct(driver) - } - - fn visit_variant( - &mut self, - driver: &mut VariantDriver<'_, 'b, 'l>, - ) -> Result { - self.traverse_variant(driver) - } -} - -/// Exposes information about the byte stream that the value being visited came -/// from, namely the bytes themselves, and the offset at which the value starts. -/// Also exposes the layout of the value being visited. -pub struct ValueDriver<'c, 'b, 'l> { - bytes: &'c mut Cursor<&'b [u8]>, - layout: Option<&'l MoveTypeLayout>, - start: usize, -} - -/// Exposes information about a vector being visited (the element layout) to a -/// visitor implementation, and allows that visitor to progress the traversal -/// (by visiting or skipping elements). -pub struct VecDriver<'c, 'b, 'l> { - inner: ValueDriver<'c, 'b, 'l>, - layout: &'l MoveTypeLayout, - len: u64, - off: u64, -} - -/// Exposes information about a struct being visited (its layout, details about -/// the next field to be visited) to a visitor implementation, and allows that -/// visitor to progress the traversal (by visiting or skipping fields). -pub struct StructDriver<'c, 'b, 'l> { - inner: ValueDriver<'c, 'b, 'l>, - layout: &'l MoveStructLayout, - off: u64, -} - -/// Exposes information about a variant being visited (its layout, details about -/// the next field to be visited, the variant's tag, and name) to a visitor -/// implementation, and allows that visitor to progress the traversal (by -/// visiting or skipping fields). -pub struct VariantDriver<'c, 'b, 'l> { - inner: ValueDriver<'c, 'b, 'l>, - layout: &'l MoveEnumLayout, - tag: u16, - variant_name: &'l IdentStr, - variant_layout: &'l [MoveFieldLayout], - off: u64, -} - -#[derive(thiserror::Error, Debug)] -pub enum Error { - #[error("unexpected end of input")] - UnexpectedEof, - - #[error("unexpected byte: {0}")] - UnexpectedByte(u8), - - #[error("trailing {0} byte(s) at the end of input")] - TrailingBytes(usize), - - #[error("invalid variant tag: {0}")] - UnexpectedVariantTag(usize), - - #[error("no layout available for value")] - NoValueLayout, -} - -/// The null traversal implements `Traversal` and `Visitor` but without doing -/// anything (does not return a value, and does not modify any state). This is -/// useful for skipping over parts of the value structure. -pub struct NullTraversal; - -impl<'b, 'l> Traversal<'b, 'l> for NullTraversal { - type Error = Error; -} - -impl<'c, 'b, 'l> ValueDriver<'c, 'b, 'l> { - pub(crate) fn new(bytes: &'c mut Cursor<&'b [u8]>, layout: Option<&'l MoveTypeLayout>) -> Self { - let start = bytes.position() as usize; - Self { - bytes, - layout, - start, - } - } - - /// The offset at which the value being visited starts in the byte stream. - pub fn start(&self) -> usize { - self.start - } - - /// The current position in the byte stream. - pub fn position(&self) -> usize { - self.bytes.position() as usize - } - - /// All the bytes in the byte stream (including the ones that have been - /// read). - pub fn bytes(&self) -> &'b [u8] { - self.bytes.get_ref() - } - /// The bytes that haven't been consumed by the visitor yet. - pub fn remaining_bytes(&self) -> &'b [u8] { - &self.bytes.get_ref()[self.position()..] - } - - /// Type layout for the value being visited. May produce an error if a - /// layout was not supplied when the driver was created (which should - /// only happen if the driver was created for visiting a struct - /// specifically). - pub fn layout(&self) -> Result<&'l MoveTypeLayout, Error> { - self.layout.ok_or(Error::NoValueLayout) - } - - fn read_exact(&mut self) -> Result<[u8; N], Error> { - let mut buf = [0u8; N]; - self.bytes - .read_exact(&mut buf) - .map_err(|_| Error::UnexpectedEof)?; - Ok(buf) - } - - fn read_leb128(&mut self) -> Result { - leb128::read::unsigned(self.bytes).map_err(|_| Error::UnexpectedEof) - } -} - -#[allow(clippy::len_without_is_empty)] -impl<'c, 'b, 'l> VecDriver<'c, 'b, 'l> { - fn new(inner: ValueDriver<'c, 'b, 'l>, layout: &'l MoveTypeLayout, len: u64) -> Self { - Self { - inner, - layout, - len, - off: 0, - } - } - - /// The offset at which the value being visited starts in the byte stream. - pub fn start(&self) -> usize { - self.inner.start() - } - - /// The current position in the byte stream. - pub fn position(&self) -> usize { - self.inner.position() - } - - /// All the bytes in the byte stream (including the ones that have been - /// read). - pub fn bytes(&self) -> &'b [u8] { - self.inner.bytes() - } - - /// The bytes that haven't been consumed by the visitor yet. - pub fn remaining_bytes(&self) -> &'b [u8] { - self.inner.remaining_bytes() - } - - /// Type layout for the vector's inner type. - pub fn element_layout(&self) -> &'l MoveTypeLayout { - self.layout - } - - /// The number of elements in this vector that have been visited so far. - pub fn off(&self) -> u64 { - self.off - } - - /// The number of elements in this vector. - pub fn len(&self) -> u64 { - self.len - } - - /// Returns whether or not there are more elements to visit in this vector. - pub fn has_element(&self) -> bool { - self.off < self.len - } - - /// Visit the next element in the vector. The driver accepts a visitor to - /// use for this element, allowing the visitor to be changed on - /// recursive calls or even between elements in the same vector. - /// - /// Returns `Ok(None)` if there are no more elements in the vector, `Ok(v)` - /// if there was an element and it was successfully visited (where `v` - /// is the value returned by the visitor) or an error if there was an - /// underlying deserialization error, or an error during visitation. - pub fn next_element + ?Sized>( - &mut self, - visitor: &mut V, - ) -> Result, V::Error> { - Ok(if self.off >= self.len { - None - } else { - let res = visit_value(self.inner.bytes, self.layout, visitor)?; - self.off += 1; - Some(res) - }) - } - - /// Skip the next element in this vector. Returns whether there was an - /// element to skip or not on success, or an error if there was an - /// underlying deserialization error. - pub fn skip_element(&mut self) -> Result { - self.next_element(&mut NullTraversal).map(|v| v.is_some()) - } -} - -impl<'c, 'b, 'l> StructDriver<'c, 'b, 'l> { - fn new(inner: ValueDriver<'c, 'b, 'l>, layout: &'l MoveStructLayout) -> Self { - Self { - inner, - layout, - off: 0, - } - } - - /// The offset at which the value being visited starts in the byte stream. - pub fn start(&self) -> usize { - self.inner.start() - } - - /// The current position in the byte stream. - pub fn position(&self) -> usize { - self.inner.position() - } - - /// All the bytes in the byte stream (including the ones that have been - /// read). - pub fn bytes(&self) -> &'b [u8] { - self.inner.bytes() - } - - /// The bytes that haven't been consumed by the visitor yet. - pub fn remaining_bytes(&self) -> &'b [u8] { - self.inner.remaining_bytes() - } - - /// The layout of the struct being visited. - pub fn struct_layout(&self) -> &'l MoveStructLayout { - self.layout - } - - /// The number of fields in this struct that have been visited so far. - pub fn off(&self) -> u64 { - self.off - } - - /// The layout of the next field to be visited (if there is one), or `None` - /// otherwise. - pub fn peek_field(&self) -> Option<&'l MoveFieldLayout> { - self.layout.fields.get(self.off as usize) - } - - /// Visit the next field in the struct. The driver accepts a visitor to use - /// for this field, allowing the visitor to be changed on recursive - /// calls or even between fields in the same struct. - /// - /// Returns `Ok(None)` if there are no more fields in the struct, `Ok((f, - /// v))` if there was an field and it was successfully visited (where - /// `v` is the value returned by the visitor, and `f` is the layout of - /// the field that was visited) or an error if there was an underlying - /// deserialization error, or an error during visitation. - pub fn next_field + ?Sized>( - &mut self, - visitor: &mut V, - ) -> Result, V::Error> { - let Some(field) = self.peek_field() else { - return Ok(None); - }; - - let res = visit_value(self.inner.bytes, &field.layout, visitor)?; - self.off += 1; - Ok(Some((field, res))) - } - - /// Skip the next field. Returns the layout of the field that was visited if - /// there was one, or `None` if there was none. Can return an error if - /// there was a deserialization error. - pub fn skip_field(&mut self) -> Result, Error> { - self.next_field(&mut NullTraversal) - .map(|res| res.map(|(f, _)| f)) - } -} - -impl<'c, 'b, 'l> VariantDriver<'c, 'b, 'l> { - fn new( - inner: ValueDriver<'c, 'b, 'l>, - layout: &'l MoveEnumLayout, - variant_layout: &'l [MoveFieldLayout], - variant_name: &'l IdentStr, - tag: u16, - ) -> Self { - Self { - inner, - layout, - tag, - variant_name, - variant_layout, - off: 0, - } - } - - /// The offset at which the value being visited starts in the byte stream. - pub fn start(&self) -> usize { - self.inner.start() - } - - /// The current position in the byte stream. - pub fn position(&self) -> usize { - self.inner.position() - } - - /// All the bytes in the byte stream (including the ones that have been - /// read). - pub fn bytes(&self) -> &'b [u8] { - self.inner.bytes() - } - - /// The bytes that haven't been consumed by the visitor yet. - pub fn remaining_bytes(&self) -> &'b [u8] { - self.inner.remaining_bytes() - } - - /// The layout of the enum being visited. - pub fn enum_layout(&self) -> &'l MoveEnumLayout { - self.layout - } - - /// The layout of the variant being visited. - pub fn variant_layout(&self) -> &'l [MoveFieldLayout] { - self.variant_layout - } - - /// The tag of the variant being visited. - pub fn tag(&self) -> u16 { - self.tag - } - - /// The name of the enum variant being visited. - pub fn variant_name(&self) -> &'l IdentStr { - self.variant_name - } - - /// The number of elements in this vector that have been visited so far. - pub fn off(&self) -> u64 { - self.off - } - - /// The layout of the next field to be visited (if there is one), or `None` - /// otherwise. - pub fn peek_field(&self) -> Option<&'l MoveFieldLayout> { - self.variant_layout.get(self.off as usize) - } - - /// Visit the next field in the variant. The driver accepts a visitor to use - /// for this field, allowing the visitor to be changed on recursive - /// calls or even between fields in the same variant. - /// - /// Returns `Ok(None)` if there are no more fields in the variant, `Ok((f, - /// v))` if there was an field and it was successfully visited (where - /// `v` is the value returned by the visitor, and `f` is the layout of - /// the field that was visited) or an error if there was an underlying - /// deserialization error, or an error during visitation. - pub fn next_field + ?Sized>( - &mut self, - visitor: &mut V, - ) -> Result, V::Error> { - let Some(field) = self.peek_field() else { - return Ok(None); - }; - - let res = visit_value(self.inner.bytes, &field.layout, visitor)?; - self.off += 1; - Ok(Some((field, res))) - } - - /// Skip the next field. Returns the layout of the field that was visited if - /// there was one, or `None` if there was none. Can return an error if - /// there was a deserialization error. - pub fn skip_field(&mut self) -> Result, Error> { - self.next_field(&mut NullTraversal) - .map(|res| res.map(|(f, _)| f)) - } -} - -/// Visit a serialized Move value with the provided `layout`, held in `bytes`, -/// using the provided visitor to build a value out of it. See -/// `annoted_value::MoveValue::visit_deserialize` for details. -pub(crate) fn visit_value<'c, 'b, 'l, V: Visitor<'b, 'l> + ?Sized>( - bytes: &'c mut Cursor<&'b [u8]>, - layout: &'l MoveTypeLayout, - visitor: &mut V, -) -> Result { - use MoveTypeLayout as L; - - let mut driver = ValueDriver::new(bytes, Some(layout)); - match layout { - L::Bool => match driver.read_exact()? { - [0] => visitor.visit_bool(&driver, false), - [1] => visitor.visit_bool(&driver, true), - [b] => Err(Error::UnexpectedByte(b).into()), - }, - - L::U8 => { - let v = u8::from_le_bytes(driver.read_exact()?); - visitor.visit_u8(&driver, v) - } - - L::U16 => { - let v = u16::from_le_bytes(driver.read_exact()?); - visitor.visit_u16(&driver, v) - } - - L::U32 => { - let v = u32::from_le_bytes(driver.read_exact()?); - visitor.visit_u32(&driver, v) - } - - L::U64 => { - let v = u64::from_le_bytes(driver.read_exact()?); - visitor.visit_u64(&driver, v) - } - - L::U128 => { - let v = u128::from_le_bytes(driver.read_exact()?); - visitor.visit_u128(&driver, v) - } - - L::U256 => { - let v = U256::from_le_bytes(&driver.read_exact()?); - visitor.visit_u256(&driver, v) - } - - L::Address => { - let v = AccountAddress::new(driver.read_exact()?); - visitor.visit_address(&driver, v) - } - - L::Signer => { - let v = AccountAddress::new(driver.read_exact()?); - visitor.visit_signer(&driver, v) - } - - L::Vector(l) => visit_vector(driver, l.as_ref(), visitor), - L::Struct(l) => visit_struct(driver, l, visitor), - L::Enum(e) => visit_variant(driver, e, visitor), - } -} - -/// Like `visit_value` but specialized to visiting a vector (where the `bytes` -/// is known to be a serialized move vector), and the layout is the vector's -/// element's layout. -fn visit_vector<'c, 'b, 'l, V: Visitor<'b, 'l> + ?Sized>( - mut inner: ValueDriver<'c, 'b, 'l>, - layout: &'l MoveTypeLayout, - visitor: &mut V, -) -> Result { - let len = inner.read_leb128()?; - let mut driver = VecDriver::new(inner, layout, len); - let res = visitor.visit_vector(&mut driver)?; - while driver.skip_element()? {} - Ok(res) - } - -/// Like `visit_value` but specialized to visiting a struct (where the `bytes` -/// is known to be a serialized move struct), and the layout is a struct layout. -pub(crate) fn visit_struct<'c, 'b, 'l, V: Visitor<'b, 'l> + ?Sized>( - inner: ValueDriver<'c, 'b, 'l>, - layout: &'l MoveStructLayout, - visitor: &mut V, -) -> Result { - let mut driver = StructDriver::new(inner, layout); - let res = visitor.visit_struct(&mut driver)?; - while driver.skip_field()?.is_some() {} - Ok(res) -} - -/// Like `visit_struct` but specialized to visiting a variant (where the `bytes` -/// is known to be a serialized move variant), and the layout is an enum layout. -fn visit_variant<'c, 'b, 'l, V: Visitor<'b, 'l> + ?Sized>( - mut inner: ValueDriver<'c, 'b, 'l>, - layout: &'l MoveEnumLayout, - visitor: &mut V, -) -> Result { - // Since variants are bounded at 127, we can read the tag as a single byte. - // When we add true ULEB encoding for enum variants switch to this: - // let tag = inner.read_leb128()?; - let [tag] = inner.read_exact()?; - if tag >= VARIANT_COUNT_MAX as u8 { - return Err(Error::UnexpectedVariantTag(tag as usize).into()); - } - let variant_layout = layout - .variants - .iter() - .find(|((_, vtag), _)| *vtag == tag as u16) - .ok_or(Error::UnexpectedVariantTag(tag as usize))?; - - let mut driver = VariantDriver::new( - inner, - layout, - variant_layout.1, - &variant_layout.0.0, - tag as u16, - ); - let res = visitor.visit_variant(&mut driver)?; - while driver.skip_field()?.is_some() {} - Ok(res) -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/identifier.rs b/identity_iota_interaction/src/sdk_types/move_core_types/identifier.rs deleted file mode 100644 index 82c6f3d0d6..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/identifier.rs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use core::str::FromStr; -use core::ops::Deref; -use core::fmt; -use std::borrow::Borrow; - -use ref_cast::RefCast; - -use serde::Deserialize; -use serde::Serialize; - -use anyhow::{bail, Result}; - - -/// Return true if this character can appear in a Move identifier. -/// -/// Note: there are stricter restrictions on whether a character can begin a -/// Move identifier--only alphabetic characters are allowed here. -#[inline] -pub const fn is_valid_identifier_char(c: char) -> bool { - matches!(c, '_' | 'a'..='z' | 'A'..='Z' | '0'..='9') -} - -/// Returns `true` if all bytes in `b` after the offset `start_offset` are valid -/// ASCII identifier characters. -const fn all_bytes_valid(b: &[u8], start_offset: usize) -> bool { - let mut i = start_offset; - // TODO(philiphayes): use for loop instead of while loop when it's stable in - // const fn's. - while i < b.len() { - if !is_valid_identifier_char(b[i] as char) { - return false; - } - i += 1; - } - true -} - -/// Describes what identifiers are allowed. -/// -/// For now this is deliberately restrictive -- we would like to evolve this in -/// the future. -// TODO: "" is coded as an exception. It should be removed once -// CompiledScript goes away. Note: needs to be pub as it's used in the -// `ident_str!` macro. -pub const fn is_valid(s: &str) -> bool { - // Rust const fn's don't currently support slicing or indexing &str's, so we - // have to operate on the underlying byte slice. This is not a problem as - // valid identifiers are (currently) ASCII-only. - let b = s.as_bytes(); - match b { - b"" => true, - [b'a'..=b'z', ..] | [b'A'..=b'Z', ..] => all_bytes_valid(b, 1), - [b'_', ..] if b.len() > 1 => all_bytes_valid(b, 1), - _ => false, - } -} - -/// An owned identifier. -/// -/// For more details, see the module level documentation. -#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize)] -pub struct Identifier(Box); -// An identifier cannot be mutated so use Box instead of String -- it is 1 -// word smaller. - -impl Identifier { - /// Creates a new `Identifier` instance. - pub fn new(s: impl Into>) -> Result { - let s = s.into(); - if Self::is_valid(&s) { - Ok(Self(s)) - } else { - bail!("Invalid identifier '{}'", s); - } - } - - /// Creates a new `Identifier` from a string without checking if it is a - /// valid identifier. This should not be used under normal - /// circumstances, but is used in cases where we need to - /// preserve backwards compatibility. - /// - /// # Safety - /// - /// Only use this function when preserving backwards compatibility. - pub unsafe fn new_unchecked(s: impl Into>) -> Self { - Self(s.into()) - } - - /// Returns true if this string is a valid identifier. - pub fn is_valid(s: impl AsRef) -> bool { - is_valid(s.as_ref()) - } - - /// Returns if this identifier is ``. - /// TODO: remove once we fully separate CompiledScript & CompiledModule. - pub fn is_self(&self) -> bool { - &*self.0 == "" - } - - /// Converts a vector of bytes to an `Identifier`. - pub fn from_utf8(vec: Vec) -> Result { - let s = String::from_utf8(vec)?; - Self::new(s) - } - - /// Creates a borrowed version of `self`. - pub fn as_ident_str(&self) -> &IdentStr { - self - } - - /// Converts this `Identifier` into a `String`. - /// - /// This is not implemented as a `From` trait to discourage automatic - /// conversions -- these conversions should not typically happen. - pub fn into_string(self) -> String { - self.0.into() - } - - /// Converts this `Identifier` into a UTF-8-encoded byte sequence. - pub fn into_bytes(self) -> Vec { - self.into_string().into_bytes() - } -} - -impl FromStr for Identifier { - type Err = anyhow::Error; - - fn from_str(data: &str) -> Result { - Self::new(data) - } -} - -impl From<&IdentStr> for Identifier { - fn from(ident_str: &IdentStr) -> Self { - ident_str.to_owned() - } -} - -impl AsRef for Identifier { - fn as_ref(&self) -> &IdentStr { - self - } -} - -impl Deref for Identifier { - type Target = IdentStr; - - fn deref(&self) -> &IdentStr { - // Identifier and IdentStr maintain the same invariants, so it is safe to - // convert. - IdentStr::ref_cast(&self.0) - } -} - -impl fmt::Display for Identifier { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", &self.0) - } -} - -/// A borrowed identifier. -/// -/// For more details, see the module level documentation. -#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd, RefCast)] -#[repr(transparent)] -pub struct IdentStr(str); - -impl IdentStr { - pub fn new(s: &str) -> Result<&IdentStr> { - if Self::is_valid(s) { - Ok(IdentStr::ref_cast(s)) - } else { - bail!("Invalid identifier '{}'", s); - } - } - - /// Returns true if this string is a valid identifier. - pub fn is_valid(s: impl AsRef) -> bool { - is_valid(s.as_ref()) - } - - /// Returns the length of `self` in bytes. - pub fn len(&self) -> usize { - self.0.len() - } - - /// Returns `true` if `self` has a length of zero bytes. - pub fn is_empty(&self) -> bool { - self.0.is_empty() - } - - /// Converts `self` to a `&str`. - /// - /// This is not implemented as a `From` trait to discourage automatic - /// conversions -- these conversions should not typically happen. - pub fn as_str(&self) -> &str { - &self.0 - } - - /// Converts `self` to a byte slice. - pub fn as_bytes(&self) -> &[u8] { - self.0.as_bytes() - } - - // AbstractMemorySize is not available for wasm32 - // - // /// Returns the abstract size of the struct - // /// TODO (ade): use macro to enfornce determinism - // pub fn abstract_size_for_gas_metering(&self) -> AbstractMemorySize { - // AbstractMemorySize::new((self.len()) as u64) - // } -} - -impl Borrow for Identifier { - fn borrow(&self) -> &IdentStr { - self - } -} - -impl Borrow for Identifier { - fn borrow(&self) -> &str { - &self.0 - } -} - -impl ToOwned for IdentStr { - type Owned = Identifier; - - fn to_owned(&self) -> Identifier { - Identifier(self.0.into()) - } -} - -impl fmt::Display for IdentStr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", &self.0) - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/language_storage.rs b/identity_iota_interaction/src/sdk_types/move_core_types/language_storage.rs deleted file mode 100644 index 8d9b677a24..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/language_storage.rs +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{ - fmt::{Display, Formatter}, - str::FromStr, -}; - -use serde::{Deserialize, Serialize}; - -use super::{ - account_address::AccountAddress, - identifier::{IdentStr, Identifier}, - parsing::types::{ParsedModuleId, ParsedStructType, ParsedType}, -}; - -pub const CODE_TAG: u8 = 0; -pub const RESOURCE_TAG: u8 = 1; - -/// Hex address: 0x1 -pub const CORE_CODE_ADDRESS: AccountAddress = AccountAddress::ONE; - -#[derive(Serialize, Deserialize, Debug, PartialEq, Hash, Eq, Clone, PartialOrd, Ord)] -pub enum TypeTag { - // alias for compatibility with old json serialized data. - #[serde(rename = "bool", alias = "Bool")] - Bool, - #[serde(rename = "u8", alias = "U8")] - U8, - #[serde(rename = "u64", alias = "U64")] - U64, - #[serde(rename = "u128", alias = "U128")] - U128, - #[serde(rename = "address", alias = "Address")] - Address, - #[serde(rename = "signer", alias = "Signer")] - Signer, - #[serde(rename = "vector", alias = "Vector")] - Vector(Box), - #[serde(rename = "struct", alias = "Struct")] - Struct(Box), - - // NOTE: Added in bytecode version v6, do not reorder! - #[serde(rename = "u16", alias = "U16")] - U16, - #[serde(rename = "u32", alias = "U32")] - U32, - #[serde(rename = "u256", alias = "U256")] - U256, -} - -impl TypeTag { - /// Return a canonical string representation of the type. All types are - /// represented using their source syntax: - /// - /// - "bool", "u8", "u16", "u32", "u64", "u128", "u256", "address", - /// "signer", "vector" for ground types. - /// - /// - Structs are represented as fully qualified type names, with or without - /// the prefix "0x" depending on the `with_prefix` flag, e.g. - /// `0x000...0001::string::String` or - /// `0x000...000a::m::T<0x000...000a::n::U>`. - /// - /// - Addresses are hex-encoded lowercase values of length 32 (zero-padded). - /// - /// Note: this function is guaranteed to be stable -- suitable for use - /// inside Move native functions or the VM. By contrast, this type's - /// `Display` implementation is subject to change and should be used - /// inside code that needs to return a stable output (e.g. that might be - /// committed to effects on-chain). - pub fn to_canonical_string(&self, with_prefix: bool) -> String { - self.to_canonical_display(with_prefix).to_string() - } - - /// Implements the canonical string representation of the type with optional - /// prefix 0x - pub fn to_canonical_display(&self, with_prefix: bool) -> impl std::fmt::Display + '_ { - struct CanonicalDisplay<'a> { - data: &'a TypeTag, - with_prefix: bool, - } - - impl std::fmt::Display for CanonicalDisplay<'_> { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self.data { - TypeTag::Bool => write!(f, "bool"), - TypeTag::U8 => write!(f, "u8"), - TypeTag::U16 => write!(f, "u16"), - TypeTag::U32 => write!(f, "u32"), - TypeTag::U64 => write!(f, "u64"), - TypeTag::U128 => write!(f, "u128"), - TypeTag::U256 => write!(f, "u256"), - TypeTag::Address => write!(f, "address"), - TypeTag::Signer => write!(f, "signer"), - TypeTag::Vector(t) => { - write!(f, "vector<{}>", t.to_canonical_display(self.with_prefix)) - } - TypeTag::Struct(s) => write!(f, "{}", s.to_canonical_display(self.with_prefix)), - } - } - } - - CanonicalDisplay { - data: self, - with_prefix, - } - } -} - -impl FromStr for TypeTag { - type Err = anyhow::Error; - - fn from_str(s: &str) -> Result { - ParsedType::parse(s)?.into_type_tag(&|_| None) - } -} - -#[derive(Serialize, Deserialize, Debug, PartialEq, Hash, Eq, Clone, PartialOrd, Ord)] -pub struct StructTag { - pub address: AccountAddress, - pub module: Identifier, - pub name: Identifier, - // alias for compatibility with old json serialized data. - #[serde(rename = "type_args", alias = "type_params")] - pub type_params: Vec, -} - -impl StructTag { - pub fn access_vector(&self) -> Vec { - let mut key = vec![RESOURCE_TAG]; - key.append(&mut bcs::to_bytes(self).unwrap()); - key - } - - /// Returns true if this is a `StructTag` for an `std::ascii::String` struct - /// defined in the standard library at address `move_std_addr`. - pub fn is_ascii_string(&self, move_std_addr: &AccountAddress) -> bool { - self.address == *move_std_addr - && self.module.as_str().eq("ascii") - && self.name.as_str().eq("String") - } - - /// Returns true if this is a `StructTag` for an `std::string::String` - /// struct defined in the standard library at address `move_std_addr`. - pub fn is_std_string(&self, move_std_addr: &AccountAddress) -> bool { - self.address == *move_std_addr - && self.module.as_str().eq("string") - && self.name.as_str().eq("String") - } - - pub fn module_id(&self) -> ModuleId { - ModuleId::new(self.address, self.module.to_owned()) - } - - /// Return a canonical string representation of the struct. - /// - /// - Structs are represented as fully qualified type names, with or without - /// the prefix "0x" depending on the `with_prefix` flag, e.g. - /// `0x000...0001::string::String` or - /// `0x000...000a::m::T<0x000...000a::n::U>`. - /// - /// - Addresses are hex-encoded lowercase values of length 32 (zero-padded). - /// - /// Note: this function is guaranteed to be stable -- suitable for use - /// inside Move native functions or the VM. By contrast, this type's - /// `Display` implementation is subject to change and should be used - /// inside code that needs to return a stable output (e.g. that might be - /// committed to effects on-chain). - pub fn to_canonical_string(&self, with_prefix: bool) -> String { - self.to_canonical_display(with_prefix).to_string() - } - - /// Implements the canonical string representation of the StructTag with - /// optional prefix 0x - pub fn to_canonical_display(&self, with_prefix: bool) -> impl std::fmt::Display + '_ { - struct CanonicalDisplay<'a> { - data: &'a StructTag, - with_prefix: bool, - } - - impl std::fmt::Display for CanonicalDisplay<'_> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}::{}::{}", - self.data.address.to_canonical_display(self.with_prefix), - self.data.module, - self.data.name - )?; - - if let Some(first_ty) = self.data.type_params.first() { - write!(f, "<")?; - write!(f, "{}", first_ty.to_canonical_display(self.with_prefix))?; - for ty in self.data.type_params.iter().skip(1) { - // Note that unlike Display for StructTag, there is no space between the - // comma and canonical display. This follows the - // original to_canonical_string() implementation. - write!(f, ",{}", ty.to_canonical_display(self.with_prefix))?; - } - write!(f, ">")?; - } - Ok(()) - } - } - - CanonicalDisplay { - data: self, - with_prefix, - } - } -} - -impl FromStr for StructTag { - type Err = anyhow::Error; - - fn from_str(s: &str) -> Result { - ParsedStructType::parse(s)?.into_struct_tag(&|_| None) - } -} - -/// Represents the initial key into global storage where we first index by the -/// address, and then the struct tag -#[derive(Serialize, Deserialize, Debug, PartialEq, Hash, Eq, Clone, PartialOrd, Ord)] -pub struct ModuleId { - address: AccountAddress, - name: Identifier, -} - -impl From for (AccountAddress, Identifier) { - fn from(module_id: ModuleId) -> Self { - (module_id.address, module_id.name) - } -} - -impl ModuleId { - pub fn new(address: AccountAddress, name: Identifier) -> Self { - ModuleId { address, name } - } - - pub fn name(&self) -> &IdentStr { - &self.name - } - - pub fn address(&self) -> &AccountAddress { - &self.address - } - - pub fn access_vector(&self) -> Vec { - let mut key = vec![CODE_TAG]; - key.append(&mut bcs::to_bytes(self).unwrap()); - key - } - - pub fn to_canonical_string(&self, with_prefix: bool) -> String { - self.to_canonical_display(with_prefix).to_string() - } - - /// Proxy type for overriding `ModuleId`'s display implementation, to use a - /// canonical form (full-width addresses), with an optional "0x" prefix - /// (controlled by the `with_prefix` flag). - pub fn to_canonical_display(&self, with_prefix: bool) -> impl Display + '_ { - struct IdDisplay<'a> { - id: &'a ModuleId, - with_prefix: bool, - } - - impl<'a> Display for IdDisplay<'a> { - fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - write!( - f, - "{}::{}", - self.id.address.to_canonical_display(self.with_prefix), - self.id.name, - ) - } - } - - IdDisplay { - id: self, - with_prefix, - } - } -} - -impl Display for ModuleId { - fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - write!(f, "{}", self.to_canonical_display(/* with_prefix */ false)) - } -} - -impl FromStr for ModuleId { - type Err = anyhow::Error; - fn from_str(s: &str) -> Result { - ParsedModuleId::parse(s)?.into_module_id(&|_| None) - } -} - -impl ModuleId { - pub fn short_str_lossless(&self) -> String { - format!("0x{}::{}", self.address.short_str_lossless(), self.name) - } -} - -impl Display for StructTag { - fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - write!( - f, - "0x{}::{}::{}", - self.address.short_str_lossless(), - self.module, - self.name - )?; - if let Some(first_ty) = self.type_params.first() { - write!(f, "<")?; - write!(f, "{}", first_ty)?; - for ty in self.type_params.iter().skip(1) { - write!(f, ", {}", ty)?; - } - write!(f, ">")?; - } - Ok(()) - } -} - -impl Display for TypeTag { - fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - match self { - TypeTag::Struct(s) => write!(f, "{}", s), - TypeTag::Vector(ty) => write!(f, "vector<{}>", ty), - TypeTag::U8 => write!(f, "u8"), - TypeTag::U16 => write!(f, "u16"), - TypeTag::U32 => write!(f, "u32"), - TypeTag::U64 => write!(f, "u64"), - TypeTag::U128 => write!(f, "u128"), - TypeTag::U256 => write!(f, "u256"), - TypeTag::Address => write!(f, "address"), - TypeTag::Signer => write!(f, "signer"), - TypeTag::Bool => write!(f, "bool"), - } - } -} - -impl From for TypeTag { - fn from(t: StructTag) -> TypeTag { - TypeTag::Struct(Box::new(t)) - } -} - diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/mod.rs b/identity_iota_interaction/src/sdk_types/move_core_types/mod.rs deleted file mode 100644 index c6278bedd1..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/mod.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub mod account_address; -pub mod annotated_value; -pub mod annotated_visitor; -pub mod identifier; -pub mod language_storage; -pub mod runtime_value; -pub mod u256; -pub mod parsing; - -use std::fmt; - -pub const VARIANT_COUNT_MAX: u64 = 127; - -pub(crate) fn fmt_list( - f: &mut fmt::Formatter<'_>, - begin: &str, - items: impl IntoIterator, - end: &str, -) -> fmt::Result { - write!(f, "{}", begin)?; - let mut items = items.into_iter(); - if let Some(x) = items.next() { - write!(f, "{}", x)?; - for x in items { - write!(f, ", {}", x)?; - } - } - write!(f, "{}", end)?; - Ok(()) -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/address.rs b/identity_iota_interaction/src/sdk_types/move_core_types/parsing/address.rs deleted file mode 100644 index 0ac720345d..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/address.rs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{fmt, hash::Hash}; -use std::option::Option::{self, Some, None}; -use std::string::String; - -use anyhow::anyhow; - -use super::super::account_address::AccountAddress; -use super::super::u256::U256; -use super::parser::{NumberFormat, parse_address_number}; - -// Parsed Address, either a name or a numerical address -#[derive(Eq, PartialEq, Debug, Clone)] -pub enum ParsedAddress { - Named(String), - Numerical(NumericalAddress), -} - -/// Numerical address represents non-named address values -/// or the assigned value of a named address -#[derive(Clone, Copy)] -pub struct NumericalAddress { - /// the number for the address - bytes: AccountAddress, - /// The format (e.g. decimal or hex) for displaying the number - format: NumberFormat, -} - -impl ParsedAddress { - pub fn into_account_address( - self, - mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result { - match self { - Self::Named(n) => { - mapping(n.as_str()).ok_or_else(|| anyhow!("Unbound named address: '{}'", n)) - } - Self::Numerical(a) => Ok(a.into_inner()), - } - } -} - -impl NumericalAddress { - // bytes used for errors when an address is not known but is needed - pub const DEFAULT_ERROR_ADDRESS: Self = NumericalAddress { - bytes: AccountAddress::ONE, - format: NumberFormat::Hex, - }; - - pub const fn new(bytes: [u8; AccountAddress::LENGTH], format: NumberFormat) -> Self { - Self { - bytes: AccountAddress::new(bytes), - format, - } - } - - pub fn into_inner(self) -> AccountAddress { - self.bytes - } - - pub fn into_bytes(self) -> [u8; AccountAddress::LENGTH] { - self.bytes.into_bytes() - } - - pub fn parse_str(s: &str) -> Result { - match parse_address_number(s) { - Some((n, format)) => Ok(NumericalAddress { bytes: n, format }), - None => - // TODO the kind of error is in an unstable nightly API - // But currently the only way this should fail is if the number is too long - { - Err(format!( - "Invalid address literal. The numeric value is too large. \ - The maximum size is {} bytes", - AccountAddress::LENGTH, - )) - } - } - } -} - -impl AsRef<[u8]> for NumericalAddress { - fn as_ref(&self) -> &[u8] { - self.bytes.as_ref() - } -} - -impl fmt::Display for NumericalAddress { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self.format { - NumberFormat::Decimal => { - let n = U256::from_be_bytes(&self.bytes); - write!(f, "{}", n) - } - NumberFormat::Hex => write!(f, "{:#X}", self), - } - } -} - -impl fmt::Debug for NumericalAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(self, f) - } -} - -impl fmt::UpperHex for NumericalAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let encoded = hex::encode_upper(self.as_ref()); - let dropped = encoded - .chars() - .skip_while(|c| c == &'0') - .collect::(); - let prefix = if f.alternate() { "0x" } else { "" }; - if dropped.is_empty() { - write!(f, "{}0", prefix) - } else { - write!(f, "{}{}", prefix, dropped) - } - } -} - -impl fmt::LowerHex for NumericalAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let encoded = hex::encode(self.as_ref()); - let dropped = encoded - .chars() - .skip_while(|c| c == &'0') - .collect::(); - let prefix = if f.alternate() { "0x" } else { "" }; - if dropped.is_empty() { - write!(f, "{}0", prefix) - } else { - write!(f, "{}{}", prefix, dropped) - } - } -} - -impl fmt::Display for ParsedAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Named(n) => write!(f, "{n}"), - Self::Numerical(a) => write!(f, "{a}"), - } - } -} - -impl PartialOrd for NumericalAddress { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} -impl Ord for NumericalAddress { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - let Self { - bytes: self_bytes, - format: _, - } = self; - let Self { - bytes: other_bytes, - format: _, - } = other; - self_bytes.cmp(other_bytes) - } -} - -impl PartialEq for NumericalAddress { - fn eq(&self, other: &Self) -> bool { - let Self { - bytes: self_bytes, - format: _, - } = self; - let Self { - bytes: other_bytes, - format: _, - } = other; - self_bytes == other_bytes - } -} -impl Eq for NumericalAddress {} - -impl PartialEq for NumericalAddress { - fn eq(&self, other: &AccountAddress) -> bool { - let Self { - bytes: self_bytes, - format: _, - } = self; - self_bytes == other - } -} - -impl Hash for NumericalAddress { - fn hash(&self, state: &mut H) { - let Self { - bytes: self_bytes, - format: _, - } = self; - self_bytes.hash(state) - } -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/mod.rs b/identity_iota_interaction/src/sdk_types/move_core_types/parsing/mod.rs deleted file mode 100644 index bdb2683bcd..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#![forbid(unsafe_code)] - -pub mod address; -pub mod parser; -pub mod types; -pub mod values; diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/parser.rs b/identity_iota_interaction/src/sdk_types/move_core_types/parsing/parser.rs deleted file mode 100644 index becea624dd..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/parser.rs +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{fmt::Display, iter::Peekable, num::ParseIntError}; - -use anyhow::{anyhow, bail, Result}; -use super::super::{ - account_address::AccountAddress, - u256::{U256FromStrError, U256}, -}; - -use super::{ - address::{NumericalAddress, ParsedAddress}, - types::{ParsedFqName, ParsedModuleId, ParsedStructType, ParsedType, TypeToken}, - values::{ParsableValue, ParsedValue, ValueToken}, -}; - -const MAX_TYPE_DEPTH: u64 = 128; -const MAX_TYPE_NODE_COUNT: u64 = 256; -// See: https://stackoverflow.com/questions/43787672/the-max-number-of-digits-in-an-int-based-on-number-of-bits -const U256_MAX_DECIMAL_DIGITS: usize = 241 * AccountAddress::LENGTH / 100 + 1; - -pub trait Token: Display + Copy + Eq { - fn is_whitespace(&self) -> bool; - fn next_token(s: &str) -> Result>; - fn tokenize(mut s: &str) -> Result> { - let mut v = vec![]; - while let Some((tok, n)) = Self::next_token(s)? { - v.push((tok, &s[..n])); - s = &s[n..]; - } - Ok(v) - } -} - -pub struct Parser<'a, Tok: Token, I: Iterator> { - count: u64, - it: Peekable, -} - -impl ParsedType { - pub fn parse(s: &str) -> Result { - parse(s, |parser| parser.parse_type()) - } -} - -impl ParsedModuleId { - pub fn parse(s: &str) -> Result { - parse(s, |parser| parser.parse_module_id()) - } -} - -impl ParsedFqName { - pub fn parse(s: &str) -> Result { - parse(s, |parser| parser.parse_fq_name()) - } -} - -impl ParsedStructType { - pub fn parse(s: &str) -> Result { - let ty = parse(s, |parser| parser.parse_type()) - .map_err(|e| anyhow!("Invalid struct type: {}. Got error: {}", s, e))?; - match ty { - ParsedType::Struct(s) => Ok(s), - _ => bail!("Invalid struct type: {}", s), - } - } -} - -impl ParsedAddress { - pub fn parse(s: &str) -> Result { - parse(s, |parser| parser.parse_address()) - } -} - -impl ParsedValue { - pub fn parse(s: &str) -> Result> { - parse(s, |parser| parser.parse_value()) - } -} - -pub(crate) fn parse<'a, Tok: Token, R>( - s: &'a str, - f: impl FnOnce(&mut Parser<'a, Tok, std::vec::IntoIter<(Tok, &'a str)>>) -> Result, -) -> Result { - let tokens: Vec<_> = Tok::tokenize(s)? - .into_iter() - .filter(|(tok, _)| !tok.is_whitespace()) - .collect(); - let mut parser = Parser::new(tokens); - let res = f(&mut parser)?; - if let Ok((_, contents)) = parser.advance_any() { - bail!("Expected end of token stream. Got: {}", contents) - } - Ok(res) -} - -impl<'a, Tok: Token, I: Iterator> Parser<'a, Tok, I> { - pub fn new>(v: T) -> Self { - Self { - count: 0, - it: v.into_iter().peekable(), - } - } - - pub fn advance_any(&mut self) -> Result<(Tok, &'a str)> { - match self.it.next() { - Some(tok) => Ok(tok), - None => bail!("unexpected end of tokens"), - } - } - - pub fn advance(&mut self, expected_token: Tok) -> Result<&'a str> { - let (t, contents) = self.advance_any()?; - if t != expected_token { - bail!("expected token {}, got {}", expected_token, t) - } - Ok(contents) - } - - pub fn peek(&mut self) -> Option<(Tok, &'a str)> { - self.it.peek().copied() - } - - pub fn peek_tok(&mut self) -> Option { - self.it.peek().map(|(tok, _)| *tok) - } - - pub fn parse_list( - &mut self, - parse_list_item: impl Fn(&mut Self) -> Result, - delim: Tok, - end_token: Tok, - allow_trailing_delim: bool, - ) -> Result> { - let is_end = - |tok_opt: Option| -> bool { tok_opt.map(|tok| tok == end_token).unwrap_or(true) }; - let mut v = vec![]; - while !is_end(self.peek_tok()) { - v.push(parse_list_item(self)?); - if is_end(self.peek_tok()) { - break; - } - self.advance(delim)?; - if is_end(self.peek_tok()) { - if allow_trailing_delim { - break; - } else { - bail!("Invalid type list: trailing delimiter '{}'", delim) - } - } - } - Ok(v) - } -} - -impl<'a, I: Iterator> Parser<'a, TypeToken, I> { - pub fn parse_module_id(&mut self) -> Result { - let (tok, contents) = self.advance_any()?; - self.parse_module_id_impl(tok, contents) - } - - pub fn parse_fq_name(&mut self) -> Result { - let (tok, contents) = self.advance_any()?; - self.parse_fq_name_impl(tok, contents) - } - - pub fn parse_type(&mut self) -> Result { - self.parse_type_impl(0) - } - - pub fn parse_module_id_impl( - &mut self, - tok: TypeToken, - contents: &'a str, - ) -> Result { - let tok = match tok { - TypeToken::Ident => ValueToken::Ident, - TypeToken::AddressIdent => ValueToken::Number, - tok => bail!("unexpected token {tok}, expected address"), - }; - let address = parse_address_impl(tok, contents)?; - self.advance(TypeToken::ColonColon)?; - let name = self.advance(TypeToken::Ident)?.to_owned(); - Ok(ParsedModuleId { address, name }) - } - - pub fn parse_fq_name_impl( - &mut self, - tok: TypeToken, - contents: &'a str, - ) -> Result { - let module = self.parse_module_id_impl(tok, contents)?; - self.advance(TypeToken::ColonColon)?; - let name = self.advance(TypeToken::Ident)?.to_owned(); - Ok(ParsedFqName { module, name }) - } - - fn parse_type_impl(&mut self, depth: u64) -> Result { - self.count += 1; - - if depth > MAX_TYPE_DEPTH || self.count > MAX_TYPE_NODE_COUNT { - bail!("Type exceeds maximum nesting depth or node count") - } - - Ok(match self.advance_any()? { - (TypeToken::Ident, "u8") => ParsedType::U8, - (TypeToken::Ident, "u16") => ParsedType::U16, - (TypeToken::Ident, "u32") => ParsedType::U32, - (TypeToken::Ident, "u64") => ParsedType::U64, - (TypeToken::Ident, "u128") => ParsedType::U128, - (TypeToken::Ident, "u256") => ParsedType::U256, - (TypeToken::Ident, "bool") => ParsedType::Bool, - (TypeToken::Ident, "address") => ParsedType::Address, - (TypeToken::Ident, "signer") => ParsedType::Signer, - (TypeToken::Ident, "vector") => { - self.advance(TypeToken::Lt)?; - let ty = self.parse_type_impl(depth + 1)?; - self.advance(TypeToken::Gt)?; - ParsedType::Vector(Box::new(ty)) - } - - (tok @ (TypeToken::Ident | TypeToken::AddressIdent), contents) => { - let fq_name = self.parse_fq_name_impl(tok, contents)?; - let type_args = match self.peek_tok() { - Some(TypeToken::Lt) => { - self.advance(TypeToken::Lt)?; - let type_args = self.parse_list( - |parser| parser.parse_type_impl(depth + 1), - TypeToken::Comma, - TypeToken::Gt, - true, - )?; - self.advance(TypeToken::Gt)?; - if type_args.is_empty() { - bail!("expected at least one type argument") - } - type_args - } - _ => vec![], - }; - ParsedType::Struct(ParsedStructType { fq_name, type_args }) - } - (tok, _) => bail!("unexpected token {tok}, expected type"), - }) - } -} - -impl<'a, I: Iterator> Parser<'a, ValueToken, I> { - pub fn parse_value(&mut self) -> Result> { - if let Some(extra) = Extra::parse_value(self) { - return Ok(ParsedValue::Custom(extra?)); - } - let (tok, contents) = self.advance_any()?; - Ok(match tok { - ValueToken::Number if !matches!(self.peek_tok(), Some(ValueToken::ColonColon)) => { - let (u, _) = parse_u256(contents)?; - ParsedValue::InferredNum(u) - } - ValueToken::NumberTyped => { - if let Some(s) = contents.strip_suffix("u8") { - let (u, _) = parse_u8(s)?; - ParsedValue::U8(u) - } else if let Some(s) = contents.strip_suffix("u16") { - let (u, _) = parse_u16(s)?; - ParsedValue::U16(u) - } else if let Some(s) = contents.strip_suffix("u32") { - let (u, _) = parse_u32(s)?; - ParsedValue::U32(u) - } else if let Some(s) = contents.strip_suffix("u64") { - let (u, _) = parse_u64(s)?; - ParsedValue::U64(u) - } else if let Some(s) = contents.strip_suffix("u128") { - let (u, _) = parse_u128(s)?; - ParsedValue::U128(u) - } else { - let (u, _) = parse_u256(contents.strip_suffix("u256").unwrap())?; - ParsedValue::U256(u) - } - } - ValueToken::True => ParsedValue::Bool(true), - ValueToken::False => ParsedValue::Bool(false), - - ValueToken::ByteString => { - let contents = contents - .strip_prefix("b\"") - .unwrap() - .strip_suffix('\"') - .unwrap(); - ParsedValue::Vector( - contents - .as_bytes() - .iter() - .copied() - .map(ParsedValue::U8) - .collect(), - ) - } - ValueToken::HexString => { - let contents = contents - .strip_prefix("x\"") - .unwrap() - .strip_suffix('\"') - .unwrap() - .to_ascii_lowercase(); - ParsedValue::Vector( - hex::decode(contents) - .unwrap() - .into_iter() - .map(ParsedValue::U8) - .collect(), - ) - } - ValueToken::Utf8String => { - let contents = contents - .strip_prefix('\"') - .unwrap() - .strip_suffix('\"') - .unwrap(); - ParsedValue::Vector( - contents - .as_bytes() - .iter() - .copied() - .map(ParsedValue::U8) - .collect(), - ) - } - - ValueToken::AtSign => ParsedValue::Address(self.parse_address()?), - - ValueToken::Ident if contents == "vector" => { - self.advance(ValueToken::LBracket)?; - let values = self.parse_list( - |parser| parser.parse_value(), - ValueToken::Comma, - ValueToken::RBracket, - true, - )?; - self.advance(ValueToken::RBracket)?; - ParsedValue::Vector(values) - } - - ValueToken::Ident if contents == "struct" => { - self.advance(ValueToken::LParen)?; - let values = self.parse_list( - |parser| parser.parse_value(), - ValueToken::Comma, - ValueToken::RParen, - true, - )?; - self.advance(ValueToken::RParen)?; - ParsedValue::Struct(values) - } - - _ => bail!("unexpected token {}, expected type", tok), - }) - } - - pub fn parse_address(&mut self) -> Result { - let (tok, contents) = self.advance_any()?; - parse_address_impl(tok, contents) - } -} - -pub fn parse_address_impl(tok: ValueToken, contents: &str) -> Result { - Ok(match tok { - ValueToken::Number => { - ParsedAddress::Numerical(NumericalAddress::parse_str(contents).map_err(|s| { - anyhow!( - "Failed to parse numerical address '{}'. Got error: {}", - contents, - s - ) - })?) - } - ValueToken::Ident => ParsedAddress::Named(contents.to_owned()), - _ => bail!("unexpected token {}, expected identifier or number", tok), - }) -} - -#[derive(Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Copy)] -#[repr(u32)] -/// Number format enum, the u32 value represents the base -pub enum NumberFormat { - Decimal = 10, - Hex = 16, -} - -// Determines the base of the number literal, depending on the prefix -pub(crate) fn determine_num_text_and_base(s: &str) -> (&str, NumberFormat) { - match s.strip_prefix("0x") { - Some(s_hex) => (s_hex, NumberFormat::Hex), - None => (s, NumberFormat::Decimal), - } -} - -// Parse a u8 from a decimal or hex encoding -pub fn parse_u8(s: &str) -> Result<(u8, NumberFormat), ParseIntError> { - let (txt, base) = determine_num_text_and_base(s); - Ok(( - u8::from_str_radix(&txt.replace('_', ""), base as u32)?, - base, - )) -} - -// Parse a u16 from a decimal or hex encoding -pub fn parse_u16(s: &str) -> Result<(u16, NumberFormat), ParseIntError> { - let (txt, base) = determine_num_text_and_base(s); - Ok(( - u16::from_str_radix(&txt.replace('_', ""), base as u32)?, - base, - )) -} - -// Parse a u32 from a decimal or hex encoding -pub fn parse_u32(s: &str) -> Result<(u32, NumberFormat), ParseIntError> { - let (txt, base) = determine_num_text_and_base(s); - Ok(( - u32::from_str_radix(&txt.replace('_', ""), base as u32)?, - base, - )) -} - -// Parse a u64 from a decimal or hex encoding -pub fn parse_u64(s: &str) -> Result<(u64, NumberFormat), ParseIntError> { - let (txt, base) = determine_num_text_and_base(s); - Ok(( - u64::from_str_radix(&txt.replace('_', ""), base as u32)?, - base, - )) -} - -// Parse a u128 from a decimal or hex encoding -pub fn parse_u128(s: &str) -> Result<(u128, NumberFormat), ParseIntError> { - let (txt, base) = determine_num_text_and_base(s); - Ok(( - u128::from_str_radix(&txt.replace('_', ""), base as u32)?, - base, - )) -} - -// Parse a u256 from a decimal or hex encoding -pub fn parse_u256(s: &str) -> Result<(U256, NumberFormat), U256FromStrError> { - let (txt, base) = determine_num_text_and_base(s); - Ok(( - U256::from_str_radix(&txt.replace('_', ""), base as u32)?, - base, - )) -} - -// Parse an address from a decimal or hex encoding -pub fn parse_address_number(s: &str) -> Option<(AccountAddress, NumberFormat)> { - let (txt, base) = determine_num_text_and_base(s); - let txt = txt.replace('_', ""); - let max_len = match base { - NumberFormat::Hex => AccountAddress::LENGTH * 2, - NumberFormat::Decimal => U256_MAX_DECIMAL_DIGITS, - }; - if txt.len() > max_len { - return None; - } - let parsed = U256::from_str_radix(&txt, match base { - NumberFormat::Hex => 16, - NumberFormat::Decimal => 10, - }) - .ok()?; - Some((AccountAddress::new(parsed.to_be_bytes()), base)) -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/types.rs b/identity_iota_interaction/src/sdk_types/move_core_types/parsing/types.rs deleted file mode 100644 index 2dc1142baf..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/types.rs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::fmt::{self, Display}; - -use anyhow::{bail}; -use super::super::{ - account_address::AccountAddress, - identifier::{self, Identifier}, - language_storage::{StructTag, TypeTag, ModuleId} -}; - -use super::{address::ParsedAddress, parser::Token}; - -#[derive(Eq, PartialEq, Debug, Clone, Copy)] -pub enum TypeToken { - Whitespace, - Ident, - AddressIdent, - ColonColon, - Lt, - Gt, - Comma, -} - -#[derive(Eq, PartialEq, Debug, Clone)] -pub struct ParsedModuleId { - pub address: ParsedAddress, - pub name: String, -} - -#[derive(Eq, PartialEq, Debug, Clone)] -pub struct ParsedFqName { - pub module: ParsedModuleId, - pub name: String, -} - -#[derive(Eq, PartialEq, Debug, Clone)] -pub struct ParsedStructType { - pub fq_name: ParsedFqName, - pub type_args: Vec, -} - -#[derive(Eq, PartialEq, Debug, Clone)] -pub enum ParsedType { - U8, - U16, - U32, - U64, - U128, - U256, - Bool, - Address, - Signer, - Vector(Box), - Struct(ParsedStructType), -} - -impl Display for TypeToken { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - let s = match *self { - TypeToken::Whitespace => "[whitespace]", - TypeToken::Ident => "[identifier]", - TypeToken::AddressIdent => "[address]", - TypeToken::ColonColon => "::", - TypeToken::Lt => "<", - TypeToken::Gt => ">", - TypeToken::Comma => ",", - }; - fmt::Display::fmt(s, formatter) - } -} - -impl Token for TypeToken { - fn is_whitespace(&self) -> bool { - matches!(self, Self::Whitespace) - } - - fn next_token(s: &str) -> anyhow::Result> { - let mut chars = s.chars().peekable(); - - let c = match chars.next() { - None => return Ok(None), - Some(c) => c, - }; - Ok(Some(match c { - '<' => (Self::Lt, 1), - '>' => (Self::Gt, 1), - ',' => (Self::Comma, 1), - ':' => match chars.next() { - Some(':') => (Self::ColonColon, 2), - _ => bail!("unrecognized token: {}", s), - }, - '0' if matches!(chars.peek(), Some('x')) => { - chars.next().unwrap(); - match chars.next() { - Some(c) if c.is_ascii_hexdigit() => { - // 0x + c + remaining - let len = 3 + chars - .take_while(|q| char::is_ascii_hexdigit(q) || *q == '_') - .count(); - (Self::AddressIdent, len) - } - _ => bail!("unrecognized token: {}", s), - } - } - c if c.is_ascii_digit() => { - // c + remaining - let len = 1 + chars - .take_while(|c| c.is_ascii_digit() || *c == '_') - .count(); - (Self::AddressIdent, len) - } - c if c.is_ascii_whitespace() => { - // c + remaining - let len = 1 + chars.take_while(char::is_ascii_whitespace).count(); - (Self::Whitespace, len) - } - c if c.is_ascii_alphabetic() - || (c == '_' - && chars - .peek() - .is_some_and(|c| identifier::is_valid_identifier_char(*c))) => - { - // c + remaining - let len = 1 + chars - .take_while(|c| identifier::is_valid_identifier_char(*c)) - .count(); - (Self::Ident, len) - } - _ => bail!("unrecognized token: {}", s), - })) - } -} - -impl ParsedModuleId { - pub fn into_module_id( - self, - mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result { - Ok(ModuleId::new( - self.address.into_account_address(mapping)?, - Identifier::new(self.name)?, - )) - } -} - -impl ParsedFqName { - pub fn into_fq_name( - self, - mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result<(ModuleId, String)> { - Ok((self.module.into_module_id(mapping)?, self.name)) - } -} - -impl ParsedStructType { - pub fn into_struct_tag( - self, - mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result { - let Self { fq_name, type_args } = self; - Ok(StructTag { - address: fq_name.module.address.into_account_address(mapping)?, - module: Identifier::new(fq_name.module.name)?, - name: Identifier::new(fq_name.name)?, - type_params: type_args - .into_iter() - .map(|t| t.into_type_tag(mapping)) - .collect::>()?, - }) - } -} - -impl ParsedType { - pub fn into_type_tag( - self, - mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result { - Ok(match self { - ParsedType::U8 => TypeTag::U8, - ParsedType::U16 => TypeTag::U16, - ParsedType::U32 => TypeTag::U32, - ParsedType::U64 => TypeTag::U64, - ParsedType::U128 => TypeTag::U128, - ParsedType::U256 => TypeTag::U256, - ParsedType::Bool => TypeTag::Bool, - ParsedType::Address => TypeTag::Address, - ParsedType::Signer => TypeTag::Signer, - ParsedType::Vector(inner) => TypeTag::Vector(Box::new(inner.into_type_tag(mapping)?)), - ParsedType::Struct(s) => TypeTag::Struct(Box::new(s.into_struct_tag(mapping)?)), - }) - } -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/values.rs b/identity_iota_interaction/src/sdk_types/move_core_types/parsing/values.rs deleted file mode 100644 index 1ad1322e22..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/parsing/values.rs +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::fmt::{self, Display}; - -use anyhow::bail; - -use super::super::{ - account_address::AccountAddress, - identifier, - runtime_value::{MoveStruct, MoveValue}, - u256::U256, -}; - -use super::{ - address::ParsedAddress, - parser::{Parser, Token}, -}; - -#[derive(Eq, PartialEq, Debug, Clone, Copy)] -pub enum ValueToken { - Number, - NumberTyped, - True, - False, - ByteString, - HexString, - Utf8String, - Ident, - AtSign, - LBrace, - RBrace, - LBracket, - RBracket, - LParen, - RParen, - Comma, - Colon, - ColonColon, - Whitespace, -} - -#[derive(Eq, PartialEq, Debug, Clone)] -pub enum ParsedValue { - Address(ParsedAddress), - InferredNum(U256), // Imported at the top of this file - U8(u8), - U16(u16), - U32(u32), - U64(u64), - U128(u128), - U256(U256), // Imported at the top of this file - Bool(bool), - Vector(Vec>), - Struct(Vec>), - Custom(Extra), -} - -pub trait ParsableValue: Sized + Send + Sync + Clone + 'static { - type ConcreteValue: Send; - fn parse_value<'a, I: Iterator>( - parser: &mut Parser<'a, ValueToken, I>, - ) -> Option>; - - fn move_value_into_concrete(v: MoveValue) -> anyhow::Result; - fn concrete_vector(elems: Vec) -> anyhow::Result; - fn concrete_struct(values: Vec) -> anyhow::Result; - fn into_concrete_value( - self, - mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result; -} - -impl ParsableValue for () { - type ConcreteValue = MoveValue; - fn parse_value<'a, I: Iterator>( - _: &mut Parser<'a, ValueToken, I>, - ) -> Option> { - None - } - fn move_value_into_concrete(v: MoveValue) -> anyhow::Result { - Ok(v) - } - - fn concrete_vector(elems: Vec) -> anyhow::Result { - Ok(MoveValue::Vector(elems)) - } - - fn concrete_struct(values: Vec) -> anyhow::Result { - Ok(MoveValue::Struct(MoveStruct(values))) - } - fn into_concrete_value( - self, - _mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result { - unreachable!() - } -} - -impl Display for ValueToken { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - let s = match self { - ValueToken::Number => "[num]", - ValueToken::NumberTyped => "[num typed]", - ValueToken::True => "true", - ValueToken::False => "false", - ValueToken::ByteString => "[byte string]", - ValueToken::Utf8String => "[utf8 string]", - ValueToken::HexString => "[hex string]", - ValueToken::Whitespace => "[whitespace]", - ValueToken::Ident => "[identifier]", - ValueToken::AtSign => "@", - ValueToken::LBrace => "{", - ValueToken::RBrace => "}", - ValueToken::LBracket => "[", - ValueToken::RBracket => "]", - ValueToken::LParen => "(", - ValueToken::RParen => ")", - ValueToken::Comma => ",", - ValueToken::Colon => ":", - ValueToken::ColonColon => "::", - }; - fmt::Display::fmt(s, formatter) - } -} - -impl Token for ValueToken { - fn is_whitespace(&self) -> bool { - matches!(self, Self::Whitespace) - } - - fn next_token(s: &str) -> anyhow::Result> { - fn number_maybe_with_suffix(text: &str, num_text_len: usize) -> (ValueToken, usize) { - let rest = &text[num_text_len..]; - if rest.starts_with("u8") { - (ValueToken::NumberTyped, num_text_len + 2) - } else if rest.starts_with("u64") || rest.starts_with("u16") || rest.starts_with("u32") - { - (ValueToken::NumberTyped, num_text_len + 3) - } else if rest.starts_with("u128") || rest.starts_with("u256") { - (ValueToken::NumberTyped, num_text_len + 4) - } else { - // No typed suffix - (ValueToken::Number, num_text_len) - } - } - if s.starts_with("true") { - return Ok(Some((Self::True, 4))); - } - if s.starts_with("false") { - return Ok(Some((Self::False, 5))); - } - - let mut chars = s.chars().peekable(); - let c = match chars.next() { - None => return Ok(None), - Some(c) => c, - }; - Ok(Some(match c { - '@' => (Self::AtSign, 1), - '{' => (Self::LBrace, 1), - '}' => (Self::RBrace, 1), - '[' => (Self::LBracket, 1), - ']' => (Self::RBracket, 1), - '(' => (Self::LParen, 1), - ')' => (Self::RParen, 1), - ',' => (Self::Comma, 1), - ':' if matches!(chars.peek(), Some(':')) => (Self::ColonColon, 2), - ':' => (Self::Colon, 1), - '0' if matches!(chars.peek(), Some('x')) => { - chars.next().unwrap(); - match chars.next() { - Some(c) if c.is_ascii_hexdigit() => { - let len = 3 + chars - .take_while(|c| char::is_ascii_hexdigit(c) || *c == '_') - .count(); - number_maybe_with_suffix(s, len) - } - _ => bail!("unrecognized token: {}", s), - } - } - 'b' if matches!(chars.peek(), Some('"')) => { - chars.next().unwrap(); - // b" - let mut len = 2; - loop { - len += 1; - match chars.next() { - Some('"') => break, - Some(c) if c.is_ascii() => (), - Some(c) => bail!( - "Unexpected non-ascii character '{}' in byte string: {}", - c.escape_default(), - s - ), - None => bail!("Unexpected end of string before end quote: {}", s), - } - } - if s[..len].chars().any(|c| c == '\\') { - bail!( - "Escape characters not yet supported in byte string: {}", - &s[..len] - ) - } - (ValueToken::ByteString, len) - } - 'x' if matches!(chars.peek(), Some('"')) => { - chars.next().unwrap(); - // x" - let mut len = 2; - loop { - len += 1; - match chars.next() { - Some('"') => break, - Some(c) if c.is_ascii_hexdigit() => (), - Some(c) => bail!( - "Unexpected non-hexdigit '{}' in hex string: {}", - c.escape_default(), - s - ), - None => bail!("Unexpected end of string before end quote: {}", s), - } - } - assert!(len >= 3); - let num_digits = len - 3; - if num_digits % 2 != 0 { - bail!( - "Expected an even number of hex digits in hex string: {}", - &s[..len] - ) - } - (ValueToken::HexString, len) - } - '"' => { - // there is no need to check if a given char is valid UTF8 as it is already - // guaranteed; from the Rust docs - // (https://doc.rust-lang.org/std/primitive.char.html): "char values are USVs and - // str values are valid UTF-8, it is safe to store any char in a str or read any - // character from a str as a char"; this means that while not every char is - // valid UTF8, those stored in &str are - let end_quote_byte_offset = match s[1..].find('"') { - Some(o) => o, - None => bail!("Unexpected end of string before end quote: {}", s), - }; - // the length of the token (which we need in bytes rather than chars as s is - // sliced in parser and slicing str uses byte indexes) is the - // same as position of the ending double quote (in the whole - // string) plus 1 - let len = s[..1].len() + end_quote_byte_offset + 1; - if s[..len].chars().any(|c| c == '\\') { - bail!( - "Escape characters not yet supported in utf8 string: {}", - &s[..len] - ) - } - (ValueToken::Utf8String, len) - } - c if c.is_ascii_digit() => { - // c + remaining - let len = 1 + chars - .take_while(|c| char::is_ascii_digit(c) || *c == '_') - .count(); - number_maybe_with_suffix(s, len) - } - c if c.is_ascii_whitespace() => { - // c + remaining - let len = 1 + chars.take_while(char::is_ascii_whitespace).count(); - (Self::Whitespace, len) - } - c if c.is_ascii_alphabetic() => { - // c + remaining - // TODO be more permissive - let len = 1 + chars - .take_while(|c| identifier::is_valid_identifier_char(*c)) - .count(); - (Self::Ident, len) - } - _ => bail!("unrecognized token: {}", s), - })) - } -} - -impl ParsedValue { - pub fn into_concrete_value( - self, - mapping: &impl Fn(&str) -> Option, - ) -> anyhow::Result { - match self { - ParsedValue::Address(a) => Extra::move_value_into_concrete(MoveValue::Address( - a.into_account_address(mapping)?, - )), - ParsedValue::U8(u) => Extra::move_value_into_concrete(MoveValue::U8(u)), - ParsedValue::U16(u) => Extra::move_value_into_concrete(MoveValue::U16(u)), - ParsedValue::U32(u) => Extra::move_value_into_concrete(MoveValue::U32(u)), - ParsedValue::U64(u) => Extra::move_value_into_concrete(MoveValue::U64(u)), - ParsedValue::InferredNum(u) if u <= (u64::MAX.into()) => { - Extra::move_value_into_concrete(MoveValue::U64(u.try_into()?)) - } - ParsedValue::U128(u) => Extra::move_value_into_concrete(MoveValue::U128(u)), - ParsedValue::InferredNum(u) | ParsedValue::U256(u) => { - Extra::move_value_into_concrete(MoveValue::U256(u)) - } - ParsedValue::Bool(b) => Extra::move_value_into_concrete(MoveValue::Bool(b)), - ParsedValue::Vector(values) => Extra::concrete_vector( - values - .into_iter() - .map(|value| value.into_concrete_value(mapping)) - .collect::>()?, - ), - ParsedValue::Struct(values) => Extra::concrete_struct( - values - .into_iter() - .map(|value| value.into_concrete_value(mapping)) - .collect::>()?, - ), - ParsedValue::Custom(c) => Extra::into_concrete_value(c, mapping), - } - } -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/runtime_value.rs b/identity_iota_interaction/src/sdk_types/move_core_types/runtime_value.rs deleted file mode 100644 index ad6cfc1150..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/runtime_value.rs +++ /dev/null @@ -1,584 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use super::{ - account_address::AccountAddress, annotated_value as A, fmt_list, u256, VARIANT_COUNT_MAX, -}; -use anyhow::{anyhow, Result as AResult}; -// use move_proc_macros::test_variant_order; -use serde::{ - de::Error as DeError, - ser::{SerializeSeq, SerializeTuple}, - Deserialize, Serialize, -}; -use std::fmt::{self, Debug}; - -/// In the `WithTypes` configuration, a Move struct gets serialized into a Serde -/// struct with this name -pub const MOVE_STRUCT_NAME: &str = "struct"; - -/// In the `WithTypes` configuration, a Move struct gets serialized into a Serde -/// struct with this as the first field -pub const MOVE_STRUCT_TYPE: &str = "type"; - -/// In the `WithTypes` configuration, a Move struct gets serialized into a Serde -/// struct with this as the second field -pub const MOVE_STRUCT_FIELDS: &str = "fields"; - -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct MoveStruct(pub Vec); - -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct MoveVariant { - pub tag: u16, - pub fields: Vec, -} - -#[derive(Debug, PartialEq, Eq, Clone)] -pub enum MoveValue { - U8(u8), - U64(u64), - U128(u128), - Bool(bool), - Address(AccountAddress), - Vector(Vec), - Struct(MoveStruct), - Signer(AccountAddress), - // NOTE: Added in bytecode version v6, do not reorder! - U16(u16), - U32(u32), - U256(u256::U256), - Variant(MoveVariant), -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct MoveStructLayout(pub Box>); - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct MoveEnumLayout(pub Box>>); - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum MoveDatatypeLayout { - Struct(Box), - Enum(Box), -} - -impl MoveDatatypeLayout { - pub fn into_layout(self) -> MoveTypeLayout { - match self { - MoveDatatypeLayout::Struct(layout) => MoveTypeLayout::Struct(layout), - MoveDatatypeLayout::Enum(layout) => MoveTypeLayout::Enum(layout), - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum MoveTypeLayout { - #[serde(rename(serialize = "bool", deserialize = "bool"))] - Bool, - #[serde(rename(serialize = "u8", deserialize = "u8"))] - U8, - #[serde(rename(serialize = "u64", deserialize = "u64"))] - U64, - #[serde(rename(serialize = "u128", deserialize = "u128"))] - U128, - #[serde(rename(serialize = "address", deserialize = "address"))] - Address, - #[serde(rename(serialize = "vector", deserialize = "vector"))] - Vector(Box), - #[serde(rename(serialize = "struct", deserialize = "struct"))] - Struct(Box), - #[serde(rename(serialize = "signer", deserialize = "signer"))] - Signer, - - // NOTE: Added in bytecode version v6, do not reorder! - #[serde(rename(serialize = "u16", deserialize = "u16"))] - U16, - #[serde(rename(serialize = "u32", deserialize = "u32"))] - U32, - #[serde(rename(serialize = "u256", deserialize = "u256"))] - U256, - #[serde(rename(serialize = "enum", deserialize = "enum"))] - Enum(Box), -} - -impl MoveValue { - pub fn simple_deserialize(blob: &[u8], ty: &MoveTypeLayout) -> AResult { - Ok(bcs::from_bytes_seed(ty, blob)?) - } - - pub fn simple_serialize(&self) -> Option> { - bcs::to_bytes(self).ok() - } - - pub fn vector_u8(v: Vec) -> Self { - MoveValue::Vector(v.into_iter().map(MoveValue::U8).collect()) - } - - /// Converts the `Vec` to a `Vec` if the inner `MoveValue` is - /// a `MoveValue::U8`, or returns an error otherwise. - pub fn vec_to_vec_u8(vec: Vec) -> AResult> { - let mut vec_u8 = Vec::with_capacity(vec.len()); - - for byte in vec { - match byte { - MoveValue::U8(u8) => { - vec_u8.push(u8); - } - _ => { - return Err(anyhow!( - "Expected inner MoveValue in Vec to be a MoveValue::U8" - .to_string(), - )); - } - } - } - Ok(vec_u8) - } - - pub fn vector_address(v: Vec) -> Self { - MoveValue::Vector(v.into_iter().map(MoveValue::Address).collect()) - } - - pub fn decorate(self, layout: &A::MoveTypeLayout) -> A::MoveValue { - match (self, layout) { - (MoveValue::Struct(s), A::MoveTypeLayout::Struct(l)) => { - A::MoveValue::Struct(s.decorate(l)) - } - (MoveValue::Variant(s), A::MoveTypeLayout::Enum(l)) => { - A::MoveValue::Variant(s.decorate(l)) - } - (MoveValue::Vector(vals), A::MoveTypeLayout::Vector(t)) => { - A::MoveValue::Vector(vals.into_iter().map(|v| v.decorate(t)).collect()) - } - (MoveValue::U8(a), _) => A::MoveValue::U8(a), - (MoveValue::U64(u), _) => A::MoveValue::U64(u), - (MoveValue::U128(u), _) => A::MoveValue::U128(u), - (MoveValue::Bool(b), _) => A::MoveValue::Bool(b), - (MoveValue::Address(a), _) => A::MoveValue::Address(a), - (MoveValue::Signer(a), _) => A::MoveValue::Signer(a), - (MoveValue::U16(u), _) => A::MoveValue::U16(u), - (MoveValue::U32(u), _) => A::MoveValue::U32(u), - (MoveValue::U256(u), _) => A::MoveValue::U256(u), - _ => panic!("Invalid decoration"), - } - } -} - -pub fn serialize_values<'a, I>(vals: I) -> Vec> -where - I: IntoIterator, -{ - vals.into_iter() - .map(|val| { - val.simple_serialize() - .expect("serialization should succeed") - }) - .collect() -} - -impl MoveStruct { - pub fn new(value: Vec) -> Self { - Self(value) - } - - pub fn simple_deserialize(blob: &[u8], ty: &MoveStructLayout) -> AResult { - Ok(bcs::from_bytes_seed(ty, blob)?) - } - - pub fn decorate(self, layout: &A::MoveStructLayout) -> A::MoveStruct { - let MoveStruct(vals) = self; - let A::MoveStructLayout { type_, fields } = layout; - A::MoveStruct { - type_: type_.clone(), - fields: vals - .into_iter() - .zip(fields.iter()) - .map(|(v, l)| (l.name.clone(), v.decorate(&l.layout))) - .collect(), - } - } - - pub fn fields(&self) -> &[MoveValue] { - &self.0 - } - - pub fn into_fields(self) -> Vec { - self.0 - } -} - -impl MoveVariant { - pub fn new(tag: u16, fields: Vec) -> Self { - Self { tag, fields } - } - - pub fn simple_deserialize(blob: &[u8], ty: &MoveEnumLayout) -> AResult { - Ok(bcs::from_bytes_seed(ty, blob)?) - } - - pub fn decorate(self, layout: &A::MoveEnumLayout) -> A::MoveVariant { - let MoveVariant { tag, fields } = self; - let A::MoveEnumLayout { type_, variants } = layout; - let ((v_name, _), v_layout) = variants - .iter() - .find(|((_, v_tag), _)| *v_tag == tag) - .unwrap(); - A::MoveVariant { - type_: type_.clone(), - tag, - fields: fields - .into_iter() - .zip(v_layout.iter()) - .map(|(v, l)| (l.name.clone(), v.decorate(&l.layout))) - .collect(), - variant_name: v_name.clone(), - } - } - - pub fn fields(&self) -> &[MoveValue] { - &self.fields - } - - pub fn into_fields(self) -> Vec { - self.fields - } -} - -impl MoveStructLayout { - pub fn new(types: Vec) -> Self { - Self(Box::new(types)) - } - - pub fn fields(&self) -> &[MoveTypeLayout] { - &self.0 - } - - pub fn into_fields(self) -> Vec { - *self.0 - } -} - -impl<'d> serde::de::DeserializeSeed<'d> for &MoveTypeLayout { - type Value = MoveValue; - fn deserialize>( - self, - deserializer: D, - ) -> Result { - match self { - MoveTypeLayout::Bool => bool::deserialize(deserializer).map(MoveValue::Bool), - MoveTypeLayout::U8 => u8::deserialize(deserializer).map(MoveValue::U8), - MoveTypeLayout::U16 => u16::deserialize(deserializer).map(MoveValue::U16), - MoveTypeLayout::U32 => u32::deserialize(deserializer).map(MoveValue::U32), - MoveTypeLayout::U64 => u64::deserialize(deserializer).map(MoveValue::U64), - MoveTypeLayout::U128 => u128::deserialize(deserializer).map(MoveValue::U128), - MoveTypeLayout::U256 => u256::U256::deserialize(deserializer).map(MoveValue::U256), - MoveTypeLayout::Address => { - AccountAddress::deserialize(deserializer).map(MoveValue::Address) - } - MoveTypeLayout::Signer => { - AccountAddress::deserialize(deserializer).map(MoveValue::Signer) - } - MoveTypeLayout::Struct(ty) => Ok(MoveValue::Struct(ty.deserialize(deserializer)?)), - MoveTypeLayout::Enum(ty) => Ok(MoveValue::Variant(ty.deserialize(deserializer)?)), - MoveTypeLayout::Vector(layout) => Ok(MoveValue::Vector( - deserializer.deserialize_seq(VectorElementVisitor(layout))?, - )), - } - } -} - -struct VectorElementVisitor<'a>(&'a MoveTypeLayout); - -impl<'d, 'a> serde::de::Visitor<'d> for VectorElementVisitor<'a> { - type Value = Vec; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("Vector") - } - - fn visit_seq(self, mut seq: A) -> Result - where - A: serde::de::SeqAccess<'d>, - { - let mut vals = Vec::new(); - while let Some(elem) = seq.next_element_seed(self.0)? { - vals.push(elem) - } - Ok(vals) - } -} - -struct StructFieldVisitor<'a>(&'a [MoveTypeLayout]); - -impl<'d, 'a> serde::de::Visitor<'d> for StructFieldVisitor<'a> { - type Value = Vec; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("Struct") - } - - fn visit_seq(self, mut seq: A) -> Result - where - A: serde::de::SeqAccess<'d>, - { - let mut val = Vec::new(); - for (i, field_type) in self.0.iter().enumerate() { - match seq.next_element_seed(field_type)? { - Some(elem) => val.push(elem), - None => return Err(A::Error::invalid_length(i, &self)), - } - } - Ok(val) - } -} - -impl<'d> serde::de::DeserializeSeed<'d> for &MoveStructLayout { - type Value = MoveStruct; - - fn deserialize>( - self, - deserializer: D, - ) -> Result { - Ok(MoveStruct(deserializer.deserialize_tuple( - self.0.len(), - StructFieldVisitor(&self.0), - )?)) - } -} - -impl<'d> serde::de::DeserializeSeed<'d> for &MoveEnumLayout { - type Value = MoveVariant; - fn deserialize>( - self, - deserializer: D, - ) -> Result { - deserializer.deserialize_tuple(2, EnumFieldVisitor(&self.0)) - } -} - -struct EnumFieldVisitor<'a>(&'a Vec>); - -impl<'d, 'a> serde::de::Visitor<'d> for EnumFieldVisitor<'a> { - type Value = MoveVariant; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("Enum") - } - - fn visit_seq(self, mut seq: A) -> Result - where - A: serde::de::SeqAccess<'d>, - { - let tag = match seq.next_element_seed(&MoveTypeLayout::U8)? { - Some(MoveValue::U8(tag)) if tag as u64 <= VARIANT_COUNT_MAX => tag as u16, - Some(MoveValue::U8(tag)) => return Err(A::Error::invalid_length(tag as usize, &self)), - Some(val) => { - return Err(A::Error::invalid_type( - serde::de::Unexpected::Other(&format!("{val:?}")), - &self, - )); - } - None => return Err(A::Error::invalid_length(0, &self)), - }; - - let Some(variant_layout) = self.0.get(tag as usize) else { - return Err(A::Error::invalid_length(tag as usize, &self)); - }; - - let Some(fields) = seq.next_element_seed(&MoveVariantFieldLayout(variant_layout))? else { - return Err(A::Error::invalid_length(1, &self)); - }; - - Ok(MoveVariant { tag, fields }) - } -} - -struct MoveVariantFieldLayout<'a>(&'a [MoveTypeLayout]); - -impl<'d, 'a> serde::de::DeserializeSeed<'d> for &MoveVariantFieldLayout<'a> { - type Value = Vec; - - fn deserialize>( - self, - deserializer: D, - ) -> Result { - deserializer.deserialize_tuple(self.0.len(), StructFieldVisitor(self.0)) - } -} - -impl serde::Serialize for MoveValue { - fn serialize(&self, serializer: S) -> Result { - match self { - MoveValue::Struct(s) => s.serialize(serializer), - MoveValue::Variant(v) => v.serialize(serializer), - MoveValue::Bool(b) => serializer.serialize_bool(*b), - MoveValue::U8(i) => serializer.serialize_u8(*i), - MoveValue::U16(i) => serializer.serialize_u16(*i), - MoveValue::U32(i) => serializer.serialize_u32(*i), - MoveValue::U64(i) => serializer.serialize_u64(*i), - MoveValue::U128(i) => serializer.serialize_u128(*i), - MoveValue::U256(i) => i.serialize(serializer), - MoveValue::Address(a) => a.serialize(serializer), - MoveValue::Signer(a) => a.serialize(serializer), - MoveValue::Vector(v) => { - let mut t = serializer.serialize_seq(Some(v.len()))?; - for val in v { - t.serialize_element(val)?; - } - t.end() - } - } - } -} - -impl serde::Serialize for MoveStruct { - fn serialize(&self, serializer: S) -> Result { - let mut t = serializer.serialize_tuple(self.0.len())?; - for v in self.0.iter() { - t.serialize_element(v)?; - } - t.end() - } -} - -impl serde::Serialize for MoveVariant { - // Serialize a variant as: (tag, [fields...]) - // Since we restrict tags to be less than or equal to 127, the tag will always - // be a single byte in uleb encoding and we don't actually need to uleb - // encode it, but we can at a later date if we want/need to. - fn serialize(&self, serializer: S) -> Result { - let tag = if self.tag as u64 > VARIANT_COUNT_MAX { - return Err(serde::ser::Error::custom(format!( - "Variant tag {} is greater than the maximum allowed value of {}", - self.tag, VARIANT_COUNT_MAX - ))); - } else { - self.tag as u8 - }; - - let mut t = serializer.serialize_tuple(2)?; - - t.serialize_element(&tag)?; - t.serialize_element(&MoveFields(&self.fields))?; - - t.end() - } -} - -struct MoveFields<'a>(&'a [MoveValue]); - -impl<'a> serde::Serialize for MoveFields<'a> { - fn serialize(&self, serializer: S) -> Result { - let mut t = serializer.serialize_tuple(self.0.len())?; - for v in self.0.iter() { - t.serialize_element(v)?; - } - t.end() - } -} - -impl fmt::Display for MoveTypeLayout { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - use MoveTypeLayout::*; - match self { - Bool => write!(f, "bool"), - U8 => write!(f, "u8"), - U16 => write!(f, "u16"), - U32 => write!(f, "u32"), - U64 => write!(f, "u64"), - U128 => write!(f, "u128"), - U256 => write!(f, "u256"), - Address => write!(f, "address"), - Signer => write!(f, "signer"), - Vector(typ) if f.alternate() => write!(f, "vector<{typ:#}>"), - Vector(typ) => write!(f, "vector<{typ}>"), - Struct(s) if f.alternate() => write!(f, "{s:#}"), - Struct(s) => write!(f, "{s}"), - Enum(e) if f.alternate() => write!(f, "{e:#}"), - Enum(e) => write!(f, "{e}"), - } - } -} - -/// Helper type that uses `T`'s `Display` implementation as its own `Debug` -/// implementation, to allow other `Display` implementations in this module to -/// take advantage of the structured formatting helpers that Rust uses for its -/// own debug types. -struct DebugAsDisplay<'a, T>(&'a T); -impl<'a, T: fmt::Display> fmt::Debug for DebugAsDisplay<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if f.alternate() { - write!(f, "{:#}", self.0) - } else { - write!(f, "{}", self.0) - } - } -} - -impl fmt::Display for MoveStructLayout { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - use DebugAsDisplay as DD; - - write!(f, "struct ")?; - let mut map = f.debug_map(); - for (i, l) in self.0.iter().enumerate() { - map.entry(&i, &DD(&l)); - } - - map.finish() - } -} - -impl fmt::Display for MoveEnumLayout { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - write!(f, "enum ")?; - for (tag, variant) in self.0.iter().enumerate() { - write!(f, "variant_tag: {} {{ ", tag)?; - for (i, l) in variant.iter().enumerate() { - write!(f, "{}: {}, ", i, l)? - } - write!(f, " }} ")?; - } - Ok(()) - } -} - -impl fmt::Display for MoveValue { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - MoveValue::U8(u) => write!(f, "{}u8", u), - MoveValue::U16(u) => write!(f, "{}u16", u), - MoveValue::U32(u) => write!(f, "{}u32", u), - MoveValue::U64(u) => write!(f, "{}u64", u), - MoveValue::U128(u) => write!(f, "{}u128", u), - MoveValue::U256(u) => write!(f, "{}u256", u), - MoveValue::Bool(false) => write!(f, "false"), - MoveValue::Bool(true) => write!(f, "true"), - MoveValue::Address(a) => write!(f, "{}", a.to_hex_literal()), - MoveValue::Signer(a) => write!(f, "signer({})", a.to_hex_literal()), - MoveValue::Vector(v) => fmt_list(f, "vector[", v, "]"), - MoveValue::Struct(s) => fmt::Display::fmt(s, f), - MoveValue::Variant(v) => fmt::Display::fmt(v, f), - } - } -} - -impl fmt::Display for MoveStruct { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt_list(f, "struct[", &self.0, "]") - } -} - -impl fmt::Display for MoveVariant { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt_list( - f, - &format!("variant(tag = {})[", self.tag), - &self.fields, - "]", - ) - } -} diff --git a/identity_iota_interaction/src/sdk_types/move_core_types/u256.rs b/identity_iota_interaction/src/sdk_types/move_core_types/u256.rs deleted file mode 100644 index 82556bd04d..0000000000 --- a/identity_iota_interaction/src/sdk_types/move_core_types/u256.rs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) The Move Contributors -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{ - fmt, - mem::size_of, - ops::{ - Shl, Shr, - }, -}; - -// This U256 impl was chosen for now but we are open to changing it as needed -use primitive_types::U256 as PrimitiveU256; - -use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use uint::FromStrRadixErr; - -const NUM_BITS_PER_BYTE: usize = 8; -const U256_NUM_BITS: usize = 256; -pub const U256_NUM_BYTES: usize = U256_NUM_BITS / NUM_BITS_PER_BYTE; - -#[derive(Debug)] -pub struct U256FromStrError(FromStrRadixErr); - -/// A list of error categories encountered when parsing numbers. -#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] -pub enum U256CastErrorKind { - /// Value too large to fit in U8. - TooLargeForU8, - - /// Value too large to fit in U16. - TooLargeForU16, - - /// Value too large to fit in U32. - TooLargeForU32, - - /// Value too large to fit in U64. - TooLargeForU64, - - /// Value too large to fit in U128. - TooLargeForU128, -} - -#[derive(Debug)] -pub struct U256CastError { - kind: U256CastErrorKind, - val: U256, -} - -impl U256CastError { - pub fn new>(val: T, kind: U256CastErrorKind) -> Self { - Self { - kind, - val: val.into(), - } - } -} - -impl std::error::Error for U256CastError {} - -impl fmt::Display for U256CastError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let type_str = match self.kind { - U256CastErrorKind::TooLargeForU8 => "u8", - U256CastErrorKind::TooLargeForU16 => "u16", - U256CastErrorKind::TooLargeForU32 => "u32", - U256CastErrorKind::TooLargeForU64 => "u64", - U256CastErrorKind::TooLargeForU128 => "u128", - }; - let err_str = format!("Cast failed. {} too large for {}.", self.val, type_str); - write!(f, "{err_str}") - } -} - -impl std::error::Error for U256FromStrError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - self.0.source() - } -} - -impl fmt::Display for U256FromStrError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", self.0) - } -} - -#[derive(Clone, Debug, PartialEq, Eq, Hash, Copy, PartialOrd, Ord, Default)] -pub struct U256(PrimitiveU256); - -impl fmt::Display for U256 { - fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { - self.0.fmt(f) - } -} - -impl fmt::UpperHex for U256 { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::UpperHex::fmt(&self.0, f) - } -} - -impl fmt::LowerHex for U256 { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::LowerHex::fmt(&self.0, f) - } -} - -impl std::str::FromStr for U256 { - type Err = U256FromStrError; - - fn from_str(s: &str) -> Result { - Self::from_str_radix(s, 10) - } -} - -impl<'de> Deserialize<'de> for U256 { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - Ok(U256::from_le_bytes( - &(<[u8; U256_NUM_BYTES]>::deserialize(deserializer)?), - )) - } -} - -impl Serialize for U256 { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - self.to_le_bytes().serialize(serializer) - } -} - -impl U256 { - /// Zero value as U256 - pub const fn zero() -> Self { - Self(PrimitiveU256::zero()) - } - - /// One value as U256 - pub const fn one() -> Self { - Self(PrimitiveU256::one()) - } - - /// Max value of U256: - /// 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - pub const fn max_value() -> Self { - Self(PrimitiveU256::max_value()) - } - - /// U256 from string with radix 10 or 16 - pub fn from_str_radix(src: &str, radix: u32) -> Result { - PrimitiveU256::from_str_radix(src.trim_start_matches('0'), radix) - .map(Self) - .map_err(U256FromStrError) - } - - /// U256 from 32 little endian bytes - pub fn from_le_bytes(slice: &[u8; U256_NUM_BYTES]) -> Self { - Self(PrimitiveU256::from_little_endian(slice)) - } - - /// U256 from 32 big endian bytes - pub fn from_be_bytes(slice: &[u8; U256_NUM_BYTES]) -> Self { - Self(PrimitiveU256::from_big_endian(slice)) - } - - /// U256 to 32 little endian bytes - pub fn to_le_bytes(self) -> [u8; U256_NUM_BYTES] { - let mut bytes = [0u8; U256_NUM_BYTES]; - self.0.to_little_endian(&mut bytes); - bytes - } - - /// U256 to 32 big endian bytes - pub fn to_be_bytes(self) -> [u8; U256_NUM_BYTES] { - let mut bytes = [0u8; U256_NUM_BYTES]; - self.0.to_big_endian(&mut bytes); - bytes - } - - /// Leading zeros of the number - pub fn leading_zeros(&self) -> u32 { - self.0.leading_zeros() - } - - // Unchecked downcasting. Values as truncated if larger than target max - pub fn unchecked_as_u8(&self) -> u8 { - self.0.low_u128() as u8 - } - - pub fn unchecked_as_u16(&self) -> u16 { - self.0.low_u128() as u16 - } - - pub fn unchecked_as_u32(&self) -> u32 { - self.0.low_u128() as u32 - } - - pub fn unchecked_as_u64(&self) -> u64 { - self.0.low_u128() as u64 - } - - pub fn unchecked_as_u128(&self) -> u128 { - self.0.low_u128() - } - - // Check arithmetic - /// Checked integer addition. Computes self + rhs, returning None if - /// overflow occurred. - pub fn checked_add(self, rhs: Self) -> Option { - self.0.checked_add(rhs.0).map(Self) - } - - /// Checked integer subtraction. Computes self - rhs, returning None if - /// overflow occurred. - pub fn checked_sub(self, rhs: Self) -> Option { - self.0.checked_sub(rhs.0).map(Self) - } - - /// Checked integer multiplication. Computes self * rhs, returning None if - /// overflow occurred. - pub fn checked_mul(self, rhs: Self) -> Option { - self.0.checked_mul(rhs.0).map(Self) - } - - /// Checked integer division. Computes self / rhs, returning None if rhs == - /// 0. - pub fn checked_div(self, rhs: Self) -> Option { - self.0.checked_div(rhs.0).map(Self) - } - - /// Checked integer remainder. Computes self % rhs, returning None if rhs == - /// 0. - pub fn checked_rem(self, rhs: Self) -> Option { - self.0.checked_rem(rhs.0).map(Self) - } - - /// Checked integer remainder. Computes self % rhs, returning None if rhs == - /// 0. - pub fn checked_shl(self, rhs: u32) -> Option { - if rhs >= U256_NUM_BITS as u32 { - return None; - } - Some(Self(self.0.shl(rhs))) - } - - /// Checked shift right. Computes self >> rhs, returning None if rhs is - /// larger than or equal to the number of bits in self. - pub fn checked_shr(self, rhs: u32) -> Option { - if rhs >= U256_NUM_BITS as u32 { - return None; - } - Some(Self(self.0.shr(rhs))) - } - - /// Downcast to a an unsigned value of type T - /// T must be at most u128 - pub fn down_cast_lossy>(self) -> T { - // Size of this type - let type_size = size_of::(); - // Maximum value for this type - let max_val: u128 = if type_size < 16 { - (1u128 << (NUM_BITS_PER_BYTE * type_size)) - 1u128 - } else { - u128::MAX - }; - // This should never fail - match T::try_from(self.0.low_u128() & max_val) { - Ok(w) => w, - Err(_) => panic!("Fatal! Downcast failed"), - } - } - - /// Wrapping integer addition. Computes self + rhs, wrapping around at the - /// boundary of the type. By definition in std::instrinsics, - /// a.wrapping_add(b) = (a + b) % (2^N), where N is bit width - pub fn wrapping_add(self, rhs: Self) -> Self { - Self(self.0.overflowing_add(rhs.0).0) - } - - /// Wrapping integer subtraction. Computes self - rhs, wrapping around at - /// the boundary of the type. By definition in std::instrinsics, - /// a.wrapping_add(b) = (a - b) % (2^N), where N is bit width - pub fn wrapping_sub(self, rhs: Self) -> Self { - Self(self.0.overflowing_sub(rhs.0).0) - } - - /// Wrapping integer multiplication. Computes self * rhs, wrapping around - /// at the boundary of the type. By definition in std::instrinsics, - /// a.wrapping_mul(b) = (a * b) % (2^N), where N is bit width - pub fn wrapping_mul(self, rhs: Self) -> Self { - Self(self.0.overflowing_mul(rhs.0).0) - } -} - -impl From for U256 { - fn from(n: u8) -> Self { - U256(PrimitiveU256::from(n)) - } -} - -impl From for U256 { - fn from(n: u16) -> Self { - U256(PrimitiveU256::from(n)) - } -} - -impl From for U256 { - fn from(n: u32) -> Self { - U256(PrimitiveU256::from(n)) - } -} - -impl From for U256 { - fn from(n: u64) -> Self { - U256(PrimitiveU256::from(n)) - } -} - -impl From for U256 { - fn from(n: u128) -> Self { - U256(PrimitiveU256::from(n)) - } -} - -impl TryFrom for u8 { - type Error = U256CastError; - fn try_from(n: U256) -> Result { - let n = n.0.low_u64(); - if n > u8::MAX as u64 { - Err(U256CastError::new(n, U256CastErrorKind::TooLargeForU8)) - } else { - Ok(n as u8) - } - } -} - -impl TryFrom for u16 { - type Error = U256CastError; - - fn try_from(n: U256) -> Result { - let n = n.0.low_u64(); - if n > u16::MAX as u64 { - Err(U256CastError::new(n, U256CastErrorKind::TooLargeForU16)) - } else { - Ok(n as u16) - } - } -} - -impl TryFrom for u32 { - type Error = U256CastError; - - fn try_from(n: U256) -> Result { - let n = n.0.low_u64(); - if n > u32::MAX as u64 { - Err(U256CastError::new(n, U256CastErrorKind::TooLargeForU32)) - } else { - Ok(n as u32) - } - } -} - -impl TryFrom for u64 { - type Error = U256CastError; - - fn try_from(n: U256) -> Result { - let n = n.0.low_u128(); - if n > u64::MAX as u128 { - Err(U256CastError::new(n, U256CastErrorKind::TooLargeForU64)) - } else { - Ok(n as u64) - } - } -} - -impl TryFrom for u128 { - type Error = U256CastError; - - fn try_from(n: U256) -> Result { - if n > U256::from(u128::MAX) { - Err(U256CastError::new(n, U256CastErrorKind::TooLargeForU128)) - } else { - Ok(n.0.low_u128()) - } - } -} \ No newline at end of file diff --git a/identity_iota_interaction/src/sdk_types/shared_crypto/intent.rs b/identity_iota_interaction/src/sdk_types/shared_crypto/intent.rs deleted file mode 100644 index 03ff73711d..0000000000 --- a/identity_iota_interaction/src/sdk_types/shared_crypto/intent.rs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::str::FromStr; -use std::vec::Vec; -use std::default::Default; -use std::convert::{TryFrom, TryInto}; -use std::result::Result::{Ok, Err}; - -use eyre::eyre; -use fastcrypto::encoding::decode_bytes_hex; -use serde::{Deserialize, Serialize}; -use serde_repr::{Deserialize_repr, Serialize_repr}; - -use Result; - -pub const INTENT_PREFIX_LENGTH: usize = 3; - -/// The version here is to distinguish between signing different versions of the -/// struct or enum. Serialized output between two different versions of the same -/// struct/enum might accidentally (or maliciously on purpose) match. -#[derive(Serialize_repr, Deserialize_repr, Copy, Clone, PartialEq, Eq, Debug, Hash)] -#[repr(u8)] -pub enum IntentVersion { - V0 = 0, -} - -impl TryFrom for IntentVersion { - type Error = eyre::Report; - fn try_from(value: u8) -> Result { - bcs::from_bytes(&[value]).map_err(|_| eyre!("Invalid IntentVersion")) - } -} - -/// This enums specifies the application ID. Two intents in two different -/// applications (i.e., IOTA, Ethereum etc) should never collide, so -/// that even when a signing key is reused, nobody can take a signature -/// designated for app_1 and present it as a valid signature for an (any) intent -/// in app_2. -#[derive(Serialize_repr, Deserialize_repr, Copy, Clone, PartialEq, Eq, Debug, Hash)] -#[repr(u8)] -pub enum AppId { - Iota = 0, - Consensus = 1, -} - -// TODO(joyqvq): Use num_derive -impl TryFrom for AppId { - type Error = eyre::Report; - fn try_from(value: u8) -> Result { - bcs::from_bytes(&[value]).map_err(|_| eyre!("Invalid AppId")) - } -} - -impl Default for AppId { - fn default() -> Self { - Self::Iota - } -} - -/// This enums specifies the intent scope. Two intents for different scope -/// should never collide, so no signature provided for one intent scope can be -/// used for another, even when the serialized data itself may be the same. -#[derive(Serialize_repr, Deserialize_repr, Copy, Clone, PartialEq, Eq, Debug, Hash)] -#[repr(u8)] -pub enum IntentScope { - TransactionData = 0, // Used for a user signature on a transaction data. - TransactionEffects = 1, // Used for an authority signature on transaction effects. - CheckpointSummary = 2, // Used for an authority signature on a checkpoint summary. - PersonalMessage = 3, // Used for a user signature on a personal message. - SenderSignedTransaction = 4, // Used for an authority signature on a user signed transaction. - ProofOfPossession = 5, /* Used as a signature representing an authority's proof of - * possession of its authority key. */ - BridgeEventUnused = 6, // for bridge purposes but it's currently not included in messages. - ConsensusBlock = 7, // Used for consensus authority signature on block's digest -} - -impl TryFrom for IntentScope { - type Error = eyre::Report; - fn try_from(value: u8) -> Result { - bcs::from_bytes(&[value]).map_err(|_| eyre!("Invalid IntentScope")) - } -} - -/// An intent is a compact struct serves as the domain separator for a message -/// that a signature commits to. It consists of three parts: [enum IntentScope] -/// (what the type of the message is), [enum IntentVersion], [enum AppId] (what -/// application that the signature refers to). It is used to construct [struct -/// IntentMessage] that what a signature commits to. -/// -/// The serialization of an Intent is a 3-byte array where each field is -/// represented by a byte. -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Hash)] -pub struct Intent { - pub scope: IntentScope, - pub version: IntentVersion, - pub app_id: AppId, -} - -impl Intent { - pub fn to_bytes(&self) -> [u8; INTENT_PREFIX_LENGTH] { - [self.scope as u8, self.version as u8, self.app_id as u8] - } - - pub fn from_bytes(bytes: &[u8]) -> Result { - if bytes.len() != INTENT_PREFIX_LENGTH { - return Err(eyre!("Invalid Intent")); - } - Ok(Self { - scope: bytes[0].try_into()?, - version: bytes[1].try_into()?, - app_id: bytes[2].try_into()?, - }) - } -} - -impl FromStr for Intent { - type Err = eyre::Report; - fn from_str(s: &str) -> Result { - let bytes: Vec = decode_bytes_hex(s).map_err(|_| eyre!("Invalid Intent"))?; - Self::from_bytes(bytes.as_slice()) - } -} - -impl Intent { - pub fn iota_app(scope: IntentScope) -> Self { - Self { - version: IntentVersion::V0, - scope, - app_id: AppId::Iota, - } - } - - pub fn iota_transaction() -> Self { - Self { - scope: IntentScope::TransactionData, - version: IntentVersion::V0, - app_id: AppId::Iota, - } - } - - pub fn personal_message() -> Self { - Self { - scope: IntentScope::PersonalMessage, - version: IntentVersion::V0, - app_id: AppId::Iota, - } - } - - pub fn consensus_app(scope: IntentScope) -> Self { - Self { - scope, - version: IntentVersion::V0, - app_id: AppId::Consensus, - } - } -} - -/// Intent Message is a wrapper around a message with its intent. The message -/// can be any type that implements [trait Serialize]. *ALL* signatures in IOTA -/// must commits to the intent message, not the message itself. This guarantees -/// any intent message signed in the system cannot collide with another since -/// they are domain separated by intent. -/// -/// The serialization of an IntentMessage is compact: it only appends three -/// bytes to the message itself. -#[derive(Debug, PartialEq, Eq, Serialize, Clone, Hash, Deserialize)] -pub struct IntentMessage { - pub intent: Intent, - pub value: T, -} - -impl IntentMessage { - pub fn new(intent: Intent, value: T) -> Self { - Self { intent, value } - } -} - -/// A person message that wraps around a byte array. -#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] -pub struct PersonalMessage { - pub message: Vec, -} - -pub trait SecureIntent: Serialize + private::SealedIntent {} - -pub(crate) mod private { - use super::IntentMessage; - - pub trait SealedIntent {} - impl SealedIntent for IntentMessage {} -} - -/// A 1-byte domain separator for hashing Object ID in IOTA. It is starting from -/// 0xf0 to ensure no hashing collision for any ObjectID vs IotaAddress which is -/// derived as the hash of `flag || pubkey`. See -/// `iota_types::crypto::SignatureScheme::flag()`. -#[derive(Serialize_repr, Deserialize_repr, Copy, Clone, PartialEq, Eq, Debug, Hash)] -#[repr(u8)] -pub enum HashingIntentScope { - ChildObjectId = 0xf0, - RegularObjectId = 0xf1, -} diff --git a/identity_iota_interaction/src/sdk_types/shared_crypto/mod.rs b/identity_iota_interaction/src/sdk_types/shared_crypto/mod.rs deleted file mode 100644 index db49c84edf..0000000000 --- a/identity_iota_interaction/src/sdk_types/shared_crypto/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -pub mod intent; \ No newline at end of file diff --git a/identity_iota_interaction/src/transaction_builder_trait.rs b/identity_iota_interaction/src/transaction_builder_trait.rs deleted file mode 100644 index e6bdcc9f2e..0000000000 --- a/identity_iota_interaction/src/transaction_builder_trait.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProgrammableTransactionBcs; - -pub trait TransactionBuilderT { - type Error; - type NativeTxBuilder; - - fn finish(self) -> Result; - - fn as_native_tx_builder(&mut self) -> &mut Self::NativeTxBuilder; - - fn into_native_tx_builder(self) -> Self::NativeTxBuilder; -} diff --git a/identity_jose/Cargo.toml b/identity_jose/Cargo.toml index e17a5e2b88..0ba4da1965 100644 --- a/identity_jose/Cargo.toml +++ b/identity_jose/Cargo.toml @@ -25,10 +25,10 @@ thiserror.workspace = true zeroize = { version = "1.6", default-features = false, features = ["std", "zeroize_derive"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction" } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction" } [target.'cfg(target_arch = "wasm32")'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction", default-features = false } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", default-features = false } [dev-dependencies] iota-crypto = { version = "0.23", features = ["ed25519", "random", "hmac"] } @@ -46,12 +46,7 @@ workspace = true [features] default = [] custom_alg = [] -jwk-conversion = [ - "dep:anyhow", - "dep:k256", - "dep:p256", - "fastcrypto/copy_key", -] +jwk-conversion = ["dep:anyhow", "dep:k256", "dep:p256", "fastcrypto/copy_key"] [[test]] name = "custom_alg" diff --git a/identity_jose/src/jwk/conversion/from_jwk.rs b/identity_jose/src/jwk/conversion/from_jwk.rs index 423b2b5587..535b90f20e 100644 --- a/identity_jose/src/jwk/conversion/from_jwk.rs +++ b/identity_jose/src/jwk/conversion/from_jwk.rs @@ -12,9 +12,9 @@ use fastcrypto::ed25519::Ed25519KeyPair; use fastcrypto::ed25519::Ed25519PublicKey; use fastcrypto::secp256k1::Secp256k1KeyPair; use fastcrypto::secp256r1::Secp256r1KeyPair; -use identity_iota_interaction::types::crypto::IotaKeyPair; -use identity_iota_interaction::types::crypto::PublicKey; -use identity_iota_interaction::types::crypto::SignatureScheme as IotaSignatureScheme; +use iota_interaction::types::crypto::IotaKeyPair; +use iota_interaction::types::crypto::PublicKey; +use iota_interaction::types::crypto::SignatureScheme as IotaSignatureScheme; use super::ed25519; use super::secp256k1; @@ -184,7 +184,7 @@ mod tests { #[test] fn can_convert_from_jwk_to_ed22519_iota_keypair() { let jwk = get_ed25519_jwk(KeyType::Private); - let result = identity_iota_interaction::types::crypto::IotaKeyPair::from_jwk(&jwk); + let result = iota_interaction::types::crypto::IotaKeyPair::from_jwk(&jwk); assert!(result.is_ok()); } @@ -192,7 +192,7 @@ mod tests { #[test] fn can_convert_from_jwk_to_ecp256r1_iota_keypair() { let jwk = get_secp256r1_jwk(KeyType::Private); - let result = identity_iota_interaction::types::crypto::IotaKeyPair::from_jwk(&jwk); + let result = iota_interaction::types::crypto::IotaKeyPair::from_jwk(&jwk); dbg!(&result); assert!(result.is_ok()); @@ -201,7 +201,7 @@ mod tests { #[test] fn can_convert_from_jwk_to_secp256k1_iota_keypair() { let jwk = get_secp256k1_jwk(KeyType::Private); - let result = identity_iota_interaction::types::crypto::IotaKeyPair::from_jwk(&jwk); + let result = iota_interaction::types::crypto::IotaKeyPair::from_jwk(&jwk); dbg!(&result); assert!(result.is_ok()); @@ -210,7 +210,7 @@ mod tests { #[test] fn can_convert_from_octet_keypair_jwk_to_iota_public_key() { let jwk = get_ed25519_jwk(KeyType::Public); - let result = identity_iota_interaction::types::crypto::PublicKey::from_jwk(&jwk); + let result = iota_interaction::types::crypto::PublicKey::from_jwk(&jwk); assert!(result.is_ok()); } @@ -218,7 +218,7 @@ mod tests { #[test] fn can_convert_from_secp256r1_jwk_to_iota_public_key() { let jwk = get_secp256r1_jwk(KeyType::Public); - let result = identity_iota_interaction::types::crypto::PublicKey::from_jwk(&jwk); + let result = iota_interaction::types::crypto::PublicKey::from_jwk(&jwk); assert!(result.is_ok()); } @@ -226,7 +226,7 @@ mod tests { #[test] fn can_convert_from_secp256k1_jwk_to_iota_public_key() { let jwk = get_secp256k1_jwk(KeyType::Public); - let result = identity_iota_interaction::types::crypto::PublicKey::from_jwk(&jwk); + let result = iota_interaction::types::crypto::PublicKey::from_jwk(&jwk); assert!(result.is_ok()); } diff --git a/identity_jose/src/jwk/conversion/to_jwk.rs b/identity_jose/src/jwk/conversion/to_jwk.rs index 6bfa618543..401bf1880f 100644 --- a/identity_jose/src/jwk/conversion/to_jwk.rs +++ b/identity_jose/src/jwk/conversion/to_jwk.rs @@ -7,7 +7,7 @@ use crate::error::Error; use crate::jwk::Jwk; use fastcrypto::ed25519::Ed25519KeyPair; use fastcrypto::traits::KeyPair; -use identity_iota_interaction::types::crypto::PublicKey; +use iota_interaction::types::crypto::PublicKey; use super::ed25519; use super::secp256k1; @@ -54,7 +54,7 @@ mod tests { mod iota_public_key { use super::*; - use identity_iota_interaction::types::crypto::IotaKeyPair; + use iota_interaction::types::crypto::IotaKeyPair; #[test] fn can_convert_from_ed25519_public_key_to_jwk() { diff --git a/identity_storage/Cargo.toml b/identity_storage/Cargo.toml index 71d33b9f39..bb9df9b1f4 100644 --- a/identity_storage/Cargo.toml +++ b/identity_storage/Cargo.toml @@ -37,16 +37,17 @@ tokio = { version = "1.43", default-features = false, features = ["macros", "syn zkryptium = { workspace = true, optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction", optional = true } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] -identity_iota_interaction = { version = "=1.6.0-alpha", path = "../identity_iota_interaction", default-features = false, optional = true } +iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", default-features = false, optional = true } [dev-dependencies] identity_credential = { version = "=1.6.0-alpha", path = "../identity_credential", features = ["revocation-bitmap"] } identity_ecdsa_verifier = { version = "=1.6.0-alpha", path = "../identity_ecdsa_verifier", default-features = false, features = ["es256"] } identity_eddsa_verifier = { version = "=1.6.0-alpha", path = "../identity_eddsa_verifier", default-features = false, features = ["ed25519"] } once_cell = { version = "1.18", default-features = false } +product-core = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common", default-features = false } tokio = { version = "1.43", default-features = false, features = ["macros", "sync", "rt"] } [features] @@ -62,7 +63,7 @@ storage-signer = [ "identity_iota_core?/iota-client", "identity_verification/jwk-conversion", "dep:secret-storage", - "dep:identity_iota_interaction", + "dep:iota_interaction", "dep:fastcrypto", "dep:bcs", ] @@ -75,8 +76,8 @@ jpt-bbs-plus = [ ] # Enables integration with IOTA Keytool keytool = [ - "dep:identity_iota_interaction", - "identity_iota_interaction/keytool", + "dep:iota_interaction", + "iota_interaction/keytool", "identity_verification/jwk-conversion", "k256", "p256", diff --git a/identity_storage/src/key_id_storage/keytool.rs b/identity_storage/src/key_id_storage/keytool.rs index f0e09ad29e..6e250111c6 100644 --- a/identity_storage/src/key_id_storage/keytool.rs +++ b/identity_storage/src/key_id_storage/keytool.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use async_trait::async_trait; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::KeytoolStorage; use identity_verification::jwu::encode_b64; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::KeytoolStorage; use crate::KeyId; diff --git a/identity_storage/src/key_storage/keytool.rs b/identity_storage/src/key_storage/keytool.rs index bf8e3514e5..29a8d7b2e9 100644 --- a/identity_storage/src/key_storage/keytool.rs +++ b/identity_storage/src/key_storage/keytool.rs @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 use async_trait::async_trait; -use identity_iota_interaction::types::base_types::IotaAddress; -use identity_iota_interaction::types::crypto::IotaKeyPair; -use identity_iota_interaction::types::crypto::SignatureScheme; -use identity_iota_interaction::KeytoolStorage; use identity_verification::jwk::FromJwk as _; use identity_verification::jwk::Jwk; use identity_verification::jwk::ToJwk as _; use identity_verification::jws::JwsAlgorithm; +use iota_interaction::types::base_types::IotaAddress; +use iota_interaction::types::crypto::IotaKeyPair; +use iota_interaction::types::crypto::SignatureScheme; +use iota_interaction::KeytoolStorage; use super::JwkGenOutput; use super::JwkStorage; @@ -119,10 +119,10 @@ mod tests { use identity_did::DID; use identity_ecdsa_verifier::EcDSAJwsVerifier; use identity_iota_core::IotaDocument; - use identity_iota_core::NetworkName; - use identity_iota_interaction::KeytoolStorage as Keytool; use identity_verification::jws::JwsAlgorithm; use identity_verification::MethodScope; + use iota_interaction::KeytoolStorage as Keytool; + use product_core::network_name::NetworkName; use serde_json::Value; fn make_storage() -> KeytoolStorage { diff --git a/identity_storage/src/storage/mod.rs b/identity_storage/src/storage/mod.rs index 419ad27aa8..b2e4ca3233 100644 --- a/identity_storage/src/storage/mod.rs +++ b/identity_storage/src/storage/mod.rs @@ -59,7 +59,7 @@ impl Storage { #[cfg(feature = "keytool")] mod keytool { use super::Storage; - use identity_iota_interaction::KeytoolStorage as Keytool; + use iota_interaction::KeytoolStorage as Keytool; /// An unsecure [Storage] that leverages IOTA Keytool. pub type KeytoolStorage = Storage; diff --git a/identity_storage/src/storage/storage_signer.rs b/identity_storage/src/storage/storage_signer.rs index 7b38b0cfee..0db18b2d00 100644 --- a/identity_storage/src/storage/storage_signer.rs +++ b/identity_storage/src/storage/storage_signer.rs @@ -5,14 +5,17 @@ use anyhow::anyhow; use async_trait::async_trait; use fastcrypto::hash::Blake2b256; use fastcrypto::traits::ToFromBytes; -use identity_iota_interaction::shared_crypto::intent::Intent; -use identity_iota_interaction::types::crypto::PublicKey; -use identity_iota_interaction::types::crypto::Signature; -use identity_iota_interaction::types::transaction::TransactionData; -use identity_iota_interaction::IotaKeySignature; -use identity_iota_interaction::OptionalSync; + use identity_verification::jwk::FromJwk as _; use identity_verification::jwk::Jwk; + +use iota_interaction::shared_crypto::intent::Intent; +use iota_interaction::types::crypto::PublicKey; +use iota_interaction::types::crypto::Signature; + +use iota_interaction::types::transaction::TransactionData; +use iota_interaction::IotaKeySignature; +use iota_interaction::OptionalSync; use secret_storage::Error as SecretStorageError; use secret_storage::Signer; diff --git a/rustfmt.toml b/rustfmt.toml index 103ed48b33..c0842c2114 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -6,6 +6,3 @@ normalize_doc_attributes = false tab_spaces = 2 wrap_comments = true imports_granularity = "Item" -ignore = [ - "identity_iota_interaction/src/sdk_types", -]