From 92cfe240a3a07955c9ed38dcea4e09bceedb155d Mon Sep 17 00:00:00 2001 From: Vladilen <125375292+vladilen11@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:44:05 +0800 Subject: [PATCH] feat(initia-client): init initia-client package (#90) --- packages/initia-client/.env.example | 4 + packages/initia-client/.gitignore | 39 + packages/initia-client/LICENSE | 202 +++ packages/initia-client/README.md | 3 + packages/initia-client/package.json | 149 ++ packages/initia-client/scripts/init.ts | 44 + packages/initia-client/scripts/publish.ts | 35 + packages/initia-client/src/dubhe.ts | 450 +++++ packages/initia-client/src/index.ts | 7 + .../src/libs/initiaAccountManager/crypto.ts | 7 + .../src/libs/initiaAccountManager/index.ts | 66 + .../src/libs/initiaAccountManager/keypair.ts | 39 + .../src/libs/initiaAccountManager/util.ts | 55 + .../src/libs/initiaContractFactory/index.ts | 15 + .../src/libs/initiaContractFactory/types.ts | 1500 +++++++++++++++++ .../libs/initiaInteractor/defaultConfig.ts | 35 + .../src/libs/initiaInteractor/index.ts | 2 + .../libs/initiaInteractor/initiaInteractor.ts | 194 +++ .../src/libs/initiaInteractor/util.ts | 2 + packages/initia-client/src/metadata/index.ts | 32 + packages/initia-client/src/types/index.ts | 124 ++ packages/initia-client/src/utils/index.ts | 3 + packages/initia-client/test/index.spec.ts | 5 + packages/initia-client/test/tsconfig.json | 9 + packages/initia-client/tsconfig.json | 32 + pnpm-lock.yaml | 941 +++++++++-- 26 files changed, 3899 insertions(+), 95 deletions(-) create mode 100644 packages/initia-client/.env.example create mode 100644 packages/initia-client/.gitignore create mode 100644 packages/initia-client/LICENSE create mode 100644 packages/initia-client/README.md create mode 100644 packages/initia-client/package.json create mode 100644 packages/initia-client/scripts/init.ts create mode 100644 packages/initia-client/scripts/publish.ts create mode 100644 packages/initia-client/src/dubhe.ts create mode 100644 packages/initia-client/src/index.ts create mode 100644 packages/initia-client/src/libs/initiaAccountManager/crypto.ts create mode 100644 packages/initia-client/src/libs/initiaAccountManager/index.ts create mode 100644 packages/initia-client/src/libs/initiaAccountManager/keypair.ts create mode 100644 packages/initia-client/src/libs/initiaAccountManager/util.ts create mode 100644 packages/initia-client/src/libs/initiaContractFactory/index.ts create mode 100644 packages/initia-client/src/libs/initiaContractFactory/types.ts create mode 100644 packages/initia-client/src/libs/initiaInteractor/defaultConfig.ts create mode 100644 packages/initia-client/src/libs/initiaInteractor/index.ts create mode 100644 packages/initia-client/src/libs/initiaInteractor/initiaInteractor.ts create mode 100644 packages/initia-client/src/libs/initiaInteractor/util.ts create mode 100644 packages/initia-client/src/metadata/index.ts create mode 100644 packages/initia-client/src/types/index.ts create mode 100644 packages/initia-client/src/utils/index.ts create mode 100644 packages/initia-client/test/index.spec.ts create mode 100644 packages/initia-client/test/tsconfig.json create mode 100644 packages/initia-client/tsconfig.json diff --git a/packages/initia-client/.env.example b/packages/initia-client/.env.example new file mode 100644 index 000000000..c7383e147 --- /dev/null +++ b/packages/initia-client/.env.example @@ -0,0 +1,4 @@ +# The private key of your account +PRIVATE_KEY= +## This is your private info, never let anyone else know, or you will lost all funds +MNEMONICS="<24 words of mnemonics>" diff --git a/packages/initia-client/.gitignore b/packages/initia-client/.gitignore new file mode 100644 index 000000000..933689580 --- /dev/null +++ b/packages/initia-client/.gitignore @@ -0,0 +1,39 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# Dependency directories +node_modules/ + +# build / generate output +dist/ +docs/ + +#misc +.DS_Store +.rollup.cache +*.pem + +# dotenv environment variables file +.env +.env.local +.env.test +.env.development.local +.env.test.local +.env.production.local + +# typescript +*.tsbuildinfo + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* +logs/ +*.log* + +.github +.husky +.idea +document +metadata/*.json +contracts/ \ No newline at end of file diff --git a/packages/initia-client/LICENSE b/packages/initia-client/LICENSE new file mode 100644 index 000000000..d58b6fef6 --- /dev/null +++ b/packages/initia-client/LICENSE @@ -0,0 +1,202 @@ + + 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 + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Scallop Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/initia-client/README.md b/packages/initia-client/README.md new file mode 100644 index 000000000..541e87a75 --- /dev/null +++ b/packages/initia-client/README.md @@ -0,0 +1,3 @@ +# + +Test QA diff --git a/packages/initia-client/package.json b/packages/initia-client/package.json new file mode 100644 index 000000000..280916782 --- /dev/null +++ b/packages/initia-client/package.json @@ -0,0 +1,149 @@ +{ + "name": "@0xobelisk/initia-client", + "version": "0.0.1", + "description": "Tookit for interacting with initia move framework", + "keywords": [ + "initia", + "obelisk labs", + "move", + "blockchain" + ], + "author": "team@obelisk.build", + "homepage": "https://github.com/0xobelisk/dubhe/tree/main/packages/initia-client#readme", + "bugs": "https://github.com/0xobelisk/dubhe/issues", + "repository": { + "type": "git", + "url": "https://github.com/0xobelisk/dubhe.git" + }, + "license": "Apache-2.0", + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "source": "./src/index.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, + "files": [ + "dist", + "src" + ], + "scripts": { + "clean": "rm -rf tsconfig.tsbuildinfo ./dist", + "build": "npm run build:types && npm run build:tsup", + "build:tsup": "tsup ./src/index.ts --format esm,cjs --sourcemap", + "build:types": "tsc --build", + "watch:tsup": "tsup ./src/index.ts --format esm,cjs --clean --splitting --watch", + "watch:types": "tsc --watch", + "watch": "pnpm run clean & pnpm run watch:types & pnpm run watch:tsup", + "test": "pnpm test:typecheck && pnpm test:unit", + "test:typecheck": "tsc -p ./test", + "test:unit": "vitest run --test-timeout=60000", + "test:watch": "vitest", + "format:fix": "prettier --ignore-path 'dist/* docs/*' --write '**/*.{ts,json,md}'", + "lint:fix": "eslint . --ignore-pattern dist --ext .ts --fix", + "commit": "commit", + "doc": "typedoc --out docs src/index.ts", + "chalk": "^5.0.1", + "prettier": "^2.8.4", + "prettier-plugin-rust": "^0.1.9" + }, + "dependencies": { + "@initia/builder.js": "^0.2.4", + "@initia/initia.js": "^0.2.23", + "@scure/bip39": "^1.2.1", + "assert": "^2.0.0", + "colorts": "^0.1.63", + "husky": "^8.0.3", + "keccak256": "^1.0.6", + "process": "^0.11.10", + "superstruct": "^1.0.3", + "tmp": "^0.2.1", + "ts-retry-promise": "^0.7.0" + }, + "devDependencies": { + "@commitlint/cli": "^17.6.6", + "@commitlint/config-conventional": "^17.6.6", + "@commitlint/prompt-cli": "^17.6.6", + "@types/node": "^20.5.0", + "@types/tmp": "^0.2.3", + "@typescript-eslint/eslint-plugin": "^5.60.1", + "@typescript-eslint/parser": "^5.60.1", + "dotenv": "^16.3.1", + "eslint": "^8.43.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.2.1", + "lint-staged": "^13.2.3", + "prettier": "^2.8.8", + "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", + "tsup": "^7.1.0", + "typedoc": "^0.24.8", + "typescript": "^5.0.4", + "vitest": "^0.32.2" + }, + "lint-staged": { + "**/*.ts": [ + "pnpm run format:fix", + "pnpm run lint:fix" + ], + "**/*.json|md": [ + "pnpm run format:fix" + ] + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "prettier": { + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true, + "useTabs": false, + "quoteProps": "as-needed", + "bracketSpacing": true, + "arrowParens": "always", + "endOfLine": "lf" + }, + "eslintConfig": { + "root": true, + "env": { + "browser": true, + "node": true, + "es2022": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:prettier/recommended" + ], + "plugins": [ + "@typescript-eslint", + "prettier" + ], + "parser": "@typescript-eslint/parser", + "rules": { + "prettier/prettier": "warn", + "@typescript-eslint/no-explicit-any": "off", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" + } + ] + } + } +} diff --git a/packages/initia-client/scripts/init.ts b/packages/initia-client/scripts/init.ts new file mode 100644 index 000000000..cfbf8476f --- /dev/null +++ b/packages/initia-client/scripts/init.ts @@ -0,0 +1,44 @@ +import { NetworkType, Dubhe, bcs } from './../src'; +import { loadMetadata } from '../src/metadata/index'; +import dotenv from 'dotenv'; +dotenv.config(); + +export const delay = (ms: number) => + new Promise((resolve) => setTimeout(resolve, ms)); + +async function init() { + const network = 'testnet' as NetworkType; + const packageId = 'init1rr8dwsgw7wtmx33n3v8uqmm6msfcm06glyvufp'; + const metadata = await loadMetadata(network, packageId); + const privateKey = process.env.PRIVATE_KEY; + const dubhe = new Dubhe({ + networkType: network, + packageId: packageId, + metadata: metadata, + secretKey: privateKey, + }); + + let myInitiaAddr = dubhe.getAddress(); + let myHexAddr = dubhe.getHexAddress(); + let myBalance = await dubhe.getBalance(); + console.log(`Initia Addr: ${myInitiaAddr}`); + console.log(`Hex Addr: ${myHexAddr}`); + console.log(`Balance: ${myBalance}`); + + console.log('======= query content value ========'); + const content = await dubhe.query.read_write.read(); + console.log(content); + + console.log('======= write content value ========'); + const res1 = await dubhe.tx.read_write.write(myHexAddr, [ + bcs.string().serialize('reset new content!').toBase64(), + ]); + console.log(res1); + await delay(6000); + + console.log('======= query content value after rewrite ========'); + const content2 = await dubhe.query.read_write.read(); + console.log(content2); +} + +init(); diff --git a/packages/initia-client/scripts/publish.ts b/packages/initia-client/scripts/publish.ts new file mode 100644 index 000000000..abf0b458d --- /dev/null +++ b/packages/initia-client/scripts/publish.ts @@ -0,0 +1,35 @@ +// import { NetworkType, Dubhe } from '../src'; +// import * as fs from 'fs'; + +// import dotenv from 'dotenv'; +// dotenv.config(); + +// export const delay = (ms: number) => +// new Promise((resolve) => setTimeout(resolve, ms)); + +// async function init() { +// const network = 'localnet' as NetworkType; +// const privateKey = process.env.PRIVATE_KEY; +// const dubhe = new Dubhe({ +// networkType: network, +// secretKey: privateKey, +// }); + +// let myRoochAddr = dubhe.getRoochAddress(); +// let myHexAddr = dubhe.getHexAddress(); +// let myBitcoinAddr = dubhe.getBitcoinAddress(); +// let myBalance = await dubhe.getBalance(); +// console.log(`RoochAddr: ${myRoochAddr}`); +// console.log(`HexAddr: ${myHexAddr}`); +// console.log(`BitcoinAddr: ${myBitcoinAddr}`); +// console.log(`Balance: ${myBalance}`); +// const fileBytes = fs.readFileSync( +// './contracts/counter/build/counter/package.rpd' +// ); +// const res = await dubhe.publishPackage({ +// packageBytes: fileBytes, +// }); +// console.log(res); +// } + +// init(); diff --git a/packages/initia-client/src/dubhe.ts b/packages/initia-client/src/dubhe.ts new file mode 100644 index 000000000..961709f3e --- /dev/null +++ b/packages/initia-client/src/dubhe.ts @@ -0,0 +1,450 @@ +import { AccAddress, Key, MsgExecute, Wallet } from '@initia/initia.js'; +import { InitiaAccountManager } from './libs/initiaAccountManager'; +import { getDefaultURL, InitiaInteractor } from './libs/initiaInteractor'; +import { InitiaContractFactory } from './libs/initiaContractFactory'; +import { + DubheParams, + DerivePathParams, + ContractQuery, + ContractTx, + MapModuleFuncQuery, + MapModuleFuncTx, + MoveModuleFuncType, + MoveModule, +} from './types'; + +export function isUndefined(value?: unknown): value is undefined { + return value === undefined; +} + +export function withMeta( + meta: MoveModuleFuncType, + creator: Omit +): T { + (creator as T).meta = meta; + + return creator as T; +} + +function createQuery( + meta: MoveModuleFuncType, + fn: (params?: string[], typeArguments?: string[]) => Promise +): ContractQuery { + return withMeta( + meta, + async (params?: string[], typeArguments?: string[]): Promise => { + const result = await fn(params, typeArguments); + return result; + } + ); +} + +function createTx( + meta: MoveModuleFuncType, + fn: ( + sender?: AccAddress | string, + params?: string[], + typeArguments?: string[], + isRaw?: boolean + ) => Promise +): ContractTx { + return withMeta( + meta, + async ( + sender?: AccAddress | string, + params?: string[], + typeArguments?: string[], + isRaw?: boolean + ): Promise => { + // const result = await fn(signer, params, typeArguments, isRaw); + const result = await fn(sender, params, typeArguments, isRaw); + return result; + } + ); +} + +/** + * @class Dubhe + * @description This class is used to aggregate the tools that used to interact with SUI network. + */ +export class Dubhe { + public accountManager: InitiaAccountManager; + public initiaInteractor: InitiaInteractor; + // public wallet: Wallet; + public contractFactory: InitiaContractFactory; + public packageId: string | undefined; + public metadata: MoveModule[] | undefined; + + readonly #query: MapModuleFuncQuery = {}; + readonly #tx: MapModuleFuncTx = {}; + /** + * Support the following ways to init the DubheClient: + * 1. mnemonics + * 2. secretKey (base64 or hex) + * If none of them is provided, will generate a random mnemonics with 24 words. + * + * @param mnemonics, 12 or 24 mnemonics words, separated by space + * @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored + * @param networkType, 'testnet' | 'mainnet' | 'devnet' | 'localnet', default is 'devnet' + * @param fullnodeUrl, the fullnode url, default is the preconfig fullnode url for the given network type + * @param packageId + */ + constructor({ + mnemonics, + secretKey, + networkType, + fullnodeUrls, + packageId, + chainId, + metadata, + }: DubheParams = {}) { + // Init the account manager + this.accountManager = new InitiaAccountManager({ mnemonics, secretKey }); + // Init the rpc provider + fullnodeUrls = fullnodeUrls || [ + getDefaultURL(networkType ?? 'mainnet').fullNode, + ]; + chainId = chainId ?? getDefaultURL(networkType ?? 'mainnet').chainId; + this.initiaInteractor = new InitiaInteractor(fullnodeUrls, chainId); + this.packageId = packageId; + if (metadata !== undefined) { + this.metadata = metadata as MoveModule[]; + Object.values(metadata as MoveModule[]).forEach((metadataRes) => { + let contractAddress = metadataRes.address; + let moduleName = metadataRes.name; + Object.values(metadataRes.exposed_functions).forEach((value) => { + const meta: MoveModuleFuncType = { + contractAddress, + moduleName, + funcName: value.name, + isEntry: value.is_entry, + typeParams: value.generic_type_params, + params: value.params, + return: value.return, + }; + + // if (value.is_view) { + if (isUndefined(this.#query[moduleName])) { + this.#query[moduleName] = {}; + } + if (isUndefined(this.#query[moduleName][value.name])) { + this.#query[moduleName][value.name] = createQuery( + meta, + (p, type_p) => this.#read(meta, p, type_p) + ); + } + // } + + // if (value.is_entry) { + if (isUndefined(this.#tx[moduleName])) { + this.#tx[moduleName] = {}; + } + if (isUndefined(this.#tx[moduleName][value.name])) { + this.#tx[moduleName][value.name] = createTx( + meta, + (s, p, type_p, isRaw) => this.#exec(meta, s, p, type_p, isRaw) + ); + } + // } + }); + }); + } + this.contractFactory = new InitiaContractFactory({ + packageId, + metadata, + }); + } + + public get query(): MapModuleFuncQuery { + return this.#query; + } + + public get tx(): MapModuleFuncTx { + return this.#tx; + } + + #exec = async ( + meta: MoveModuleFuncType, + sender?: AccAddress | string, + params?: string[], + typeArguments?: string[], + isRaw?: boolean + ) => { + if (sender === undefined) { + sender = this.accountManager.currentAddress; + } + + const msgs = this.generateMoveCallPayload( + sender, + meta.contractAddress, + meta.moduleName, + meta.funcName, + typeArguments, + params + ); + + if (isRaw === true) { + return msgs; + } + + return await this.signAndSendTxnWithPayload([msgs], sender); + }; + + #read = async ( + meta: MoveModuleFuncType, + params?: string[], + typeArguments?: string[] + ) => { + return this.initiaInteractor.viewFunction( + meta.contractAddress, + meta.moduleName, + meta.funcName, + typeArguments, + params + ); + }; + /** + * if derivePathParams is not provided or mnemonics is empty, it will return the currentSigner. + * else: + * it will generate signer from the mnemonic with the given derivePathParams. + * @param derivePathParams, such as { accountIndex: 2, isExternal: false, addressIndex: 10 }, comply with the BIP44 standard + */ + getSigner(derivePathParams?: DerivePathParams) { + const keyPair = this.accountManager.getKeyPair(derivePathParams); + return keyPair; + } + + /** + * @description Switch the current account with the given derivePathParams + * @param derivePathParams, such as { accountIndex: 2, isExternal: false, addressIndex: 10 }, comply with the BIP44 standard + */ + switchAccount(derivePathParams: DerivePathParams) { + this.accountManager.switchAccount(derivePathParams); + } + + async signAndSendTxnWithPayload( + payloads: MsgExecute[], + sender?: AccAddress | string, + derivePathParams?: DerivePathParams + ) { + const signer = this.getSigner(derivePathParams); + if (sender === undefined) { + sender = signer.accAddress; + } + + if (typeof sender === 'string') { + sender = AccAddress.fromHex(sender); + } + + if (sender) { + payloads.forEach((p) => { + p.sender = sender as AccAddress; + }); + } + + return this.initiaInteractor.sendTxWithPayload(signer, payloads); + } + + generateMoveCallPayload( + sender: AccAddress, + moduleAddress: AccAddress, + moduleName: string, + funcName: string, + typeArguments?: string[], + params?: string[] + ): MsgExecute { + return this.initiaInteractor.moveCall( + sender, + moduleAddress, + moduleName, + funcName, + typeArguments, + params + ); + } + + /** + * @description Get the address of the account for the given derivePathParams + * @param derivePathParams, such as { accountIndex: 2, isExternal: false, addressIndex: 10 }, comply with the BIP44 standard + */ + getAddress(derivePathParams?: DerivePathParams) { + return this.accountManager.getAddress(derivePathParams); + } + + getHexAddress(derivePathParams?: DerivePathParams) { + return AccAddress.toHex(this.getAddress(derivePathParams)); + } + + currentAddress() { + return this.accountManager.currentAddress; + } + + client() { + return this.initiaInteractor.currentClient; + } + + getPackageId() { + return this.contractFactory.packageId; + } + + getMetadata(): MoveModule[] | undefined { + return this.contractFactory.metadata; + } + + async getChainId(): Promise { + return this.initiaInteractor.chainId; + } + + async getBalances(accountAddress?: string) { + if (accountAddress === undefined) { + accountAddress = this.getAddress(); + } + return this.initiaInteractor.balance(accountAddress); + } + + async getBalance(accountAddress?: string, coinType?: string) { + if (accountAddress === undefined) { + accountAddress = this.getAddress(); + } + if (coinType === undefined) { + coinType = 'uinit'; + } + + const resource = await this.initiaInteractor.balanceByDenom( + accountAddress, + coinType + ); + return resource; + } +} + +// async signAndExecuteTransaction( +// transaction: Transaction, +// signer?: Secp256k1Keypair, +// derivePathParams?: DerivePathParams +// ) { +// if (signer === undefined) { +// signer = this.getSigner(derivePathParams); +// } + +// return this.roochInteractor.signAndExecuteTransaction(transaction, signer, { +// withOutput: true, +// }); +// } + +// async signAndSendTransaction( +// tx: Transaction, +// derivePathParams?: DerivePathParams +// ) { +// const sender = this.getSigner(derivePathParams); +// return this.signAndExecuteTransaction(tx, sender); +// } + +// async createSession( +// sessionArgs: { +// appName: string; +// appUrl: string; +// scopes: string[]; +// }, +// signer?: Secp256k1Keypair, +// derivePathParams?: DerivePathParams +// ) { +// if (signer === undefined) { +// signer = this.getSigner(derivePathParams); +// } +// return this.roochInteractor.createSession(sessionArgs, signer); +// } + +// async moveCall(callParams: { +// target: string; +// params?: Args[]; +// typeArguments?: TypeTag[]; +// signer?: Secp256k1Keypair; +// derivePathParams?: DerivePathParams; +// }) { +// const { +// target, +// params = [], +// typeArguments = [], +// signer, +// derivePathParams, +// } = callParams; + +// const effectiveSigner = signer ?? this.getSigner(derivePathParams); +// console.log('effectiveSigner', effectiveSigner.getRoochAddress().toStr()); +// const tx = new Transaction(); +// tx.callFunction({ +// target, +// args: params, +// typeArgs: typeArguments, +// }); +// return this.signAndExecuteTransaction( +// tx, +// effectiveSigner, +// derivePathParams +// ); +// } + +// async publishPackage(callParams: { +// packageBytes: Uint8Array; +// signer?: Secp256k1Keypair; +// derivePathParams?: DerivePathParams; +// }) { +// const { packageBytes, signer, derivePathParams } = callParams; +// return this.moveCall({ +// target: `0x2::module_store::publish_package_entry`, +// params: [Args.vec('u8', Array.from(packageBytes))], +// signer, +// derivePathParams, +// }); +// } + +// async getStates(params: GetStatesParams): Promise { +// return this.roochInteractor.getStates(params); +// } + +// async listStates(params: ListStatesParams): Promise { +// return this.roochInteractor.listStates(params); +// } + +// async getEvents( +// input: GetEventsByEventHandleParams +// ): Promise { +// return this.roochInteractor.getEvents(input); +// } + +// async transfer( +// input: { +// recipient: address; +// amount: number | bigint; +// coinType: TypeArgs; +// }, +// signer?: Secp256k1Keypair, +// derivePathParams?: DerivePathParams +// ): Promise { +// if (signer === undefined) { +// signer = this.getSigner(derivePathParams); +// } +// return this.initiaInteractor.transfer({ +// ...input, +// signer, +// }); +// } + +// async transferObject( +// input: { +// recipient: address; +// objectId: string; +// objectType: TypeArgs; +// }, +// signer?: Secp256k1Keypair, +// derivePathParams?: DerivePathParams +// ): Promise { +// if (signer === undefined) { +// signer = this.getSigner(derivePathParams); +// } +// return this.roochInteractor.transferObject({ +// ...input, +// signer, +// }); +// } diff --git a/packages/initia-client/src/index.ts b/packages/initia-client/src/index.ts new file mode 100644 index 000000000..7cf5d011a --- /dev/null +++ b/packages/initia-client/src/index.ts @@ -0,0 +1,7 @@ +export * from '@initia/initia.js'; +export { Dubhe } from './dubhe'; +export { InitiaAccountManager } from './libs/initiaAccountManager'; +export { InitiaContractFactory } from './libs/initiaContractFactory'; +export { InitiaInteractor } from './libs/initiaInteractor'; +export { loadMetadata } from './metadata'; +export type * from './types'; diff --git a/packages/initia-client/src/libs/initiaAccountManager/crypto.ts b/packages/initia-client/src/libs/initiaAccountManager/crypto.ts new file mode 100644 index 000000000..059664f99 --- /dev/null +++ b/packages/initia-client/src/libs/initiaAccountManager/crypto.ts @@ -0,0 +1,7 @@ +import { generateMnemonic as genMnemonic } from '@scure/bip39'; +import { wordlist } from '@scure/bip39/wordlists/english'; + +export const generateMnemonic = (numberOfWords: 12 | 24 = 24) => { + const strength = numberOfWords === 12 ? 128 : 256; + return genMnemonic(wordlist, strength); +}; diff --git a/packages/initia-client/src/libs/initiaAccountManager/index.ts b/packages/initia-client/src/libs/initiaAccountManager/index.ts new file mode 100644 index 000000000..d031e8407 --- /dev/null +++ b/packages/initia-client/src/libs/initiaAccountManager/index.ts @@ -0,0 +1,66 @@ +import { RawKey, Key, AccAddress } from '@initia/initia.js'; +import { getKeyPair } from './keypair'; +import { generateMnemonic } from './crypto'; +import type { AccountMangerParams, DerivePathParams } from '../../types'; + +export class InitiaAccountManager { + private mnemonics: string; + private secretKey: string; + public currentKeyPair: Key; + public currentAddress: string; + + /** + * Support the following ways to init the InitiaToolkit: + * 1. mnemonics + * 2. secretKey (base64 or hex) + * If none of them is provided, will generate a random mnemonics with 24 words. + * + * @param mnemonics, 12 or 24 mnemonics words, separated by space + * @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored + */ + constructor({ mnemonics, secretKey }: AccountMangerParams = {}) { + // If the mnemonics or secretKey is provided, use it + // Otherwise, generate a random mnemonics with 24 words + this.mnemonics = mnemonics || ''; + this.secretKey = secretKey || ''; + if (!this.mnemonics && !this.secretKey) { + this.mnemonics = generateMnemonic(24); + } + this.currentKeyPair = this.secretKey + ? RawKey.fromHex(secretKey!) + : getKeyPair(this.mnemonics); + + this.currentAddress = this.currentKeyPair.accAddress; + } + + /** + * if derivePathParams is not provided or mnemonics is empty, it will return the currentKeyPair. + * else: + * it will generate keyPair from the mnemonic with the given derivePathParams. + */ + getKeyPair(derivePathParams?: DerivePathParams) { + if (!derivePathParams || !this.mnemonics) return this.currentKeyPair; + return getKeyPair(this.mnemonics, derivePathParams); + } + + /** + * if derivePathParams is not provided or mnemonics is empty, it will return the currentAddress. + * else: + * it will generate address from the mnemonic with the given derivePathParams. + */ + getAddress(derivePathParams?: DerivePathParams): AccAddress { + if (!derivePathParams || !this.mnemonics) return this.currentAddress; + return getKeyPair(this.mnemonics, derivePathParams).accAddress; + } + + /** + * Switch the current account with the given derivePathParams. + * This is only useful when the mnemonics is provided. For secretKey mode, it will always use the same account. + */ + switchAccount(derivePathParams: DerivePathParams) { + if (this.mnemonics) { + this.currentKeyPair = getKeyPair(this.mnemonics, derivePathParams); + this.currentAddress = this.currentKeyPair.accAddress; + } + } +} diff --git a/packages/initia-client/src/libs/initiaAccountManager/keypair.ts b/packages/initia-client/src/libs/initiaAccountManager/keypair.ts new file mode 100644 index 000000000..e906f903b --- /dev/null +++ b/packages/initia-client/src/libs/initiaAccountManager/keypair.ts @@ -0,0 +1,39 @@ +import { MnemonicKey, Wallet } from '@initia/initia.js'; +import type { DerivePathParams } from '../../types'; + +/** + * @description Get derive path for ROOCH + * @param derivePathParams + */ +export const getDerivePathForInitia = ( + derivePathParams: DerivePathParams = {} +) => { + const { + coinType = 784, + accountIndex = 0, + addressIndex = 0, + eth = false, + } = derivePathParams; + return { + account: accountIndex, + index: addressIndex, + coinType, + eth, + }; +}; + +/** + * @description Get keypair from mnemonics and derive path + * @param mnemonics + * @param derivePathParams + */ +export const getKeyPair = ( + mnemonics: string, + derivePathParams: DerivePathParams = {} +) => { + const derivePath = getDerivePathForInitia(derivePathParams); + return new MnemonicKey({ + mnemonic: mnemonics, + ...derivePath, + }); +}; diff --git a/packages/initia-client/src/libs/initiaAccountManager/util.ts b/packages/initia-client/src/libs/initiaAccountManager/util.ts new file mode 100644 index 000000000..54ec21a00 --- /dev/null +++ b/packages/initia-client/src/libs/initiaAccountManager/util.ts @@ -0,0 +1,55 @@ +/** + * @description This regular expression matches any string that contains only hexadecimal digits (0-9, A-F, a-f). + * @param str + */ +export const isHex = (str: string) => + /^0x[0-9a-fA-F]+$|^[0-9a-fA-F]+$/.test(str); + +/** + * @description This regular expression matches any string that contains only base64 digits (0-9, A-Z, a-z, +, /, =). + * Note that the "=" signs at the end are optional padding characters that may be present in some base64 encoded strings. + * @param str + */ +export const isBase64 = (str: string) => /^[a-zA-Z0-9+/]+={0,2}$/g.test(str); + +/** + * Convert a hex string to Uint8Array + * @param hexStr + */ +export const fromHEX = (hexStr: string): Uint8Array => { + if (!hexStr) { + throw new Error('cannot parse empty string to Uint8Array'); + } + const intArr = hexStr + .replace('0x', '') + .match(/.{1,2}/g) + ?.map((byte) => parseInt(byte, 16)); + + if (!intArr || intArr.length === 0) { + throw new Error(`Unable to parse HEX: ${hexStr}`); + } + return Uint8Array.from(intArr); +}; + +const PRIVATE_KEY_SIZE = 32; +const LEGACY_PRIVATE_KEY_SIZE = 64; +/** + * normalize a private key + * A private key is a 32-byte array. + * But there are two different formats for private keys: + * 1. A 32-byte array + * 2. A 64-byte array with the first 32 bytes being the private key and the last 32 bytes being the public key + * 3. A 33-byte array with the first byte being 0x00 (sui.keystore key is a Base64 string with scheme flag 0x00 at the beginning) + */ +export const normalizePrivateKey = (key: Uint8Array): Uint8Array => { + if (key.length === LEGACY_PRIVATE_KEY_SIZE) { + // This is a legacy secret key, we need to strip the public key bytes and only read the first 32 bytes + key = key.slice(0, PRIVATE_KEY_SIZE); + } else if (key.length === PRIVATE_KEY_SIZE + 1 && key[0] === 0) { + // sui.keystore key is a Base64 string with scheme flag 0x00 at the beginning + return key.slice(1); + } else if (key.length === PRIVATE_KEY_SIZE) { + return key; + } + throw new Error('invalid secret key'); +}; diff --git a/packages/initia-client/src/libs/initiaContractFactory/index.ts b/packages/initia-client/src/libs/initiaContractFactory/index.ts new file mode 100644 index 000000000..f18c253c2 --- /dev/null +++ b/packages/initia-client/src/libs/initiaContractFactory/index.ts @@ -0,0 +1,15 @@ +import type { ContractFactoryParams, MoveModule } from './types'; + +export class InitiaContractFactory { + public packageId: string; + public metadata: MoveModule[] | undefined; + + /** + * @param packageId + * @param metadata + */ + constructor({ packageId, metadata }: ContractFactoryParams = {}) { + this.packageId = packageId || ''; + this.metadata = metadata || undefined; + } +} diff --git a/packages/initia-client/src/libs/initiaContractFactory/types.ts b/packages/initia-client/src/libs/initiaContractFactory/types.ts new file mode 100644 index 000000000..dcae508e6 --- /dev/null +++ b/packages/initia-client/src/libs/initiaContractFactory/types.ts @@ -0,0 +1,1500 @@ +export type ContractFactoryParams = { + packageId?: string; + metadata?: MoveModule[]; +}; + +/** + * Different MIME types used for data interchange in transactions and responses. + */ +export enum MimeType { + /** + * JSON representation, used for transaction submission and accept type JSON output + */ + JSON = 'application/json', + /** + * BCS representation, used for accept type BCS output + */ + BCS = 'application/x-bcs', + /** + * BCS representation, used for transaction submission in BCS input + */ + BCS_SIGNED_TRANSACTION = 'application/x.aptos.signed_transaction+bcs', + BCS_VIEW_FUNCTION = 'application/x.aptos.view_function+bcs', +} + +/** + * Hexadecimal data input for functions, supporting both string and Uint8Array formats. + */ +export type HexInput = string | Uint8Array; + +/** + * Variants of type tags used in the system, encompassing various data types and structures. + * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27} + */ +export enum TypeTagVariants { + Bool = 0, + U8 = 1, + U64 = 2, + U128 = 3, + Address = 4, + Signer = 5, + Vector = 6, + Struct = 7, + U16 = 8, + U32 = 9, + U256 = 10, + Reference = 254, // This is specifically a placeholder and does not represent a real type + Generic = 255, // This is specifically a placeholder and does not represent a real type +} + +/** + * Variants of script transaction arguments used in Rust, encompassing various data types for transaction processing. + * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11} + */ +export enum ScriptTransactionArgumentVariants { + U8 = 0, + U64 = 1, + U128 = 2, + Address = 3, + U8Vector = 4, + Bool = 5, + U16 = 6, + U32 = 7, + U256 = 8, + Serialized = 9, +} + +/** + * The payload for various transaction types in the system. + * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478} + */ +export enum TransactionPayloadVariants { + Script = 0, + EntryFunction = 2, + Multisig = 3, +} + +/** + * Variants of transactions used in the system. + * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440} + */ +export enum TransactionVariants { + MultiAgentTransaction = 0, + FeePayerTransaction = 1, +} + +/** + * Variants of transaction authenticators used in the system. + * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44} + */ +export enum TransactionAuthenticatorVariant { + Ed25519 = 0, + MultiEd25519 = 1, + MultiAgent = 2, + FeePayer = 3, + SingleSender = 4, +} + +/** + * Variants of account authenticators used in transactions. + * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414} + */ +export enum AccountAuthenticatorVariant { + Ed25519 = 0, + MultiEd25519 = 1, + SingleKey = 2, + MultiKey = 3, + NoAccountAuthenticator = 4, +} + +/** + * Variants of private keys that can comply with the AIP-80 standard. + * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md} + */ +export enum PrivateKeyVariants { + Ed25519 = 'ed25519', + Secp256k1 = 'secp256k1', +} + +/** + * Variants of public keys used in cryptographic operations. + */ +export enum AnyPublicKeyVariant { + Ed25519 = 0, + Secp256k1 = 1, + Keyless = 3, + FederatedKeyless = 4, +} + +/** + * Variants of signature types used for cryptographic operations. + */ +export enum AnySignatureVariant { + Ed25519 = 0, + Secp256k1 = 1, + Keyless = 3, +} + +/** + * Variants of ephemeral public keys used in cryptographic operations. + */ +export enum EphemeralPublicKeyVariant { + Ed25519 = 0, +} + +/** + * Variants of ephemeral signatures used for secure communication. + */ +export enum EphemeralSignatureVariant { + Ed25519 = 0, +} + +/** + * Variants of ephemeral certificates used in secure transactions. + */ +export enum EphemeralCertificateVariant { + ZkProof = 0, +} + +/** + * Variants of zero-knowledge proofs used in cryptographic operations. + */ +export enum ZkpVariant { + Groth16 = 0, +} + +/** + * BCS types + */ +export type Uint8 = number; + +/** + * A 16-bit unsigned integer. + */ +export type Uint16 = number; + +/** + * A 32-bit unsigned integer. + */ +export type Uint32 = number; + +/** + * A 64-bit unsigned integer value. + */ +export type Uint64 = bigint; + +/** + * A 128-bit unsigned integer used for precise arithmetic operations. + */ +export type Uint128 = bigint; + +/** + * A 256-bit unsigned integer used for precise numerical calculations. + */ +export type Uint256 = bigint; + +/** + * A number or a bigint value. + */ +export type AnyNumber = number | bigint; + +/** + * Defines the parameters for paginating query results, including the starting position and maximum number of items to return. + * @param offset Specifies the starting position of the query result. Default is 0. + * @param limit Specifies the maximum number of items to return. Default is 25. + */ +export interface PaginationArgs { + offset?: AnyNumber; + limit?: number; +} + +export interface WhereArg { + where?: T; +} + +/** + * QUERY TYPES + */ + +/** + * A configuration object for requests to the server, including API key, extra headers, and cookie handling options. + */ +export type ClientConfig = ClientHeadersType & { + WITH_CREDENTIALS?: boolean; + API_KEY?: string; +}; + +/** + * A configuration object for a Fullnode, allowing for the inclusion of extra headers in requests. + */ +export type FullNodeConfig = ClientHeadersType; + +/** + * An Indexer configuration object for sending requests with additional headers. + */ +export type IndexerConfig = ClientHeadersType; + +/** + * A configuration object for a faucet, including optional authentication and headers for requests. + */ +export type FaucetConfig = ClientHeadersType & { + AUTH_TOKEN?: string; +}; + +/** + * General type definition for client headers. + */ +export type ClientHeadersType = { + HEADERS?: Record; +}; + +/** + * Represents a client for making requests to a service provider. + * + * @param Req - The type of the request payload. + * @param Res - The type of the response payload. + */ +export interface ClientRequest { + url: string; + method: 'GET' | 'POST'; + originMethod?: string; + body?: Req; + contentType?: string; + params?: any; + overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig; + headers?: Record; +} + +export interface ClientResponse { + status: number; + statusText: string; + data: Res; + config?: any; + request?: any; + response?: any; + headers?: any; +} + +export interface Client { + /** + * Sends a request to the specified URL with the given options. + * + * @param requestOptions - The options for the request. + * @param requestOptions.url - The URL to send the request to. + * @param requestOptions.method - The HTTP method to use, either "GET" or "POST". + * @param requestOptions.path - An optional path to append to the URL. + * @param requestOptions.body - The body of the request, applicable for POST requests. + * @param requestOptions.contentType - The content type of the request body. + * @param requestOptions.acceptType - The expected content type of the response. + * @param requestOptions.params - Optional parameters to include in the request. + * @param requestOptions.originMethod - An optional method to specify the origin of the request. + * @param requestOptions.overrides - Optional configuration overrides for the request. + */ + provider( + requestOptions: ClientRequest + ): Promise>; +} + +/** + * The API request type + * + * @param url - the url to make the request to, i.e. https://fullnode.devnet.aptoslabs.com/v1 + * @param method - the request method "GET" | "POST" + * @param endpoint (optional) - the endpoint to make the request to, i.e. transactions + * @param body (optional) - the body of the request + * @param contentType (optional) - the content type to set the `content-type` header to, + * by default is set to `application/json` + * @param params (optional) - query params to add to the request + * @param originMethod (optional) - the local method the request came from + * @param overrides (optional) - a `ClientConfig` object type to override request data + */ +export type AptosRequest = { + url: string; + method: 'GET' | 'POST'; + path?: string; + body?: any; + contentType?: string; + acceptType?: string; + params?: Record; + originMethod?: string; + overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig; +}; + +/** + * The API response type + * + * @param status - the response status. i.e. 200 + * @param statusText - the response message + * @param data the response data + * @param url the url the request was made to + * @param headers the response headers + * @param config (optional) - the request object + * @param request (optional) - the request object + */ +export interface AptosResponse { + status: number; + statusText: string; + data: Res; + url: string; + headers: any; + config?: any; + request?: Req; +} + +/** + * The ledger version of transactions, defaulting to the latest version if not specified. + */ +export type LedgerVersionArg = { + ledgerVersion?: AnyNumber; +}; + +/** + * RESPONSE TYPES + */ + +/** + * The output of the estimate gas API, including the deprioritized estimate for the gas unit price. + */ +export type GasEstimation = { + /** + * The deprioritized estimate for the gas unit price + */ + deprioritized_gas_estimate?: number; + /** + * The current estimate for the gas unit price + */ + gas_estimate: number; + /** + * The prioritized estimate for the gas unit price + */ + prioritized_gas_estimate?: number; +}; + +export type MoveResource = { + type: MoveStructId; + data: T; +}; + +/** + * The data associated with an account, including its sequence number. + */ +export type AccountData = { + sequence_number: string; + authentication_key: string; +}; + +/** + * A Move module containing an address. + */ +export type MoveModuleBytecode = { + bytecode: string; + abi?: MoveModule; +}; + +/** + * TRANSACTION TYPES + */ + +/** + * Different types of transaction responses that can occur in the system. + */ +export enum TransactionResponseType { + Pending = 'pending_transaction', + User = 'user_transaction', + Genesis = 'genesis_transaction', + BlockMetadata = 'block_metadata_transaction', + StateCheckpoint = 'state_checkpoint_transaction', + Validator = 'validator_transaction', + BlockEpilogue = 'block_epilogue_transaction', +} + +/** + * The response for a transaction, which can be either pending or committed. + */ +export type TransactionResponse = + | PendingTransactionResponse + | CommittedTransactionResponse; + +/** + * The response for a committed transaction, which can be one of several transaction types. + */ +export type CommittedTransactionResponse = + | UserTransactionResponse + | GenesisTransactionResponse + | BlockMetadataTransactionResponse + | StateCheckpointTransactionResponse + | ValidatorTransactionResponse + | BlockEpilogueTransactionResponse; + +/** + * Determine if the given transaction response is currently pending. + * + * @param response - The transaction response to evaluate. + * @returns A boolean indicating whether the transaction is pending. + */ +export function isPendingTransactionResponse( + response: TransactionResponse +): response is PendingTransactionResponse { + return response.type === TransactionResponseType.Pending; +} + +/** + * Determines if the given transaction response is a user transaction. + * + * @param response - The transaction response to evaluate. + * @returns A boolean indicating whether the transaction is of type User. + */ +export function isUserTransactionResponse( + response: TransactionResponse +): response is UserTransactionResponse { + return response.type === TransactionResponseType.User; +} + +/** + * Determines if the given transaction response is a Genesis transaction. + * + * @param response - The transaction response to evaluate. + * @returns A boolean indicating whether the transaction is a Genesis transaction. + */ +export function isGenesisTransactionResponse( + response: TransactionResponse +): response is GenesisTransactionResponse { + return response.type === TransactionResponseType.Genesis; +} + +/** + * Determine if the given transaction response is of type BlockMetadata. + * + * @param response - The transaction response to evaluate. + * @returns A boolean indicating whether the response is a BlockMetadata transaction. + */ +export function isBlockMetadataTransactionResponse( + response: TransactionResponse +): response is BlockMetadataTransactionResponse { + return response.type === TransactionResponseType.BlockMetadata; +} + +/** + * Determines if the provided transaction response is a state checkpoint transaction. + * + * @param response - The transaction response to evaluate. + * @returns A boolean indicating whether the transaction response is of type StateCheckpoint. + */ +export function isStateCheckpointTransactionResponse( + response: TransactionResponse +): response is StateCheckpointTransactionResponse { + return response.type === TransactionResponseType.StateCheckpoint; +} + +/** + * Determine if the given transaction response is of type Validator. + * + * @param response - The transaction response to evaluate. + * @returns A boolean indicating whether the transaction response is a Validator type. + */ +export function isValidatorTransactionResponse( + response: TransactionResponse +): response is ValidatorTransactionResponse { + return response.type === TransactionResponseType.Validator; +} + +/** + * Determines if the given transaction response is of the type Block Epilogue. + * + * @param response - The transaction response to evaluate. + * @returns A boolean indicating whether the response is a Block Epilogue transaction. + */ +export function isBlockEpilogueTransactionResponse( + response: TransactionResponse +): response is BlockEpilogueTransactionResponse { + return response.type === TransactionResponseType.BlockEpilogue; +} + +/** + * The response for a pending transaction, indicating that the transaction is still being processed. + */ +export type PendingTransactionResponse = { + type: TransactionResponseType.Pending; + hash: string; + sender: string; + sequence_number: string; + max_gas_amount: string; + gas_unit_price: string; + expiration_timestamp_secs: string; + payload: TransactionPayloadResponse; + signature?: TransactionSignature; +}; + +/** + * The response structure for a user transaction. + */ +export type UserTransactionResponse = { + type: TransactionResponseType.User; + version: string; + hash: string; + state_change_hash: string; + event_root_hash: string; + state_checkpoint_hash: string | null; + gas_used: string; + /** + * Whether the transaction was successful + */ + success: boolean; + /** + * The VM status of the transaction, can tell useful information in a failure + */ + vm_status: string; + accumulator_root_hash: string; + /** + * Final state of resources changed by the transaction + */ + changes: Array; + sender: string; + sequence_number: string; + max_gas_amount: string; + gas_unit_price: string; + expiration_timestamp_secs: string; + payload: TransactionPayloadResponse; + signature?: TransactionSignature; + /** + * Events generated by the transaction + */ + events: Array; + timestamp: string; +}; + +/** + * The response for a genesis transaction, indicating the type of transaction. + */ +export type GenesisTransactionResponse = { + type: TransactionResponseType.Genesis; + version: string; + hash: string; + state_change_hash: string; + event_root_hash: string; + state_checkpoint_hash?: string; + gas_used: string; + /** + * Whether the transaction was successful + */ + success: boolean; + /** + * The VM status of the transaction, can tell useful information in a failure + */ + vm_status: string; + accumulator_root_hash: string; + /** + * Final state of resources changed by the transaction + */ + changes: Array; + payload: GenesisPayload; + /** + * Events emitted during genesis + */ + events: Array; +}; + +/** + * The structure representing a blockchain block with its height. + */ +export type BlockMetadataTransactionResponse = { + type: TransactionResponseType.BlockMetadata; + version: string; + hash: string; + state_change_hash: string; + event_root_hash: string; + state_checkpoint_hash: string | null; + gas_used: string; + /** + * Whether the transaction was successful + */ + success: boolean; + /** + * The VM status of the transaction, can tell useful information in a failure + */ + vm_status: string; + accumulator_root_hash: string; + /** + * Final state of resources changed by the transaction + */ + changes: Array; + id: string; + epoch: string; + round: string; + /** + * The events emitted at the block creation + */ + events: Array; + /** + * Previous block votes + */ + previous_block_votes_bitvec: Array; + proposer: string; + /** + * The indices of the proposers who failed to propose + */ + failed_proposer_indices: Array; + timestamp: string; +}; + +/** + * The response for a state checkpoint transaction, indicating the type of transaction. + */ +export type StateCheckpointTransactionResponse = { + type: TransactionResponseType.StateCheckpoint; + version: string; + hash: string; + state_change_hash: string; + event_root_hash: string; + state_checkpoint_hash: string | null; + gas_used: string; + /** + * Whether the transaction was successful + */ + success: boolean; + /** + * The VM status of the transaction, can tell useful information in a failure + */ + vm_status: string; + accumulator_root_hash: string; + /** + * Final state of resources changed by the transaction + */ + changes: Array; + timestamp: string; +}; + +/** + * The response for a validator transaction, indicating the type of transaction. + */ +export type ValidatorTransactionResponse = { + type: TransactionResponseType.Validator; + version: string; + hash: string; + state_change_hash: string; + event_root_hash: string; + state_checkpoint_hash: string | null; + gas_used: string; + /** + * Whether the transaction was successful + */ + success: boolean; + /** + * The VM status of the transaction, can tell useful information in a failure + */ + vm_status: string; + accumulator_root_hash: string; + /** + * Final state of resources changed by the transaction + */ + changes: Array; + /** + * The events emitted by the validator transaction + */ + events: Array; + timestamp: string; +}; + +/** + * Describes the gas state of the block, indicating whether the block gas limit has been reached. + */ +export type BlockEndInfo = { + block_gas_limit_reached: boolean; + block_output_limit_reached: boolean; + block_effective_block_gas_units: number; + block_approx_output_size: number; +}; + +/** + * A transaction executed at the end of a block that tracks data from the entire block. + */ +export type BlockEpilogueTransactionResponse = { + type: TransactionResponseType.BlockEpilogue; + version: string; + hash: string; + state_change_hash: string; + event_root_hash: string; + state_checkpoint_hash: string | null; + gas_used: string; + /** + * Whether the transaction was successful + */ + success: boolean; + /** + * The VM status of the transaction, can tell useful information in a failure + */ + vm_status: string; + accumulator_root_hash: string; + /** + * Final state of resources changed by the transaction + */ + changes: Array; + timestamp: string; + block_end_info: BlockEndInfo | null; +}; + +/** + * WRITESET CHANGE TYPES + */ + +/** + * A union type that encompasses both script and direct write sets for data operations. + */ +export type WriteSetChange = + | WriteSetChangeDeleteModule + | WriteSetChangeDeleteResource + | WriteSetChangeDeleteTableItem + | WriteSetChangeWriteModule + | WriteSetChangeWriteResource + | WriteSetChangeWriteTableItem; + +/** + * The structure for a module deletion change in a write set. + */ +export type WriteSetChangeDeleteModule = { + type: string; + address: string; + /** + * State key hash + */ + state_key_hash: string; + module: MoveModuleId; +}; + +/** + * The payload for a resource deletion in a write set change. + */ +export type WriteSetChangeDeleteResource = { + type: string; + address: string; + state_key_hash: string; + resource: string; +}; + +/** + * The payload for a write set change that deletes a table item. + */ +export type WriteSetChangeDeleteTableItem = { + type: string; + state_key_hash: string; + handle: string; + key: string; + data?: DeletedTableData; +}; + +/** + * The structure for a write module change in a write set. + */ +export type WriteSetChangeWriteModule = { + type: string; + address: string; + state_key_hash: string; + data: MoveModuleBytecode; +}; + +/** + * The resource associated with a write set change, identified by its type. + */ +export type WriteSetChangeWriteResource = { + type: string; + address: string; + state_key_hash: string; + data: MoveResource; +}; + +/** + * The structure for a write operation on a table in a write set change. + */ +export type WriteSetChangeWriteTableItem = { + type: string; + state_key_hash: string; + handle: string; + key: string; + value: string; + data?: DecodedTableData; +}; + +/** + * The decoded data for a table, including its key in JSON format. + */ +export type DecodedTableData = { + /** + * Key of table in JSON + */ + key: any; + /** + * Type of key + */ + key_type: string; + /** + * Value of table in JSON + */ + value: any; + /** + * Type of value + */ + value_type: string; +}; + +/** + * Data for a deleted table entry. + */ +export type DeletedTableData = { + /** + * Deleted key + */ + key: any; + /** + * Deleted key type + */ + key_type: string; +}; + +/** + * The payload for a transaction response, which can be an entry function, script, or multisig payload. + */ +export type TransactionPayloadResponse = + | EntryFunctionPayloadResponse + | ScriptPayloadResponse + | MultisigPayloadResponse; + +/** + * The response payload for an entry function, containing the type of the entry. + */ +export type EntryFunctionPayloadResponse = { + type: string; + function: MoveFunctionId; + /** + * Type arguments of the function + */ + type_arguments: Array; + /** + * Arguments of the function + */ + arguments: Array; +}; + +/** + * The payload for a script response, containing the type of the script. + */ +export type ScriptPayloadResponse = { + type: string; + code: MoveScriptBytecode; + /** + * Type arguments of the function + */ + type_arguments: Array; + /** + * Arguments of the function + */ + arguments: Array; +}; + +/** + * The response payload for a multisig transaction, containing the type of the transaction. + */ +export type MultisigPayloadResponse = { + type: string; + multisig_address: string; + transaction_payload?: EntryFunctionPayloadResponse; +}; + +/** + * The payload for the genesis block containing the type of the payload. + */ +export type GenesisPayload = { + type: string; + write_set: WriteSet; +}; + +/** + * The bytecode for a Move script. + */ +export type MoveScriptBytecode = { + bytecode: string; + abi?: MoveFunction; +}; + +/** + * JSON representations of transaction signatures returned from the node API. + */ +export type TransactionSignature = + | TransactionEd25519Signature + | TransactionSecp256k1Signature + | TransactionMultiEd25519Signature + | TransactionMultiAgentSignature + | TransactionFeePayerSignature; + +/** + * Determine if the provided signature is an Ed25519 signature. + * This function checks for the presence of the "signature" property + * and verifies that its value is "ed25519_signature". + * + * @param signature - The transaction signature to be checked. + * @returns A boolean indicating whether the signature is an Ed25519 signature. + */ +export function isEd25519Signature( + signature: TransactionSignature +): signature is TransactionFeePayerSignature { + return ( + 'signature' in signature && signature.signature === 'ed25519_signature' + ); +} + +/** + * Determine if the provided signature is a valid secp256k1 ECDSA signature. + * + * @param signature - The transaction signature to validate. + * @returns A boolean indicating whether the signature is a secp256k1 ECDSA signature. + */ +export function isSecp256k1Signature( + signature: TransactionSignature +): signature is TransactionFeePayerSignature { + return ( + 'signature' in signature && + signature.signature === 'secp256k1_ecdsa_signature' + ); +} + +/** + * Determine if the provided transaction signature is a multi-agent signature. + * + * @param signature - The transaction signature to evaluate. + * @returns A boolean indicating whether the signature is a multi-agent signature. + */ +export function isMultiAgentSignature( + signature: TransactionSignature +): signature is TransactionMultiAgentSignature { + return signature.type === 'multi_agent_signature'; +} + +/** + * Determine if the provided signature is a fee payer signature. + * + * @param signature - The transaction signature to evaluate. + * @returns A boolean indicating whether the signature is a fee payer signature. + */ +export function isFeePayerSignature( + signature: TransactionSignature +): signature is TransactionFeePayerSignature { + return signature.type === 'fee_payer_signature'; +} + +/** + * Determine if the provided signature is of type "multi_ed25519_signature". + * + * @param signature - The transaction signature to check. + * @returns A boolean indicating whether the signature is a multi-ed25519 signature. + */ +export function isMultiEd25519Signature( + signature: TransactionSignature +): signature is TransactionMultiEd25519Signature { + return signature.type === 'multi_ed25519_signature'; +} + +/** + * The signature for a transaction using the Ed25519 algorithm. + */ +export type TransactionEd25519Signature = { + type: string; + public_key: string; + signature: 'ed25519_signature'; +}; + +/** + * The structure for a Secp256k1 signature in a transaction. + */ +export type TransactionSecp256k1Signature = { + type: string; + public_key: string; + signature: 'secp256k1_ecdsa_signature'; +}; + +/** + * The structure for a multi-signature transaction using Ed25519. + */ +export type TransactionMultiEd25519Signature = { + type: 'multi_ed25519_signature'; + /** + * The public keys for the Ed25519 signature + */ + public_keys: Array; + /** + * Signature associated with the public keys in the same order + */ + signatures: Array; + /** + * The number of signatures required for a successful transaction + */ + threshold: number; + bitmap: string; +}; + +/** + * The structure for a multi-agent signature in a transaction. + */ +export type TransactionMultiAgentSignature = { + type: 'multi_agent_signature'; + sender: AccountSignature; + /** + * The other involved parties' addresses + */ + secondary_signer_addresses: Array; + /** + * The associated signatures, in the same order as the secondary addresses + */ + secondary_signers: Array; +}; + +/** + * The signature of the fee payer in a transaction. + */ +export type TransactionFeePayerSignature = { + type: 'fee_payer_signature'; + sender: AccountSignature; + /** + * The other involved parties' addresses + */ + secondary_signer_addresses: Array; + /** + * The associated signatures, in the same order as the secondary addresses + */ + secondary_signers: Array; + fee_payer_address: string; + fee_payer_signer: AccountSignature; +}; + +/** + * The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures. + */ +export type AccountSignature = + | TransactionEd25519Signature + | TransactionSecp256k1Signature + | TransactionMultiEd25519Signature; + +export type WriteSet = ScriptWriteSet | DirectWriteSet; + +/** + * The set of properties for writing scripts, including the type of script. + */ +export type ScriptWriteSet = { + type: string; + execute_as: string; + script: ScriptPayloadResponse; +}; + +/** + * The set of direct write operations, identified by a type string. + */ +export type DirectWriteSet = { + type: string; + changes: Array; + events: Array; +}; + +/** + * The structure for an event's unique identifier, including its creation number. + */ + +/** + * The structure for an event, identified by a unique GUID. + */ +export type EventGuid = { + creation_number: string; + account_address: string; +}; + +export type Event = { + guid: EventGuid; + sequence_number: string; + type: string; + /** + * The JSON representation of the event + */ + data: any; +}; + +/** + * A number representing a Move uint8 type. + */ +export type MoveUint8Type = number; + +/** + * A 16-bit unsigned integer used in the Move programming language. + */ +export type MoveUint16Type = number; + +/** + * A 32-bit unsigned integer type used in Move programming. + */ +export type MoveUint32Type = number; + +/** + * A string representation of a 64-bit unsigned integer used in Move programming. + */ +export type MoveUint64Type = string; + +/** + * A string representing a 128-bit unsigned integer in the Move programming language. + */ +export type MoveUint128Type = string; + +/** + * A string representation of a 256-bit unsigned integer used in Move programming. + */ +export type MoveUint256Type = string; + +/** + * A string representing a Move address. + */ +export type MoveAddressType = string; + +/** + * The type for identifying objects to be moved within the system. + */ +export type MoveObjectType = string; + +/** + * The type for move options, which can be a MoveType, null, or undefined. + */ +export type MoveOptionType = MoveType | null | undefined; + +/** + * A structure representing a move with a name. + */ +export type MoveStructId = `${string}::${string}::${string}`; + +/** + * The move function containing its name. Same as MoveStructId since it reads weird to take a StructId for a Function. + */ +export type MoveFunctionId = MoveStructId; + +// TODO: Add support for looking up ABI to add proper typing +export type MoveStructType = {}; + +/** + * A union type that encompasses various data types used in Move, including primitive types, address types, object types, and + * arrays of MoveType. + */ +export type MoveType = + | boolean + | string + | MoveUint8Type + | MoveUint16Type + | MoveUint32Type + | MoveUint64Type + | MoveUint128Type + | MoveUint256Type + | MoveAddressType + | MoveObjectType + | MoveStructType + | Array; + +/** + * Possible Move values acceptable by move functions (entry, view) + * + * Map of a Move value to the corresponding TypeScript value + * + * `Bool -> boolean` + * + * `u8, u16, u32 -> number` + * + * `u64, u128, u256 -> string` + * + * `String -> string` + * + * `Address -> 0x${string}` + * + * `Struct - 0x${string}::${string}::${string}` + * + * `Object -> 0x${string}` + * + * `Vector -> Array` + * + * `Option -> MoveValue | null | undefined` + */ +export type MoveValue = + | boolean + | string + | MoveUint8Type + | MoveUint16Type + | MoveUint32Type + | MoveUint64Type + | MoveUint128Type + | MoveUint256Type + | MoveAddressType + | MoveObjectType + | MoveStructId + | MoveOptionType + | Array; + +/** + * A string representation of a Move module, formatted as `module_name::function_name`. + * Module names are case-sensitive. + */ +export type MoveModuleId = `${string}::${string}`; + +/** + * Specifies the visibility levels for move functions, controlling access permissions. + */ +export enum MoveFunctionVisibility { + PRIVATE = 'private', + PUBLIC = 'public', + FRIEND = 'friend', +} + +/** + * Abilities related to moving items within the system. + */ +export enum MoveAbility { + STORE = 'store', + DROP = 'drop', + KEY = 'key', + COPY = 'copy', +} + +/** + * Move abilities associated with the generic type parameter of a function. + */ +export type MoveFunctionGenericTypeParam = { + constraints: Array; +}; + +/** + * A field in a Move struct, identified by its name. + */ +export type MoveStructField = { + name: string; + type: string; +}; + +/** + * A Move module + */ +export type MoveModule = { + address: string; + name: string; + /** + * Friends of the module + */ + friends: Array; + /** + * Public functions of the module + */ + exposed_functions: Array; + /** + * Structs of the module + */ + structs: Array; +}; + +/** + * A move struct + */ +export type MoveStruct = { + name: string; + /** + * Whether the struct is a native struct of Move + */ + is_native: boolean; + // /** // TODO: initia todo + // * Whether the struct is a module event (aka v2 event). This will be false for v1 + // * events because the value is derived from the #[event] attribute on the struct in + // * the Move source code. This attribute is only relevant for v2 events. + // */ + // is_event: boolean; + /** + * Abilities associated with the struct + */ + abilities: Array; + /** + * Generic types associated with the struct + */ + generic_type_params: Array; + /** + * Fields associated with the struct + */ + fields: Array; +}; + +/** + * Move function + */ +export type MoveFunction = { + name: string; + visibility: MoveFunctionVisibility; + /** + * Whether the function can be called as an entry function directly in a transaction + */ + is_entry: boolean; + /** + * Whether the function is a view function or not + */ + is_view: boolean; + /** + * Generic type params associated with the Move function + */ + generic_type_params: Array; + /** + * Parameters associated with the move function + */ + params: Array; + /** + * Return type of the function + */ + return: Array; +}; + +/** + * Roles that can be assigned within the system, indicating different levels of access and functionality. + */ +export enum RoleType { + VALIDATOR = 'validator', + FULL_NODE = 'full_node', +} + +/** + * Information about the current blockchain ledger, including its chain ID. + */ +export type LedgerInfo = { + /** + * Chain ID of the current chain + */ + chain_id: number; + epoch: string; + ledger_version: string; + oldest_ledger_version: string; + ledger_timestamp: string; + node_role: RoleType; + oldest_block_height: string; + block_height: string; + /** + * Git hash of the build of the API endpoint. Can be used to determine the exact + * software version used by the API endpoint. + */ + git_hash?: string; +}; + +/** + * A Block type + */ +export type Block = { + block_height: string; + block_hash: string; + block_timestamp: string; + first_version: string; + last_version: string; + /** + * The transactions in the block in sequential order + */ + transactions?: Array; +}; + +// REQUEST TYPES + +/** + * The request payload for the GetTableItem API. + */ +export type TableItemRequest = { + key_type: MoveValue; + value_type: MoveValue; + /** + * The value of the table item's key + */ + key: any; +}; + +/** + * A list of supported Authentication Key schemes in Aptos, consisting of combinations of signing schemes and derive schemes. + */ +export type AuthenticationKeyScheme = SigningScheme | DeriveScheme; + +/** + * Different schemes for signing keys used in cryptographic operations. + */ +export enum SigningScheme { + /** + * For Ed25519PublicKey + */ + Ed25519 = 0, + /** + * For MultiEd25519PublicKey + */ + MultiEd25519 = 1, + /** + * For SingleKey ecdsa + */ + SingleKey = 2, + + MultiKey = 3, +} + +/** + * Specifies the signing schemes available for cryptographic operations. + */ +export enum SigningSchemeInput { + /** + * For Ed25519PublicKey + */ + Ed25519 = 0, + /** + * For Secp256k1Ecdsa + */ + Secp256k1Ecdsa = 2, +} + +/** + * Specifies the schemes for deriving account addresses from various data sources. + */ +export enum DeriveScheme { + /** + * Derives an address using an AUID, used for objects + */ + DeriveAuid = 251, + /** + * Derives an address from another object address + */ + DeriveObjectAddressFromObject = 252, + /** + * Derives an address from a GUID, used for objects + */ + DeriveObjectAddressFromGuid = 253, + /** + * Derives an address from seed bytes, used for named objects + */ + DeriveObjectAddressFromSeed = 254, + /** + * Derives an address from seed bytes, used for resource accounts + */ + DeriveResourceAccountAddress = 255, +} + +/** + * Options for configuring the behavior of the waitForTransaction() function. + */ +export type WaitForTransactionOptions = { + timeoutSecs?: number; + checkSuccess?: boolean; + // Default behavior is to wait for the indexer. Set this to false to disable waiting. + waitForIndexer?: boolean; +}; + +/** + * Input type to generate an account using the Ed25519 signing scheme. + */ +export type GenerateAccountWithEd25519 = { + scheme: SigningSchemeInput.Ed25519; + legacy: boolean; +}; + +/** + * Input type to generate an account with a Single Signer using Secp256k1. + */ +export type GenerateAccountWithSingleSignerSecp256k1Key = { + scheme: SigningSchemeInput.Secp256k1Ecdsa; + legacy?: false; +}; + +export type GenerateAccount = + | GenerateAccountWithEd25519 + | GenerateAccountWithSingleSignerSecp256k1Key; diff --git a/packages/initia-client/src/libs/initiaInteractor/defaultConfig.ts b/packages/initia-client/src/libs/initiaInteractor/defaultConfig.ts new file mode 100644 index 000000000..60c92ac6b --- /dev/null +++ b/packages/initia-client/src/libs/initiaInteractor/defaultConfig.ts @@ -0,0 +1,35 @@ +import { NetworkType } from '../../types'; +export const defaultGasBudget = 10 ** 8; // 0.1 INITIA, should be enough for most of the transactions +export const defaultGasPrice = 1000; // 1000 MIST + +/** + * @description Get the default fullnode url for the given network type + * @param networkType, 'testnet' | 'mainnet' | 'localnet', default is 'testnet' + * @returns { fullNode: string } + */ +export const getDefaultURL = ( + networkType: NetworkType = 'testnet' +): { fullNode: string; chainId: string } => { + switch (networkType) { + case 'localnet': + return { + fullNode: 'http://127.0.0.1:8080', + chainId: 'initiation-2', + }; + case 'testnet': + return { + fullNode: 'https://lcd.testnet.initia.xyz', + chainId: 'initiation-2', + }; + case 'mainnet': + return { + fullNode: 'https://fullnode.mainnet.aptoslabs.com', + chainId: 'initiation-1', + }; + default: + return { + fullNode: 'https://lcd.testnet.initia.xyz', + chainId: 'initiation-2', + }; + } +}; diff --git a/packages/initia-client/src/libs/initiaInteractor/index.ts b/packages/initia-client/src/libs/initiaInteractor/index.ts new file mode 100644 index 000000000..7d9d310eb --- /dev/null +++ b/packages/initia-client/src/libs/initiaInteractor/index.ts @@ -0,0 +1,2 @@ +export { InitiaInteractor } from './initiaInteractor'; +export { getDefaultURL } from './defaultConfig'; diff --git a/packages/initia-client/src/libs/initiaInteractor/initiaInteractor.ts b/packages/initia-client/src/libs/initiaInteractor/initiaInteractor.ts new file mode 100644 index 000000000..02f549a28 --- /dev/null +++ b/packages/initia-client/src/libs/initiaInteractor/initiaInteractor.ts @@ -0,0 +1,194 @@ +import { + LCDClient, + PaginationOptions, + APIParams, + Module, + Pagination, + MsgExecute, + AccAddress, + Key, + Wallet, + Tx, + SyncTxBroadcastResult, + Coins, + Coin, +} from '@initia/initia.js'; +import { delay } from './util'; +import { NetworkType } from '../../types'; +/** + * `SuiTransactionSender` is used to send transaction with a given gas coin. + * It always uses the gas coin to pay for the gas, + * and update the gas coin after the transaction. + */ +export class InitiaInteractor { + public readonly clients: LCDClient[]; + public currentClient: LCDClient; + public readonly fullNodes: string[]; + public currentFullNode: string; + public chainId: string; + public network?: NetworkType; + + constructor(fullNodeUrls: string[], chainId: string) { + if (fullNodeUrls.length === 0) + throw new Error('fullNodeUrls must not be empty'); + this.clients = fullNodeUrls.map( + (url) => + new LCDClient(url, { + chainId, + gasPrices: '0.15uinit', // default gas prices + gasAdjustment: '2.0', // default gas adjustment for fee estimation + }) + ); + this.currentClient = this.clients[0]; + this.fullNodes = fullNodeUrls; + this.currentFullNode = fullNodeUrls[0]; + this.chainId = chainId; + } + + switchToNextClient() { + const currentClientIdx = this.clients.indexOf(this.currentClient); + this.currentClient = + this.clients[(currentClientIdx + 1) % this.clients.length]; + this.currentFullNode = + this.fullNodes[(currentClientIdx + 1) % this.clients.length]; + } + + async getModules( + address: string, + params?: Partial + ): Promise<[Module[], Pagination]> { + for (const client of this.clients) { + try { + const modules = await client.move.modules(address, params); + return modules; + } catch (err) { + console.warn(`Failed to get modules: ${err}`); + await delay(2000); + } + } + throw new Error('Failed to get modules with all fullnodes'); + } + + async viewFunction( + address: string, + moduleName: string, + funcName: string, + typeArguments?: string[], + params?: string[] + ): Promise { + for (const client of this.clients) { + try { + const result = await client.move.viewFunction( + address, + moduleName, + funcName, + typeArguments, + params + ); + return result; + } catch (err) { + console.warn(`Failed to view function: ${err}`); + await delay(2000); + } + } + throw new Error('Failed to view function with all fullnodes'); + } + + moveCall( + sender: AccAddress, + moduleAddress: AccAddress, + moduleName: string, + funcName: string, + typeArguments?: string[], + params?: string[] + ): MsgExecute { + return new MsgExecute( + sender, + moduleAddress, + moduleName, + funcName, + typeArguments, + params + ); + } + + async createAndSignTx(sender: Key, msgs: MsgExecute[]): Promise { + for (const client of this.clients) { + try { + const wallet = new Wallet(client, sender); + const tx = await wallet.createAndSignTx({ msgs }); + return tx; + } catch (err) { + console.warn(`Failed to create and sign tx: ${err}`); + await delay(2000); + } + } + throw new Error('Failed to create and sign tx with all fullnodes'); + } + + async broadcastSyncTx(tx: Tx): Promise { + for (const client of this.clients) { + try { + const result = await client.tx.broadcastSync(tx); + return result; + } catch (err) { + console.warn(`Failed to broadcast tx: ${err}`); + await delay(2000); + } + } + throw new Error('Failed to broadcast tx with all fullnodes'); + } + + async sendTxWithPayload( + signer: Key, + payload: MsgExecute[] + ): Promise { + for (const client of this.clients) { + try { + const wallet = new Wallet(client, signer); + const tx = await wallet.createAndSignTx({ msgs: payload }); + const result = await client.tx.broadcastSync(tx); + return result; + } catch (err) { + console.warn( + `Failed to send transaction with fullnode ${client.URL}: ${err}` + ); + await delay(2000); + } + } + throw new Error('Failed to send transaction with all fullnodes'); + } + + async balance(address: AccAddress | string): Promise<[Coins, Pagination]> { + for (const client of this.clients) { + try { + const balance = await client.bank.balance(address); + return balance; + } catch (err) { + console.warn( + `Failed to get balance with fullnode ${client.URL}: ${err}` + ); + await delay(2000); + } + } + throw new Error('Failed to get balance with all fullnodes'); + } + + async balanceByDenom( + address: AccAddress | string, + denom: string + ): Promise { + for (const client of this.clients) { + try { + const balance = await client.bank.balanceByDenom(address, denom); + return balance; + } catch (err) { + console.warn( + `Failed to get balance by denom with fullnode ${client.URL}: ${err}` + ); + await delay(2000); + } + } + throw new Error('Failed to get balance with all fullnodes'); + } +} diff --git a/packages/initia-client/src/libs/initiaInteractor/util.ts b/packages/initia-client/src/libs/initiaInteractor/util.ts new file mode 100644 index 000000000..59216636a --- /dev/null +++ b/packages/initia-client/src/libs/initiaInteractor/util.ts @@ -0,0 +1,2 @@ +export const delay = (ms: number) => + new Promise((resolve) => setTimeout(resolve, ms)); diff --git a/packages/initia-client/src/metadata/index.ts b/packages/initia-client/src/metadata/index.ts new file mode 100644 index 000000000..200b2ef45 --- /dev/null +++ b/packages/initia-client/src/metadata/index.ts @@ -0,0 +1,32 @@ +import { InitiaInteractor, getDefaultURL } from '../libs/initiaInteractor'; +import { NetworkType, MoveModule } from '../types'; + +export async function loadMetadata( + networkType: NetworkType, + packageId: string, + fullnodeUrls?: string[] +): Promise { + // Init the rpc provider + fullnodeUrls = fullnodeUrls ?? [getDefaultURL(networkType).fullNode]; + const initiaInteractor = new InitiaInteractor(fullnodeUrls, networkType); + if (packageId !== undefined) { + // let allModules: Module[] = []; + let allModules: MoveModule[] = []; + let nextKey: string | undefined = undefined; + + do { + const modules = await initiaInteractor.getModules(packageId, { + 'pagination.key': nextKey, + }); + allModules = allModules.concat( + JSON.parse(modules[0][0].abi) as MoveModule + ); + + nextKey = modules[1].next_key; + } while (nextKey !== null); + + return allModules; + } else { + console.error('please set your package id.'); + } +} diff --git a/packages/initia-client/src/types/index.ts b/packages/initia-client/src/types/index.ts new file mode 100644 index 000000000..18e1a44ee --- /dev/null +++ b/packages/initia-client/src/types/index.ts @@ -0,0 +1,124 @@ +import { AccAddress, Module } from '@initia/initia.js'; +import { + MoveModule, + MoveFunctionGenericTypeParam, +} from '../libs/initiaContractFactory/types'; +export type { + MoveModule, + MoveFunctionGenericTypeParam, +} from '../libs/initiaContractFactory/types'; + +export type DubheParams = { + mnemonics?: string; + secretKey?: string; + fullnodeUrls?: string[]; + faucetUrl?: string; + networkType?: NetworkType; + packageId?: string; + chainId?: string; + metadata?: MoveModule[]; +}; + +export type ComponentFieldType = { + components: { + type: string; + fields: { + id: { + id: string; + }; + size: string; + }; + }; +}; + +export type ComponentValueType = { + id: { + id: string; + }; + name: string; + value: { + type: string; + fields: ComponentFieldType; + }; +}; + +export type ComponentContentType = { + type: string; + fields: ComponentValueType; + hasPublicTransfer: boolean; + dataType: 'moveObject'; +}; + +// export type MoveModuleValueType = { +// address: string; +// name: string; +// friends: MoveModuleId[]; +// structs: MoveStruct[]; +// exposed_functions: MoveFunction[]; +// }; + +export type MoveModuleFuncType = { + contractAddress: string; + moduleName: string; + funcName: string; + isEntry: boolean; + typeParams: MoveFunctionGenericTypeParam[]; + params: string[]; + return: string[]; +}; + +export interface MessageMeta { + readonly meta: MoveModuleFuncType; +} + +export interface ContractQuery extends MessageMeta { + (params?: string[], typeArguments?: string[]): Promise; +} + +export interface ContractTx extends MessageMeta { + ( + sender?: AccAddress | string, + params?: any[], + typeArguments?: string[], + isRaw?: boolean + ): Promise; +} + +export type MapMessageTx = Record; +export type MapMessageQuery = Record; + +export type MapModuleFuncTx = Record; +export type MapModuleFuncQuery = Record; + +export type MapModuleFuncTest = Record>; +export type MapModuleFuncQueryTest = Record>; + +export type AccountMangerParams = { + mnemonics?: string; + secretKey?: string; +}; + +export type DerivePathParams = { + coinType?: number; + accountIndex?: number; + // isExternal?: boolean; + addressIndex?: number; + eth?: boolean; +}; + +export type NetworkType = 'mainnet' | 'testnet' | 'localnet'; + +/** + * These are the basics types that can be used in the APT + */ +export type MoveBasicTypes = + | 'address' + | 'bool' + | 'u8' + | 'u16' + | 'u32' + | 'u64' + | 'u128' + | 'u256'; + +export type MoveInputTypes = 'object' | MoveBasicTypes; diff --git a/packages/initia-client/src/utils/index.ts b/packages/initia-client/src/utils/index.ts new file mode 100644 index 000000000..3d788642d --- /dev/null +++ b/packages/initia-client/src/utils/index.ts @@ -0,0 +1,3 @@ +export function capitalizeFirstLetter(input: string): string { + return input.charAt(0).toUpperCase() + input.slice(1); +} diff --git a/packages/initia-client/test/index.spec.ts b/packages/initia-client/test/index.spec.ts new file mode 100644 index 000000000..74d33ee45 --- /dev/null +++ b/packages/initia-client/test/index.spec.ts @@ -0,0 +1,5 @@ +import * as dotenv from 'dotenv'; +import { describe, it, expect } from 'vitest'; +import { Dubhe } from '../src/index'; + +dotenv.config(); diff --git a/packages/initia-client/test/tsconfig.json b/packages/initia-client/test/tsconfig.json new file mode 100644 index 000000000..605659e86 --- /dev/null +++ b/packages/initia-client/test/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "include": ["./", "../src"], + "compilerOptions": { + "rootDir": "..", + "noEmit": true, + "emitDeclarationOnly": false + } +} diff --git a/packages/initia-client/tsconfig.json b/packages/initia-client/tsconfig.json new file mode 100644 index 000000000..6c2e28f14 --- /dev/null +++ b/packages/initia-client/tsconfig.json @@ -0,0 +1,32 @@ +{ + "ts-node": { + "require": ["tsconfig-paths/register"] + }, + "compilerOptions": { + "target": "ES2020", + "lib": ["dom", "dom.iterable", "esnext"], + "baseUrl": ".", + "downlevelIteration": true, + "rootDir": "src", + "outDir": "dist", + "declaration": true, + "declarationDir": "dist", + "module": "CommonJS", + "moduleResolution": "node", + "strict": true, + "sourceMap": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "isolatedModules": true, + "skipLibCheck": true, + "preserveSymlinks": true, + "forceConsistentCasingInFileNames": true, + "allowJs": true, + "noEmit": false, + "emitDeclarationOnly": true, + "incremental": false, + "typeRoots": ["./src/types", "./node_modules/@types"] + }, + "include": ["./src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 423e8f84d..9d38dd676 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -94,7 +94,7 @@ importers: version: 8.0.3 nice-grpc-web: specifier: ^2.0.1 - version: 2.0.1(google-protobuf@3.21.2) + version: 2.0.1(google-protobuf@3.21.4) openurl: specifier: ^1.1.1 version: 1.1.1 @@ -355,6 +355,100 @@ importers: specifier: ^1.1.2 version: 1.1.2 + packages/initia-client: + dependencies: + '@initia/builder.js': + specifier: ^0.2.4 + version: 0.2.4(eslint@8.52.0)(typescript@5.2.2) + '@initia/initia.js': + specifier: ^0.2.23 + version: 0.2.23(typescript@5.2.2) + '@scure/bip39': + specifier: ^1.2.1 + version: 1.3.0 + assert: + specifier: ^2.0.0 + version: 2.1.0 + colorts: + specifier: ^0.1.63 + version: 0.1.63 + husky: + specifier: ^8.0.3 + version: 8.0.3 + keccak256: + specifier: ^1.0.6 + version: 1.0.6 + process: + specifier: ^0.11.10 + version: 0.11.10 + superstruct: + specifier: ^1.0.3 + version: 1.0.3 + tmp: + specifier: ^0.2.1 + version: 0.2.1 + ts-retry-promise: + specifier: ^0.7.0 + version: 0.7.1 + devDependencies: + '@commitlint/cli': + specifier: ^17.6.6 + version: 17.6.6 + '@commitlint/config-conventional': + specifier: ^17.6.6 + version: 17.6.6 + '@commitlint/prompt-cli': + specifier: ^17.6.6 + version: 17.6.6 + '@types/node': + specifier: ^20.5.0 + version: 20.8.7 + '@types/tmp': + specifier: ^0.2.3 + version: 0.2.5 + '@typescript-eslint/eslint-plugin': + specifier: ^5.60.1 + version: 5.60.1(@typescript-eslint/parser@5.60.1)(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': + specifier: ^5.60.1 + version: 5.60.1(eslint@8.52.0)(typescript@5.2.2) + dotenv: + specifier: ^16.3.1 + version: 16.3.1 + eslint: + specifier: ^8.43.0 + version: 8.52.0 + eslint-config-prettier: + specifier: ^8.8.0 + version: 8.8.0(eslint@8.52.0) + eslint-plugin-prettier: + specifier: ^4.2.1 + version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.52.0)(prettier@2.8.8) + lint-staged: + specifier: ^13.2.3 + version: 13.2.3 + prettier: + specifier: ^2.8.8 + version: 2.8.8 + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@types/node@20.8.7)(typescript@5.2.2) + tsconfig-paths: + specifier: ^4.2.0 + version: 4.2.0 + tsup: + specifier: ^7.1.0 + version: 7.1.0(ts-node@10.9.1)(typescript@5.2.2) + typedoc: + specifier: ^0.24.8 + version: 0.24.8(typescript@5.2.2) + typescript: + specifier: ^5.0.4 + version: 5.2.2 + vitest: + specifier: ^0.32.2 + version: 0.32.2 + packages/rooch-cli: dependencies: '@0xobelisk/rooch-client': @@ -850,7 +944,6 @@ packages: /@aashutoshrathi/word-wrap@1.2.6: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} - dev: true /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} @@ -1118,6 +1211,13 @@ packages: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + /@bitcoinerlab/secp256k1@1.1.1: + resolution: {integrity: sha512-uhjW51WfVLpnHN7+G0saDcM/k9IqcyTbZ+bDgLF3AX8V/a3KXSE9vn7UPBrcdU72tp0J4YPR7BHp2m7MLAZ/1Q==} + dependencies: + '@noble/hashes': 1.5.0 + '@noble/secp256k1': 1.7.1 + dev: false + /@changesets/apply-release-plan@6.1.4: resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==} dependencies: @@ -1714,6 +1814,53 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true + /@eleccookie/ffi-napi@0.0.1: + resolution: {integrity: sha512-5thJlFagsM3a7xElm9jgnFBfpb6LaAPVMPo0EYhbiURCBAVgZXV26yJOKRPbkNoCvGGK8vbamBTmRYghZB2Vyg==} + engines: {node: '>=12.22.12'} + requiresBuild: true + dependencies: + '@eleccookie/get-uv-event-loop-napi-h': 0.0.1 + '@eleccookie/ref-napi': 0.0.1 + debug: 4.3.7 + node-addon-api: 8.2.2 + node-gyp-build: 4.8.4 + ref-struct-di: 1.1.1 + transitivePeerDependencies: + - supports-color + dev: false + + /@eleccookie/get-uv-event-loop-napi-h@0.0.1: + resolution: {integrity: sha512-4jpUp8oVMJVms0bYAErILSE3bbWB8G1vIreoZMMuoGlEdGuhsRbqD1Rf5rUqGI08YtWn+lfAkIdS4WPaCG3nkg==} + dependencies: + get-symbol-from-current-process-h: 1.0.2 + dev: false + + /@eleccookie/ref-napi@0.0.1: + resolution: {integrity: sha512-qnmmyX/k0o6PnspIR4ktHpNLPZRvURbu/bJdwUSV3BYwWJ6Gp2kLuV/rK++TpwpAcIk857sj88gfsvfp9U+IgQ==} + engines: {node: '>= 12.22.12'} + requiresBuild: true + dependencies: + debug: 4.3.7 + get-symbol-from-current-process-h: 1.0.2 + node-addon-api: 3.2.1 + node-gyp-build: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: false + + /@eleccookie/ref-napi@0.0.2: + resolution: {integrity: sha512-Jiz3tq6N52w5THPuiWFoLynSfh/Rfg/q0Bfsgvo7nRxYIE7zn4/JcECxdvQ7Tapvk5bFyK9/AR4taK6gRLDkFQ==} + engines: {node: '>= 12.22.12'} + requiresBuild: true + dependencies: + debug: 4.3.7 + get-symbol-from-current-process-h: 1.0.2 + node-addon-api: 3.2.1 + node-gyp-build: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: false + /@esbuild-kit/cjs-loader@2.4.4: resolution: {integrity: sha512-NfsJX4PdzhwSkfJukczyUiZGc7zNNWZcEAyqeISpDnn0PTfzMJR1aR8xAIPskBejIxBJbIgCCMzbaYa9SXepIg==} dependencies: @@ -2334,12 +2481,10 @@ packages: dependencies: eslint: 8.52.0 eslint-visitor-keys: 3.4.3 - dev: true /@eslint-community/regexpp@4.10.0: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true /@eslint/eslintrc@1.4.1: resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==} @@ -2373,7 +2518,6 @@ packages: strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color - dev: true /@eslint/js@8.43.0: resolution: {integrity: sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==} @@ -2383,7 +2527,6 @@ packages: /@eslint/js@8.52.0: resolution: {integrity: sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true /@gql.tada/cli-utils@1.3.4(graphql@16.8.1)(svelte@4.2.19)(typescript@5.2.2): resolution: {integrity: sha512-IHDJypDIIScs25pmsOrwlPy1MDnOwwzUKN+C9nLsQW0cW2c1S/L8K7FT9XUWH9qOjt7Q5K13GKWD3clfzlByuQ==} @@ -2511,24 +2654,83 @@ packages: minimatch: 3.1.2 transitivePeerDependencies: - supports-color - dev: true /@humanwhocodes/module-importer@1.0.1: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - dev: true /@humanwhocodes/object-schema@2.0.1: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - dev: true - /@improbable-eng/grpc-web@0.15.0(google-protobuf@3.21.2): + /@improbable-eng/grpc-web@0.15.0(google-protobuf@3.21.4): resolution: {integrity: sha512-ERft9/0/8CmYalqOVnJnpdDry28q+j+nAlFFARdjyxXDJ+Mhgv9+F600QC8BR9ygOfrXRlAk6CvST2j+JCpQPg==} peerDependencies: google-protobuf: ^3.14.0 dependencies: browser-headers: 0.4.1 - google-protobuf: 3.21.2 + google-protobuf: 3.21.4 + dev: false + + /@initia/builder.js@0.2.4(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-dljYPvI8Mm8rS4TUu0wE6C+lKB8RdtYNM3lvxYMaWJA2tkMD8ja5dMzUTECsAtcpINIzZ5zkTfvn1wz7K3psAA==} + engines: {node: '>=20'} + dependencies: + '@eleccookie/ffi-napi': 0.0.1 + '@eleccookie/ref-napi': 0.0.2 + '@mysten/bcs': 1.1.0 + ref-struct-di: 1.1.1 + typescript-eslint: 7.18.0(eslint@8.52.0)(typescript@5.2.2) + transitivePeerDependencies: + - eslint + - supports-color + - typescript + dev: false + + /@initia/initia.js@0.2.23(typescript@5.2.2): + resolution: {integrity: sha512-cMVO7vXg+7V28lmFgzJggYvGUguFaZEErLRRcdzYQLcNQ7mSyWGaVoOI7/fzW6YCkxmTXGoE6JJ2fxGzFCjaNQ==} + engines: {node: '>=20'} + dependencies: + '@bitcoinerlab/secp256k1': 1.1.1 + '@initia/initia.proto': 0.2.4 + '@initia/opinit.proto': 0.0.11 + '@ledgerhq/hw-transport': 6.31.4 + '@ledgerhq/hw-transport-webhid': 6.29.4 + '@ledgerhq/hw-transport-webusb': 6.29.4 + '@mysten/bcs': 1.1.0 + axios: 1.7.7 + bech32: 2.0.0 + bignumber.js: 9.1.2 + bip32: 5.0.0-rc.0(typescript@5.2.2) + bip39: 3.1.0 + jscrypto: 1.0.3 + keccak256: 1.0.6 + ripemd160: 2.0.2 + secp256k1: 5.0.1 + semver: 7.6.3 + ws: 8.18.0 + transitivePeerDependencies: + - bufferutil + - debug + - typescript + - utf-8-validate + dev: false + + /@initia/initia.proto@0.2.4: + resolution: {integrity: sha512-/QTENbGto8MxoTrYxw0qQFU3IjCeEv3KEmeAmd1DgVzXrLVBimZjSYSW72JfDVQrNaXEeNTCtLjd5ZivWPbcLA==} + dependencies: + '@improbable-eng/grpc-web': 0.15.0(google-protobuf@3.21.4) + google-protobuf: 3.21.4 + long: 5.2.3 + protobufjs: 7.4.0 + dev: false + + /@initia/opinit.proto@0.0.11: + resolution: {integrity: sha512-Op9GIlXiV1xhUIjVQ2TFE9a3X8iyFVNtJNHCM34gwLQHJktDNm2KCoW4eHh6pkn4//ECRVH7zuKgV8TdZWogCw==} + dependencies: + '@improbable-eng/grpc-web': 0.15.0(google-protobuf@3.21.4) + google-protobuf: 3.21.4 + long: 5.2.3 + protobufjs: 7.4.0 dev: false /@jridgewell/gen-mapping@0.3.3: @@ -2566,6 +2768,50 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /@ledgerhq/devices@8.4.4: + resolution: {integrity: sha512-sz/ryhe/R687RHtevIE9RlKaV8kkKykUV4k29e7GAVwzHX1gqG+O75cu1NCJUHLbp3eABV5FdvZejqRUlLis9A==} + dependencies: + '@ledgerhq/errors': 6.19.1 + '@ledgerhq/logs': 6.12.0 + rxjs: 7.8.1 + semver: 7.6.3 + dev: false + + /@ledgerhq/errors@6.19.1: + resolution: {integrity: sha512-75yK7Nnit/Gp7gdrJAz0ipp31CCgncRp+evWt6QawQEtQKYEDfGo10QywgrrBBixeRxwnMy1DP6g2oCWRf1bjw==} + dev: false + + /@ledgerhq/hw-transport-webhid@6.29.4: + resolution: {integrity: sha512-XkF37lcuyg9zVExMyfDQathWly8rRcGac13wgZATBa3nZ+hUzzWr5QVKg1pKCw10izVHGErW/9a4tbb72rUEmQ==} + dependencies: + '@ledgerhq/devices': 8.4.4 + '@ledgerhq/errors': 6.19.1 + '@ledgerhq/hw-transport': 6.31.4 + '@ledgerhq/logs': 6.12.0 + dev: false + + /@ledgerhq/hw-transport-webusb@6.29.4: + resolution: {integrity: sha512-HoGF1LlBT9HEGBQy2XeCHrFdv/FEOZU0+J+yfKcgAQIAiASr2MLvdzwoJbUS8h6Gn+vc+/BjzBSO3JNn7Loqbg==} + dependencies: + '@ledgerhq/devices': 8.4.4 + '@ledgerhq/errors': 6.19.1 + '@ledgerhq/hw-transport': 6.31.4 + '@ledgerhq/logs': 6.12.0 + dev: false + + /@ledgerhq/hw-transport@6.31.4: + resolution: {integrity: sha512-6c1ir/cXWJm5dCWdq55NPgCJ3UuKuuxRvf//Xs36Bq9BwkV2YaRQhZITAkads83l07NAdR16hkTWqqpwFMaI6A==} + dependencies: + '@ledgerhq/devices': 8.4.4 + '@ledgerhq/errors': 6.19.1 + '@ledgerhq/logs': 6.12.0 + events: 3.3.0 + dev: false + + /@ledgerhq/logs@6.12.0: + resolution: {integrity: sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==} + dev: false + /@manypkg/find-root@1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: @@ -2598,6 +2844,12 @@ packages: bs58: 6.0.0 dev: false + /@mysten/bcs@1.1.0: + resolution: {integrity: sha512-yy9/1Y4d0FlRywS1+9ze/T7refCbrvwFwJIOKs9M3QBK1njbcHZp+LkVeLqBvIJA5eZ3ZCzmhQ1Xq4Sed5mEBA==} + dependencies: + bs58: 6.0.0 + dev: false + /@mysten/sui@1.1.2(svelte@4.2.19)(typescript@5.2.2): resolution: {integrity: sha512-S1MfGvbkUxKGd39bfA6G21UVwJSSgJW8uKHinSByjt86+YKvSZxlF5zr6RVKcP4Rn8gl5ytMbZQfCPn+0nuGTg==} engines: {node: '>=18'} @@ -2714,18 +2966,20 @@ packages: engines: {node: ^14.21.3 || >=16} dev: false + /@noble/secp256k1@1.7.1: + resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + dev: false + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: true /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -2733,13 +2987,55 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - dev: true /@pkgr/core@0.1.1: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dev: true + /@protobufjs/aspromise@1.1.2: + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + dev: false + + /@protobufjs/base64@1.1.2: + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + dev: false + + /@protobufjs/codegen@2.0.4: + resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==} + dev: false + + /@protobufjs/eventemitter@1.1.0: + resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==} + dev: false + + /@protobufjs/fetch@1.1.0: + resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==} + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/inquire': 1.1.0 + dev: false + + /@protobufjs/float@1.0.2: + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + dev: false + + /@protobufjs/inquire@1.1.0: + resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==} + dev: false + + /@protobufjs/path@1.1.2: + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + dev: false + + /@protobufjs/pool@1.1.0: + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + dev: false + + /@protobufjs/utf8@1.1.0: + resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} + dev: false + /@rollup/plugin-alias@4.0.4(rollup@3.29.4): resolution: {integrity: sha512-0CaAY238SMtYAWEXXptWSR8iz8NYZnH7zNBKuJ14xFJSGwLtPgjvXYsoApAHfzYXXH1ejxpVw7WlHss3zhh9SQ==} engines: {node: '>=14.0.0'} @@ -3321,18 +3617,46 @@ packages: '@typescript-eslint/scope-manager': 5.60.1 '@typescript-eslint/type-utils': 5.60.1(eslint@8.43.0)(typescript@5.1.6) '@typescript-eslint/utils': 5.60.1(eslint@8.43.0)(typescript@5.1.6) - debug: 4.3.4 + debug: 4.3.7 eslint: 8.43.0 grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 - semver: 7.5.4 + semver: 7.6.0 tsutils: 3.21.0(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true + /@typescript-eslint/eslint-plugin@5.60.1(@typescript-eslint/parser@5.60.1)(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 5.60.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/type-utils': 5.60.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.60.1(eslint@8.52.0)(typescript@5.2.2) + debug: 4.3.7 + eslint: 8.52.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.4 + natural-compare-lite: 1.4.0 + semver: 7.6.0 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/eslint-plugin@5.60.1(@typescript-eslint/parser@5.60.1)(eslint@8.52.0)(typescript@5.3.3): resolution: {integrity: sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3390,6 +3714,33 @@ packages: - supports-color dev: true + /@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0)(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 7.18.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/type-utils': 7.18.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 7.18.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 7.18.0 + eslint: 8.52.0 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + /@typescript-eslint/parser@5.46.1(eslint@8.29.0)(typescript@5.1.6): resolution: {integrity: sha512-RelQ5cGypPh4ySAtfIMBzBGyrNerQcmfA1oJvPj5f+H4jI59rl9xxpn4bonC0tQvUKOEN7eGBFWxFLK3Xepneg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3423,13 +3774,33 @@ packages: '@typescript-eslint/scope-manager': 5.60.1 '@typescript-eslint/types': 5.60.1 '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.6) - debug: 4.3.4 + debug: 4.3.7 eslint: 8.43.0 typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true + /@typescript-eslint/parser@5.60.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.2.2) + debug: 4.3.7 + eslint: 8.52.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser@5.60.1(eslint@8.52.0)(typescript@5.3.3): resolution: {integrity: sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3471,6 +3842,27 @@ packages: - supports-color dev: true + /@typescript-eslint/parser@7.18.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.7 + eslint: 8.52.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + /@typescript-eslint/scope-manager@5.46.1: resolution: {integrity: sha512-iOChVivo4jpwUdrJZyXSMrEIM/PvsbbDOX1y3UCKjSgWn+W89skxWaYXACQfxmIGhPVpRWK/VWPYc+bad6smIA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3495,6 +3887,14 @@ packages: '@typescript-eslint/visitor-keys': 6.8.0 dev: true + /@typescript-eslint/scope-manager@7.18.0: + resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + dev: false + /@typescript-eslint/type-utils@5.46.1(eslint@8.29.0)(typescript@5.1.6): resolution: {integrity: sha512-V/zMyfI+jDmL1ADxfDxjZ0EMbtiVqj8LUGPAGyBkXXStWmCUErMpW873zEHsyguWCuq2iN4BrlWUkmuVj84yng==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3535,6 +3935,26 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils@5.60.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.2.2) + '@typescript-eslint/utils': 5.60.1(eslint@8.52.0)(typescript@5.2.2) + debug: 4.3.7 + eslint: 8.52.0 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/type-utils@5.60.1(eslint@8.52.0)(typescript@5.3.3): resolution: {integrity: sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3575,6 +3995,26 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils@7.18.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.2.2) + '@typescript-eslint/utils': 7.18.0(eslint@8.52.0)(typescript@5.2.2) + debug: 4.3.7 + eslint: 8.52.0 + ts-api-utils: 1.3.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + /@typescript-eslint/types@5.46.1: resolution: {integrity: sha512-Z5pvlCaZgU+93ryiYUwGwLl9AQVB/PQ1TsJ9NZ/gHzZjN7g9IAn6RSDkpCV8hqTwAiaj6fmCcKSQeBPlIpW28w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3590,6 +4030,11 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true + /@typescript-eslint/types@7.18.0: + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: false + /@typescript-eslint/typescript-estree@5.46.1(typescript@5.1.6): resolution: {integrity: sha512-j9W4t67QiNp90kh5Nbr1w92wzt+toiIsaVPnEblB2Ih2U9fqBTyqV9T3pYWZBRt6QoMh/zVWP59EpuCjc4VRBg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3632,6 +4077,27 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@5.60.1(typescript@5.2.2): + resolution: {integrity: sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/visitor-keys': 5.60.1 + debug: 4.3.7 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/typescript-estree@5.60.1(typescript@5.3.3): resolution: {integrity: sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3674,6 +4140,28 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@7.18.0(typescript@5.2.2): + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.7 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + /@typescript-eslint/utils@5.46.1(eslint@8.29.0)(typescript@5.1.6): resolution: {integrity: sha512-RBdBAGv3oEpFojaCYT4Ghn4775pdjvwfDOfQ2P6qzNVgQOVrnSPe5/Pb88kv7xzYQjoio0eKHKB9GJ16ieSxvA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3714,6 +4202,26 @@ packages: - typescript dev: true + /@typescript-eslint/utils@5.60.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@types/json-schema': 7.0.14 + '@types/semver': 7.5.4 + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.2.2) + eslint: 8.52.0 + eslint-scope: 5.1.1 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/utils@5.60.1(eslint@8.52.0)(typescript@5.3.3): resolution: {integrity: sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3747,11 +4255,27 @@ packages: '@typescript-eslint/types': 6.8.0 '@typescript-eslint/typescript-estree': 6.8.0(typescript@5.2.2) eslint: 8.52.0 - semver: 7.5.4 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/utils@7.18.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.2.2) + eslint: 8.52.0 transitivePeerDependencies: - supports-color - typescript - dev: true + dev: false /@typescript-eslint/visitor-keys@5.46.1: resolution: {integrity: sha512-jczZ9noovXwy59KjRTk1OftT78pwygdcmCuBf8yMoWt/8O8l+6x2LSEze0E4TeepXK4MezW3zGSyoDRZK7Y9cg==} @@ -3777,9 +4301,16 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@7.18.0: + resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.18.0 + eslint-visitor-keys: 3.4.3 + dev: false + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: true /@vitest/expect@0.31.4: resolution: {integrity: sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg==} @@ -4004,7 +4535,6 @@ packages: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: acorn: 8.11.2 - dev: true /acorn-walk@8.3.0: resolution: {integrity: sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==} @@ -4031,7 +4561,6 @@ packages: fast-json-stable-stringify: 2.1.0 json-schema-traverse: 0.4.1 uri-js: 4.4.1 - dev: true /ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} @@ -4161,7 +4690,6 @@ packages: /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: true /aria-query@5.3.0: resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} @@ -4193,7 +4721,6 @@ packages: /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - dev: true /array.prototype.flat@1.3.2: resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} @@ -4296,6 +4823,16 @@ packages: - debug dev: false + /axios@1.7.7: + resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} + dependencies: + follow-redirects: 1.15.9 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -4407,14 +4944,41 @@ packages: is-windows: 1.0.2 dev: true + /bignumber.js@9.1.2: + resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} + dev: false + /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} + /bip32@5.0.0-rc.0(typescript@5.2.2): + resolution: {integrity: sha512-5hVFGrdCnF8GB1Lj2eEo4PRE7+jp+3xBLnfNjydivOkMvKmUKeJ9GG8uOy8prmWl3Oh154uzgfudR1FRkNBudA==} + engines: {node: '>=18.0.0'} + dependencies: + '@noble/hashes': 1.5.0 + '@scure/base': 1.1.9 + uint8array-tools: 0.0.8 + valibot: 0.37.0(typescript@5.2.2) + wif: 5.0.0 + transitivePeerDependencies: + - typescript + dev: false + + /bip39@3.1.0: + resolution: {integrity: sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==} + dependencies: + '@noble/hashes': 1.5.0 + dev: false + /blueimp-md5@2.19.0: resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} dev: true + /bn.js@4.12.1: + resolution: {integrity: sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==} + dev: false + /bn.js@5.2.1: resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} dev: false @@ -4442,6 +5006,10 @@ packages: wcwidth: 1.0.1 dev: true + /brorand@1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + dev: false + /browser-headers@0.4.1: resolution: {integrity: sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==} dev: false @@ -4630,7 +5198,6 @@ packages: /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - dev: true /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} @@ -5204,6 +5771,17 @@ packages: dependencies: ms: 2.0.0 + /debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: false + /debug@4.3.2: resolution: {integrity: sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==} engines: {node: '>=6.0'} @@ -5281,7 +5859,6 @@ packages: /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} @@ -5369,14 +5946,12 @@ packages: engines: {node: '>=8'} dependencies: path-type: 4.0.0 - dev: true /doctrine@3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 - dev: true /dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} @@ -5434,6 +6009,18 @@ packages: resolution: {integrity: sha512-LsrJjZ0IbVy12ApW3gpYpcmHS3iRxH4bkKOW98y1/D+3cvDUWGcbzbsFinfUS8knpcZk/PG/2p/RnkMCYN7PVg==} dev: true + /elliptic@6.6.1: + resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} + dependencies: + bn.js: 4.12.1 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: false + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -5688,7 +6275,6 @@ packages: /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - dev: true /eslint-config-prettier@8.8.0(eslint@8.43.0): resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} @@ -5777,7 +6363,6 @@ packages: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 - dev: true /eslint-utils@3.0.0(eslint@8.29.0): resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} @@ -5797,7 +6382,6 @@ packages: /eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true /eslint@8.29.0: resolution: {integrity: sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==} @@ -5898,6 +6482,7 @@ packages: /eslint@8.52.0: resolution: {integrity: sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) @@ -5940,7 +6525,6 @@ packages: text-table: 0.2.0 transitivePeerDependencies: - supports-color - dev: true /esmify@2.1.1: resolution: {integrity: sha512-GyOVgjG7sNyYB5Mbo15Ll4aGrcXZzZ3LI22rbLOjCI7L/wYelzQpBHRZkZkqbPNZ/QIRilcaHqzgNCLcEsi1lQ==} @@ -5966,7 +6550,6 @@ packages: acorn: 8.11.2 acorn-jsx: 5.3.2(acorn@8.11.2) eslint-visitor-keys: 3.4.3 - dev: true /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -5979,14 +6562,12 @@ packages: engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 - dev: true /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} dependencies: estraverse: 5.3.0 - dev: true /estraverse@4.3.0: resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} @@ -5996,7 +6577,6 @@ packages: /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - dev: true /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -6009,7 +6589,6 @@ packages: /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - dev: true /etag@1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} @@ -6023,6 +6602,11 @@ packages: /eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + /events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + dev: false + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -6082,7 +6666,6 @@ packages: /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: true /fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} @@ -6097,21 +6680,17 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: true /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: true /fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 - dev: true /figures@2.0.0: resolution: {integrity: sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==} @@ -6125,7 +6704,6 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} dependencies: flat-cache: 3.1.1 - dev: true /filelist@1.0.4: resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} @@ -6175,7 +6753,6 @@ packages: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 - dev: true /find-up@6.3.0: resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} @@ -6199,11 +6776,9 @@ packages: flatted: 3.2.9 keyv: 4.5.4 rimraf: 3.0.2 - dev: true /flatted@3.2.9: resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} - dev: true /follow-redirects@1.15.3(debug@4.3.2): resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} @@ -6217,6 +6792,16 @@ packages: debug: 4.3.2 dev: false + /follow-redirects@1.15.9: + resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -6342,6 +6927,10 @@ packages: get-intrinsic: 1.2.2 dev: true + /get-symbol-from-current-process-h@1.0.2: + resolution: {integrity: sha512-syloC6fsCt62ELLrr1VKBM1ggOpMdetX9hTrdW77UQdcApPHLmf7CI7OKcN1c9kYuNxKcDe4iJ4FY9sX3aw2xw==} + dev: false + /get-tsconfig@4.7.2: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: @@ -6371,7 +6960,6 @@ packages: engines: {node: '>=10.13.0'} dependencies: is-glob: 4.0.3 - dev: true /glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} @@ -6434,7 +7022,6 @@ packages: engines: {node: '>=8'} dependencies: type-fest: 0.20.2 - dev: true /globals@9.18.0: resolution: {integrity: sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==} @@ -6458,7 +7045,6 @@ packages: ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 - dev: true /globby@13.2.2: resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} @@ -6471,8 +7057,8 @@ packages: slash: 4.0.0 dev: true - /google-protobuf@3.21.2: - resolution: {integrity: sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==} + /google-protobuf@3.21.4: + resolution: {integrity: sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==} dev: false /gopd@1.0.1: @@ -6555,7 +7141,6 @@ packages: /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - dev: true /graphql@16.8.1: resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} @@ -6610,6 +7195,22 @@ packages: dependencies: has-symbols: 1.0.3 + /hash-base@3.1.0: + resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} + engines: {node: '>=4'} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + safe-buffer: 5.2.1 + dev: false + + /hash.js@1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + dev: false + /hasown@2.0.0: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} engines: {node: '>= 0.4'} @@ -6621,6 +7222,14 @@ packages: hasBin: true dev: false + /hmac-drbg@1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: false + /hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} dev: true @@ -6716,7 +7325,11 @@ packages: /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} - dev: true + + /ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + dev: false /immutable@3.8.2: resolution: {integrity: sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==} @@ -6729,12 +7342,10 @@ packages: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 - dev: true /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - dev: true /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} @@ -6935,7 +7546,6 @@ packages: /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} - dev: true /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} @@ -7112,7 +7722,11 @@ packages: hasBin: true dependencies: argparse: 2.0.1 - dev: true + + /jscrypto@1.0.3: + resolution: {integrity: sha512-lryZl0flhodv4SZHOqyb1bx5sKcJxj0VBo0Kzb4QMAg3L021IC9uGpl0RCZa+9KJwlRGSK2C80ITcwbe19OKLQ==} + hasBin: true + dev: false /jsesc@2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} @@ -7129,7 +7743,6 @@ packages: /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true /json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} @@ -7137,7 +7750,6 @@ packages: /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} @@ -7221,7 +7833,6 @@ packages: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} @@ -7358,7 +7969,6 @@ packages: engines: {node: '>=10'} dependencies: p-locate: 5.0.0 - dev: true /locate-path@7.2.0: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} @@ -7388,7 +7998,6 @@ packages: /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: true /lodash.mergewith@4.6.2: resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} @@ -7438,6 +8047,10 @@ packages: wrap-ansi: 8.1.0 dev: true + /long@5.2.3: + resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} + dev: false + /loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -7584,7 +8197,6 @@ packages: /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - dev: true /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} @@ -7639,6 +8251,14 @@ packages: engines: {node: '>=4'} dev: true + /minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + dev: false + + /minimalistic-crypto-utils@1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + dev: false + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -7656,6 +8276,13 @@ packages: dependencies: brace-expansion: 2.0.1 + /minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: false + /minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -7759,7 +8386,6 @@ packages: /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true /negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} @@ -7772,10 +8398,10 @@ packages: ts-error: 1.0.6 dev: false - /nice-grpc-web@2.0.1(google-protobuf@3.21.2): + /nice-grpc-web@2.0.1(google-protobuf@3.21.4): resolution: {integrity: sha512-r8jy0TJY6ZO9qWtujiqmtRkqgItAChoJxJyYv+CHacP9G5kRIH03M+sQqtieXNNDUAKfFT/z5yroSy1cPFX0sA==} dependencies: - '@improbable-eng/grpc-web': 0.15.0(google-protobuf@3.21.2) + '@improbable-eng/grpc-web': 0.15.0(google-protobuf@3.21.4) abort-controller-x: 0.4.3 js-base64: 3.7.5 nice-grpc-common: 2.0.2 @@ -7794,6 +8420,19 @@ packages: resolution: {integrity: sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==} dev: false + /node-addon-api@3.2.1: + resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} + dev: false + + /node-addon-api@5.1.0: + resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==} + dev: false + + /node-addon-api@8.2.2: + resolution: {integrity: sha512-9emqXAKhVoNrQ792nLI/wpzPpJ/bj/YXxW0CvAau1+RdGBcCRF1Dmz7719zgVsQNrzHl9Tzn3ImZ4qWFarWL0A==} + engines: {node: ^18 || ^20 || >= 21} + dev: false + /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -7811,6 +8450,11 @@ packages: hasBin: true dev: false + /node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} + hasBin: true + dev: false + /node-releases@2.0.13: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: true @@ -7938,7 +8582,6 @@ packages: levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} @@ -7973,7 +8616,6 @@ packages: engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 - dev: true /p-limit@4.0.0: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} @@ -7993,7 +8635,6 @@ packages: engines: {node: '>=10'} dependencies: p-limit: 3.1.0 - dev: true /p-locate@6.0.0: resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} @@ -8024,7 +8665,6 @@ packages: engines: {node: '>=6'} dependencies: callsites: 3.1.0 - dev: true /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} @@ -8055,7 +8695,6 @@ packages: /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} - dev: true /path-exists@5.0.0: resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} @@ -8080,7 +8719,6 @@ packages: /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - dev: true /path@0.12.7: resolution: {integrity: sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==} @@ -8114,10 +8752,6 @@ packages: is-reference: 3.0.2 dev: false - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - /picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} dev: true @@ -8225,7 +8859,6 @@ packages: /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - dev: true /prettier-linter-helpers@1.0.0: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} @@ -8313,6 +8946,29 @@ packages: sisteransi: 1.0.5 dev: true + /protobufjs@7.4.0: + resolution: {integrity: sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==} + engines: {node: '>=12.0.0'} + requiresBuild: true + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.4 + '@protobufjs/eventemitter': 1.1.0 + '@protobufjs/fetch': 1.1.0 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.0 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.0 + '@types/node': 20.16.10 + long: 5.2.3 + dev: false + + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true @@ -8327,7 +8983,6 @@ packages: /punycode@2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} - dev: true /q@1.5.1: resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} @@ -8336,7 +8991,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} @@ -8435,6 +9089,14 @@ packages: engines: {node: '>=6'} dev: false + /ref-struct-di@1.1.1: + resolution: {integrity: sha512-2Xyn/0Qgz89VT+++WP0sTosdm9oeowLP23wRJYhG4BFdMUrLj3jhwHZNEytYNYgtPKLNTP3KJX4HEgBvM1/Y2g==} + dependencies: + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + dev: false + /regenerator-runtime@0.11.1: resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==} dev: true @@ -8481,7 +9143,6 @@ packages: /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} - dev: true /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} @@ -8550,7 +9211,6 @@ packages: /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true /rfdc@1.3.0: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} @@ -8562,6 +9222,13 @@ packages: dependencies: glob: 7.2.3 + /ripemd160@2.0.2: + resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + dev: false + /rollup-plugin-dts@5.3.1(rollup@3.29.4)(typescript@4.9.5): resolution: {integrity: sha512-gusMi+Z4gY/JaEQeXnB0RUdU82h1kF0WYzCWgVmV4p3hWXqelaKuCvcJawfeg+EKn2T1Ie+YWF2OiN1/L8bTVg==} engines: {node: '>=v14.21.3'} @@ -8620,7 +9287,6 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - dev: true /rx@4.1.0: resolution: {integrity: sha512-CiaiuN6gapkdl+cZUr67W6I8jquN4lkak3vtIsIWCl4XIPP8ffsoyN6/+PuGXnQy8Cu8W2y9Xxh31Rq4M6wUug==} @@ -8637,7 +9303,6 @@ packages: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: tslib: 2.6.2 - dev: true /safe-array-concat@1.0.1: resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} @@ -8671,6 +9336,16 @@ packages: resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==} dev: true + /secp256k1@5.0.1: + resolution: {integrity: sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA==} + engines: {node: '>=18.0.0'} + requiresBuild: true + dependencies: + elliptic: 6.6.1 + node-addon-api: 5.1.0 + node-gyp-build: 4.6.1 + dev: false + /semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true @@ -8695,6 +9370,12 @@ packages: dependencies: lru-cache: 6.0.0 + /semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + dev: false + /send@0.16.2: resolution: {integrity: sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==} engines: {node: '>= 0.8.0'} @@ -8835,7 +9516,6 @@ packages: /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - dev: true /slash@4.0.0: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} @@ -9167,7 +9847,6 @@ packages: /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - dev: true /strip-literal@1.3.0: resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} @@ -9282,7 +9961,6 @@ packages: /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} @@ -9418,7 +10096,6 @@ packages: typescript: '>=4.2.0' dependencies: typescript: 5.2.2 - dev: true /ts-command-line-args@2.5.1: resolution: {integrity: sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==} @@ -9723,7 +10400,7 @@ packages: bundle-require: 4.0.2(esbuild@0.18.20) cac: 6.7.14 chokidar: 3.5.3 - debug: 4.3.4 + debug: 4.3.7 esbuild: 0.18.20 execa: 5.1.1 globby: 11.1.0 @@ -9759,7 +10436,7 @@ packages: bundle-require: 4.0.2(esbuild@0.18.20) cac: 6.7.14 chokidar: 3.5.3 - debug: 4.3.4 + debug: 4.3.7 esbuild: 0.18.20 execa: 5.1.1 globby: 11.1.0 @@ -9786,6 +10463,16 @@ packages: typescript: 5.1.6 dev: true + /tsutils@3.21.0(typescript@5.2.2): + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 5.2.2 + dev: true + /tsutils@3.21.0(typescript@5.3.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -9891,7 +10578,6 @@ packages: engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.2.1 - dev: true /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} @@ -9911,7 +10597,6 @@ packages: /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} - dev: true /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} @@ -10010,6 +10695,20 @@ packages: typescript: 5.1.6 dev: true + /typedoc@0.24.8(typescript@5.2.2): + resolution: {integrity: sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==} + engines: {node: '>= 14.14'} + hasBin: true + peerDependencies: + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x + dependencies: + lunr: 2.3.9 + marked: 4.3.0 + minimatch: 9.0.3 + shiki: 0.14.5 + typescript: 5.2.2 + dev: true + /typedoc@0.24.8(typescript@5.3.3): resolution: {integrity: sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==} engines: {node: '>= 14.14'} @@ -10038,6 +10737,25 @@ packages: typescript: 5.2.2 dev: true + /typescript-eslint@7.18.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0)(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': 7.18.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 7.18.0(eslint@8.52.0)(typescript@5.2.2) + eslint: 8.52.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -10077,6 +10795,11 @@ packages: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} dev: true + /uint8array-tools@0.0.8: + resolution: {integrity: sha512-xS6+s8e0Xbx++5/0L+yyexukU7pz//Yg6IHg3BKhXotg1JcYtgxVcUctQ0HxLByiJzpAkNFawz1Nz5Xadzo82g==} + engines: {node: '>=14.0.0'} + dev: false + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -10171,7 +10894,6 @@ packages: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.0 - dev: true /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -10209,6 +10931,17 @@ packages: resolution: {integrity: sha512-CjF1XN4sUce8sBK9TixrDqFM7RwNkuXdJu174/AwmQUB62QbCQADg5lLe8ldBalFgtj1uKj+pKwDJiNo4Mn+eQ==} dev: false + /valibot@0.37.0(typescript@5.2.2): + resolution: {integrity: sha512-FQz52I8RXgFgOHym3XHYSREbNtkgSjF9prvMFH1nBsRyfL6SfCzoT1GuSDTlbsuPubM7/6Kbw0ZMQb8A+V+VsQ==} + peerDependencies: + typescript: '>=5' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + typescript: 5.2.2 + dev: false + /valibot@0.41.0(typescript@5.1.6): resolution: {integrity: sha512-igDBb8CTYr8YTQlOKgaN9nSS0Be7z+WRuaeYqGf3Cjz3aKmSnqEmYnkfVjzIuumGqfHpa3fLIvMEAfhrpqN8ng==} peerDependencies: @@ -10273,8 +11006,8 @@ packages: cac: 6.7.14 debug: 4.3.7 mlly: 1.4.2 - pathe: 1.1.1 - picocolors: 1.0.0 + pathe: 1.1.2 + picocolors: 1.1.1 vite: 4.5.0(@types/node@20.16.10) transitivePeerDependencies: - '@types/node' @@ -10673,6 +11406,12 @@ packages: stackback: 0.0.2 dev: true + /wif@5.0.0: + resolution: {integrity: sha512-iFzrC/9ne740qFbNjTZ2FciSRJlHIXoxqk/Y5EnE08QOXu1WjJyCCswwDTYbohAOEnlCtLaAAQBhyaLRFh2hMA==} + dependencies: + bs58check: 4.0.0 + dev: false + /wordwrapjs@4.0.1: resolution: {integrity: sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==} engines: {node: '>=8.0.0'} @@ -10723,6 +11462,19 @@ packages: optional: true dev: false + /ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false + /xmlhttprequest-ssl@2.0.0: resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==} engines: {node: '>=0.4.0'} @@ -10841,7 +11593,6 @@ packages: /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - dev: true /yocto-queue@1.0.0: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}