From 4deb224744a1dc32fc4f39cb954312c58d9cae8e Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Mon, 18 Mar 2024 16:04:33 +0100 Subject: [PATCH 1/5] feat(ts): adds bare project (#184) --- ts/.eslintrc.json | 20 + ts/.gitignore | 39 + ts/.husky/pre-commit | 1 + ts/.prettierrc | 4 + ts/package-lock.json | 2782 ++++++++++++++++++++++++++++++++++++++++ ts/package.json | 36 + ts/src/index.ts | 1 + ts/tsconfig.build.json | 5 + ts/tsconfig.json | 22 + 9 files changed, 2910 insertions(+) create mode 100644 ts/.eslintrc.json create mode 100644 ts/.gitignore create mode 100644 ts/.husky/pre-commit create mode 100644 ts/.prettierrc create mode 100644 ts/package-lock.json create mode 100644 ts/package.json create mode 100644 ts/src/index.ts create mode 100644 ts/tsconfig.build.json create mode 100644 ts/tsconfig.json diff --git a/ts/.eslintrc.json b/ts/.eslintrc.json new file mode 100644 index 00000000..5499a291 --- /dev/null +++ b/ts/.eslintrc.json @@ -0,0 +1,20 @@ +{ + "ignorePatterns": ["node_modules/", "build/", "umd/"], + "env": { + "node": true, + "es2021": true + }, + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": ["@typescript-eslint"], + "rules": { + "@typescript-eslint/no-unused-vars": [ + "error", + { "ignoreRestSiblings": true } + ] + } +} diff --git a/ts/.gitignore b/ts/.gitignore new file mode 100644 index 00000000..6587ccd4 --- /dev/null +++ b/ts/.gitignore @@ -0,0 +1,39 @@ +# compiled output +/dist +/build +/node_modules + +# Logs +logs +*.log +npm-debug.log* +pnpm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +.env.local +.env.*.local diff --git a/ts/.husky/pre-commit b/ts/.husky/pre-commit new file mode 100644 index 00000000..d9fbf413 --- /dev/null +++ b/ts/.husky/pre-commit @@ -0,0 +1 @@ +ts/node_modules/.bin/lint-staged --cwd ts \ No newline at end of file diff --git a/ts/.prettierrc b/ts/.prettierrc new file mode 100644 index 00000000..dcb72794 --- /dev/null +++ b/ts/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "all" +} \ No newline at end of file diff --git a/ts/package-lock.json b/ts/package-lock.json new file mode 100644 index 00000000..1bba2f91 --- /dev/null +++ b/ts/package-lock.json @@ -0,0 +1,2782 @@ +{ + "name": "@akashnetwork/akash-client", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@akashnetwork/akash-client", + "version": "1.0.0", + "license": "Apache-2.0", + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^7.2.0", + "eslint": "^8.57.0", + "husky": "^9.0.11", + "lint-staged": "^15.2.2", + "prettier": "^3.2.5", + "sort-package-json": "^2.8.0", + "swagger-combine": "^1.4.0", + "ts-proto": "^1.169.1", + "typescript": "^5.4.2" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@apidevtools/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", + "dev": true, + "dependencies": { + "@jsdevtools/ono": "^7.1.3", + "@types/json-schema": "^7.0.6", + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0" + } + }, + "node_modules/@apidevtools/openapi-schemas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", + "dev": true + }, + "node_modules/@apidevtools/swagger-parser": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz", + "integrity": "sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==", + "dev": true, + "dependencies": { + "@apidevtools/json-schema-ref-parser": "^9.0.6", + "@apidevtools/openapi-schemas": "^2.0.4", + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "z-schema": "^5.0.1" + }, + "peerDependencies": { + "openapi-types": ">=7" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "dev": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dev": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "dev": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.28", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.28.tgz", + "integrity": "sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz", + "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/type-utils": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", + "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", + "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz", + "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", + "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", + "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz", + "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", + "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "dev": true, + "dependencies": { + "type-fest": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-me-maybe": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "dev": true + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/case-anything": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", + "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", + "dev": true, + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "dev": true, + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "optional": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/detect-indent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.1.tgz", + "integrity": "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==", + "dev": true, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/detect-newline": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", + "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dprint-node": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz", + "integrity": "sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==", + "dev": true, + "dependencies": { + "detect-libc": "^1.0.3" + } + }, + "node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", + "dev": true + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stdin": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", + "integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/git-hooks-list": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-3.1.0.tgz", + "integrity": "sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==", + "dev": true, + "funding": { + "url": "https://github.com/fisker/git-hooks-list?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/husky": { + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "dev": true, + "bin": { + "husky": "bin.mjs" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==", + "deprecated": "Please switch to @apidevtools/json-schema-ref-parser", + "dev": true, + "dependencies": { + "@apidevtools/json-schema-ref-parser": "9.0.9" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/lint-staged": { + "version": "15.2.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", + "integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==", + "dev": true, + "dependencies": { + "chalk": "5.3.0", + "commander": "11.1.0", + "debug": "4.3.4", + "execa": "8.0.1", + "lilconfig": "3.0.0", + "listr2": "8.0.1", + "micromatch": "4.0.5", + "pidtree": "0.6.0", + "string-argv": "0.3.2", + "yaml": "2.3.4" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/listr2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", + "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", + "dev": true, + "dependencies": { + "cli-truncate": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.0.0", + "rfdc": "^1.3.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "dev": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/log-update": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", + "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", + "dev": true, + "dependencies": { + "ansi-escapes": "^6.2.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^7.0.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", + "dev": true, + "peer": true + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/protobufjs": { + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", + "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "dev": true, + "hasInstallScript": 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": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "dev": true + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/sort-object-keys": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-1.1.3.tgz", + "integrity": "sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==", + "dev": true + }, + "node_modules/sort-package-json": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-2.8.0.tgz", + "integrity": "sha512-PxeNg93bTJWmDGnu0HADDucoxfFiKkIr73Kv85EBThlI1YQPdc0XovBgg2llD0iABZbu2SlKo8ntGmOP9wOj/g==", + "dev": true, + "dependencies": { + "detect-indent": "^7.0.1", + "detect-newline": "^4.0.0", + "get-stdin": "^9.0.0", + "git-hooks-list": "^3.0.0", + "globby": "^13.1.2", + "is-plain-obj": "^4.1.0", + "sort-object-keys": "^1.1.3" + }, + "bin": { + "sort-package-json": "cli.js" + } + }, + "node_modules/sort-package-json/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sort-package-json/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/swagger-combine": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/swagger-combine/-/swagger-combine-1.4.0.tgz", + "integrity": "sha512-nVQPzSGixSJ6U3BSTBYswIbamumNCz1ZXPqnCrXYz6BHlSeOtfGKuyZ+sAWtpOepUFuOu93x+VOIzAxLKK6xYw==", + "dev": true, + "dependencies": { + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0", + "json-schema-ref-parser": "^9.0.9", + "lodash": "^4.17.21", + "minimist": "^1.2.5", + "swagger-parser": "^10.0.3", + "traverse": "^0.6.6", + "url-join": "^4.0.1" + }, + "bin": { + "swagger-combine": "bin/swagger-combine" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/swagger-parser": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-10.0.3.tgz", + "integrity": "sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==", + "dev": true, + "dependencies": { + "@apidevtools/swagger-parser": "10.0.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/traverse": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", + "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-poet": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.7.0.tgz", + "integrity": "sha512-A0wvFtpkTCWPw7ftTIwbEH+L+7ul4CU0x3jXKQ+kCnmEQIAOwhpUaBmcAYKxZCxHae9/MUl4LbyTqw25BpzW5Q==", + "dev": true, + "dependencies": { + "dprint-node": "^1.0.8" + } + }, + "node_modules/ts-proto": { + "version": "1.169.1", + "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.169.1.tgz", + "integrity": "sha512-MHdllDrtFCabxvIyUqze7/4vSh55SEgwirpthGVUGt3pMqIpmmrDyBv0vDk/RCjBxm0/LIWVMnXlOjBxYaE1rA==", + "dev": true, + "dependencies": { + "case-anything": "^2.1.13", + "protobufjs": "^7.2.4", + "ts-poet": "^6.7.0", + "ts-proto-descriptors": "1.15.0" + }, + "bin": { + "protoc-gen-ts_proto": "protoc-gen-ts_proto" + } + }, + "node_modules/ts-proto-descriptors": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.15.0.tgz", + "integrity": "sha512-TYyJ7+H+7Jsqawdv+mfsEpZPTIj9siDHS6EMCzG/z3b/PZiphsX+mWtqFfFVe5/N0Th6V3elK9lQqjnrgTOfrg==", + "dev": true, + "dependencies": { + "long": "^5.2.3", + "protobufjs": "^7.2.4" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", + "dev": true + }, + "node_modules/validator": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", + "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/z-schema": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz", + "integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==", + "dev": true, + "dependencies": { + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "validator": "^13.7.0" + }, + "bin": { + "z-schema": "bin/z-schema" + }, + "engines": { + "node": ">=8.0.0" + }, + "optionalDependencies": { + "commander": "^9.4.1" + } + } + } +} diff --git a/ts/package.json b/ts/package.json new file mode 100644 index 00000000..3a4cf8e9 --- /dev/null +++ b/ts/package.json @@ -0,0 +1,36 @@ +{ + "name": "@akashnetwork/akash-client", + "version": "1.0.0", + "description": "Akash API TypeScript client", + "keywords": [], + "license": "Apache-2.0", + "author": "Akash Network Team", + "main": "dist/index.js", + "scripts": { + "build": "tsc -p tsconfig.build.json && npm run format", + "format": "prettier --write './**/*.{js,jsx,ts,tsx,css,json}' --config ./.prettierrc", + "lint": "eslint src", + "lint:fix": "npm run lint -- --fix", + "prepare": "cd .. && husky ts/.husky" + }, + "lint-staged": { + "*.{js,jsx,ts,tsx}": [ + "npm run lint:fix", + "npm run format" + ], + "package.json": [ + "sort-package-json ts/package.json" + ] + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^7.2.0", + "eslint": "^8.57.0", + "husky": "^9.0.11", + "lint-staged": "^15.2.2", + "prettier": "^3.2.5", + "sort-package-json": "^2.8.0", + "swagger-combine": "^1.4.0", + "ts-proto": "^1.169.1", + "typescript": "^5.4.2" + } +} diff --git a/ts/src/index.ts b/ts/src/index.ts new file mode 100644 index 00000000..ff8b4c56 --- /dev/null +++ b/ts/src/index.ts @@ -0,0 +1 @@ +export default {}; diff --git a/ts/tsconfig.build.json b/ts/tsconfig.build.json new file mode 100644 index 00000000..d11b9ccc --- /dev/null +++ b/ts/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/index.ts", "src/types/**/*.d.ts"], + "exclude": ["node_modules", "src/**/*.spec.ts"] +} diff --git a/ts/tsconfig.json b/ts/tsconfig.json new file mode 100644 index 00000000..ecf245aa --- /dev/null +++ b/ts/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "baseUrl": ".", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es2017", + "outDir": "./dist", + "incremental": true, + "strictNullChecks": false, + "noImplicitAny": false, + "strictBindCallApply": false, + "noFallthroughCasesInSwitch": false + } +} From 8598428f226c14d6aa77e1ec7f18f738c2b2aada Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Tue, 2 Apr 2024 16:02:08 +0200 Subject: [PATCH 2/5] feat(ts): adds make targets to setup/clean ts package (#184) --- .env | 2 ++ Makefile | 6 ++++++ make/codegen.mk | 3 ++- make/setup-cache.mk | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 17e929a4..80031265 100644 --- a/.env +++ b/.env @@ -8,3 +8,5 @@ AKASH_DEVCACHE_INCLUDE=${AKASH_DEVCACHE}/include AKASH_DEVCACHE_VERSIONS=${AKASH_DEVCACHE}/versions AKASH_DEVCACHE_NODE_MODULES=${AKASH_DEVCACHE} AKASH_DEVCACHE_NODE_BIN=${AKASH_DEVCACHE_NODE_MODULES}/node_modules/.bin +AKASH_TS_ROOT=${AKASH_ROOT}/ts +AKASH_TS_PACKAGE_FILE=${AKASH_TS_ROOT}/package.json diff --git a/Makefile b/Makefile index a23c0c57..f3c22e8f 100644 --- a/Makefile +++ b/Makefile @@ -82,3 +82,9 @@ include $(AKASH_ROOT)/make/mod.mk include $(AKASH_ROOT)/make/test.mk include $(AKASH_ROOT)/make/codegen.mk include $(AKASH_ROOT)/make/lint.mk + +.PHONY: clean +clean: + rm -rf $(AKASH_DEVCACHE) + rm -rf $(AKASH_TS_ROOT)/node_modules + rm -rf $(AKASH_TS_ROOT)/dist \ No newline at end of file diff --git a/make/codegen.mk b/make/codegen.mk index 99889010..cce26bc7 100644 --- a/make/codegen.mk +++ b/make/codegen.mk @@ -1,6 +1,6 @@ .PHONY: proto-gen ifeq ($(PROTO_LEGACY), true) -proto-gen: modvendor $(PROTOC) $(PROTOC_GEN_GOCOSMOS) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_DOC) +proto-gen: modvendor $(PROTOC) $(PROTOC_GEN_GOCOSMOS) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_DOC) $(AKASH_TS_PACKAGE_FILE) ./script/protocgen-legacy.sh else proto-gen: modvendor gogoproto $(BUF) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_GO) @@ -21,3 +21,4 @@ codegen: proto-gen proto-gen-swagger mocks changelog: $(GIT_CHGLOG) @echo "generating changelog to changelog" ./script/changelog.sh $(shell git describe --tags --abbrev=0) changelog.md + diff --git a/make/setup-cache.mk b/make/setup-cache.mk index 7eacb0b1..f1a0be80 100644 --- a/make/setup-cache.mk +++ b/make/setup-cache.mk @@ -165,3 +165,8 @@ ifeq (, $(shell which swagger-combine 2>/dev/null)) else @echo "swagger-combine already installed; skipping..." endif + +$(AKASH_TS_PACKAGE_FILE): $(AKASH_DEVCACHE) + @echo "installing node modules..." + cd $(AKASH_TS_ROOT) && npm install + @echo "node modules installed." \ No newline at end of file From fe1a5fcd84bcb35e87d4d1296e3dc931614c083d Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Tue, 2 Apr 2024 18:11:33 +0200 Subject: [PATCH 3/5] feat(ts): adds generation to make (#184) --- .env | 1 + .envrc | 1 + Makefile | 6 +- make/codegen.mk | 3 +- script/protocgen-legacy.sh | 21 ++++ ts/package-lock.json | 195 ------------------------------------- ts/package.json | 1 - 7 files changed, 30 insertions(+), 198 deletions(-) diff --git a/.env b/.env index 80031265..1c367a77 100644 --- a/.env +++ b/.env @@ -10,3 +10,4 @@ AKASH_DEVCACHE_NODE_MODULES=${AKASH_DEVCACHE} AKASH_DEVCACHE_NODE_BIN=${AKASH_DEVCACHE_NODE_MODULES}/node_modules/.bin AKASH_TS_ROOT=${AKASH_ROOT}/ts AKASH_TS_PACKAGE_FILE=${AKASH_TS_ROOT}/package.json +AKASH_TS_NODE_BIN=${AKASH_TS_ROOT}/node_modules/.bin \ No newline at end of file diff --git a/.envrc b/.envrc index 9e15cc48..481c4e38 100644 --- a/.envrc +++ b/.envrc @@ -26,5 +26,6 @@ export AKASH_DIRENV_SET PATH_add "$AKASH_DEVCACHE_NODE_BIN" PATH_add "$AKASH_DEVCACHE_BIN" +PATH_add "$AKASH_TS_NODE_BIN" make cache diff --git a/Makefile b/Makefile index f3c22e8f..e0bdb31b 100644 --- a/Makefile +++ b/Makefile @@ -87,4 +87,8 @@ include $(AKASH_ROOT)/make/lint.mk clean: rm -rf $(AKASH_DEVCACHE) rm -rf $(AKASH_TS_ROOT)/node_modules - rm -rf $(AKASH_TS_ROOT)/dist \ No newline at end of file + rm -rf $(AKASH_TS_ROOT)/dist + +.PHONY: clean-codegen +clean-codegen: + rm -rf $(AKASH_TS_ROOT)/src/generated \ No newline at end of file diff --git a/make/codegen.mk b/make/codegen.mk index cce26bc7..b0aa0c74 100644 --- a/make/codegen.mk +++ b/make/codegen.mk @@ -1,6 +1,7 @@ .PHONY: proto-gen ifeq ($(PROTO_LEGACY), true) -proto-gen: modvendor $(PROTOC) $(PROTOC_GEN_GOCOSMOS) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_DOC) $(AKASH_TS_PACKAGE_FILE) +proto-gen: modvendor $(PROTOC) $(PROTOC_GEN_GOCOSMOS) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_DOC) $(AKASH_TS_PACKAGE_FILE) clean-codegen + mkdir -p $(AKASH_TS_ROOT)/src/generated ./script/protocgen-legacy.sh else proto-gen: modvendor gogoproto $(BUF) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_GO) diff --git a/script/protocgen-legacy.sh b/script/protocgen-legacy.sh index dc1538e8..dbd0be86 100755 --- a/script/protocgen-legacy.sh +++ b/script/protocgen-legacy.sh @@ -30,6 +30,16 @@ for dir in $proto_dirs; do -I "vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ --grpc-gateway_out=logtostderr=true:. \ $(find "${dir}" -maxdepth 1 -name '*.proto') + + .cache/bin/protoc \ + -I "proto/node" \ + -I ".cache/include/google/protobuf" \ + -I "vendor/github.com/cosmos/cosmos-sdk/proto" \ + -I "vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ + --plugin="${AKASH_TS_NODE_BIN}/protoc-gen-ts_proto" \ + --ts_proto_out=${AKASH_TS_ROOT}/src/generated \ + --ts_proto_opt=esModuleInterop=true,forceLong=long,outputTypeRegistry=true \ + $(find "${dir}" -maxdepth 1 -name '*.proto') done proto_dirs=$(find ./proto/provider -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) @@ -53,6 +63,17 @@ for dir in $proto_dirs; do -I "vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ --grpc-gateway_out=logtostderr=true:. \ $(find "${dir}" -maxdepth 1 -name '*.proto') + + .cache/bin/protoc \ + -I "proto/provider" \ + -I "proto/node" \ + -I ".cache/include" \ + -I "vendor/github.com/cosmos/cosmos-sdk/proto" \ + -I "vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ + --plugin="${AKASH_TS_NODE_BIN}/protoc-gen-ts_proto" \ + --ts_proto_out=${AKASH_TS_ROOT}/src/generated \ + --ts_proto_opt=esModuleInterop=true,forceLong=long,outputTypeRegistry=true \ + $(find "${dir}" -maxdepth 1 -name '*.proto') done # move proto files to the right places diff --git a/ts/package-lock.json b/ts/package-lock.json index 1bba2f91..ed56479e 100644 --- a/ts/package-lock.json +++ b/ts/package-lock.json @@ -15,7 +15,6 @@ "lint-staged": "^15.2.2", "prettier": "^3.2.5", "sort-package-json": "^2.8.0", - "swagger-combine": "^1.4.0", "ts-proto": "^1.169.1", "typescript": "^5.4.2" } @@ -29,50 +28,6 @@ "node": ">=0.10.0" } }, - "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", - "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", - "dev": true, - "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "@types/json-schema": "^7.0.6", - "call-me-maybe": "^1.0.1", - "js-yaml": "^4.1.0" - } - }, - "node_modules/@apidevtools/openapi-schemas": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", - "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@apidevtools/swagger-methods": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", - "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", - "dev": true - }, - "node_modules/@apidevtools/swagger-parser": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz", - "integrity": "sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==", - "dev": true, - "dependencies": { - "@apidevtools/json-schema-ref-parser": "^9.0.6", - "@apidevtools/openapi-schemas": "^2.0.4", - "@apidevtools/swagger-methods": "^3.0.2", - "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "z-schema": "^5.0.1" - }, - "peerDependencies": { - "openapi-types": ">=7" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -206,12 +161,6 @@ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, - "node_modules/@jsdevtools/ono": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", - "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", - "dev": true - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -659,12 +608,6 @@ "node": ">=8" } }, - "node_modules/call-me-maybe": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", - "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", - "dev": true - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -757,16 +700,6 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, - "node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "dev": true, - "optional": true, - "engines": { - "node": "^12.20.0 || >=14" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1530,19 +1463,6 @@ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true }, - "node_modules/json-schema-ref-parser": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", - "integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==", - "deprecated": "Please switch to @apidevtools/json-schema-ref-parser", - "dev": true, - "dependencies": { - "@apidevtools/json-schema-ref-parser": "9.0.9" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1666,24 +1586,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "dev": true - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "dev": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -1852,15 +1754,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1924,13 +1817,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/openapi-types": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", - "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", - "dev": true, - "peer": true - }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -2477,40 +2363,6 @@ "node": ">=8" } }, - "node_modules/swagger-combine": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/swagger-combine/-/swagger-combine-1.4.0.tgz", - "integrity": "sha512-nVQPzSGixSJ6U3BSTBYswIbamumNCz1ZXPqnCrXYz6BHlSeOtfGKuyZ+sAWtpOepUFuOu93x+VOIzAxLKK6xYw==", - "dev": true, - "dependencies": { - "call-me-maybe": "^1.0.1", - "js-yaml": "^4.1.0", - "json-schema-ref-parser": "^9.0.9", - "lodash": "^4.17.21", - "minimist": "^1.2.5", - "swagger-parser": "^10.0.3", - "traverse": "^0.6.6", - "url-join": "^4.0.1" - }, - "bin": { - "swagger-combine": "bin/swagger-combine" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/swagger-parser": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-10.0.3.tgz", - "integrity": "sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==", - "dev": true, - "dependencies": { - "@apidevtools/swagger-parser": "10.0.3" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -2529,18 +2381,6 @@ "node": ">=8.0" } }, - "node_modules/traverse": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", - "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/ts-api-utils": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", @@ -2639,21 +2479,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", - "dev": true - }, - "node_modules/validator": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", - "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2757,26 +2582,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/z-schema": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz", - "integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==", - "dev": true, - "dependencies": { - "lodash.get": "^4.4.2", - "lodash.isequal": "^4.5.0", - "validator": "^13.7.0" - }, - "bin": { - "z-schema": "bin/z-schema" - }, - "engines": { - "node": ">=8.0.0" - }, - "optionalDependencies": { - "commander": "^9.4.1" - } } } } diff --git a/ts/package.json b/ts/package.json index 3a4cf8e9..c20671f3 100644 --- a/ts/package.json +++ b/ts/package.json @@ -29,7 +29,6 @@ "lint-staged": "^15.2.2", "prettier": "^3.2.5", "sort-package-json": "^2.8.0", - "swagger-combine": "^1.4.0", "ts-proto": "^1.169.1", "typescript": "^5.4.2" } From 343341ff0b0fdc7908362ac646331fdb4d60cb15 Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Tue, 2 Apr 2024 18:11:50 +0200 Subject: [PATCH 4/5] feat(ts): generates code based on protobuf (#184) --- ts/src/generated/akash/audit/v1beta1/audit.ts | 901 +++ ts/src/generated/akash/audit/v1beta2/audit.ts | 901 +++ .../generated/akash/audit/v1beta2/genesis.ts | 125 + ts/src/generated/akash/audit/v1beta2/query.ts | 780 +++ ts/src/generated/akash/audit/v1beta3/audit.ts | 901 +++ .../generated/akash/audit/v1beta3/genesis.ts | 125 + ts/src/generated/akash/audit/v1beta3/query.ts | 780 +++ .../generated/akash/base/v1beta1/attribute.ts | 347 ++ .../generated/akash/base/v1beta1/endpoint.ts | 153 + .../generated/akash/base/v1beta1/resource.ts | 494 ++ .../akash/base/v1beta1/resourcevalue.ts | 146 + .../generated/akash/base/v1beta2/attribute.ts | 347 ++ .../generated/akash/base/v1beta2/endpoint.ts | 178 + .../generated/akash/base/v1beta2/resource.ts | 361 ++ .../akash/base/v1beta2/resourceunits.ts | 191 + .../akash/base/v1beta2/resourcevalue.ts | 146 + .../generated/akash/base/v1beta3/attribute.ts | 347 ++ ts/src/generated/akash/base/v1beta3/cpu.ts | 140 + .../generated/akash/base/v1beta3/endpoint.ts | 178 + ts/src/generated/akash/base/v1beta3/gpu.ts | 140 + ts/src/generated/akash/base/v1beta3/memory.ts | 147 + .../generated/akash/base/v1beta3/resources.ts | 229 + .../akash/base/v1beta3/resourcevalue.ts | 146 + .../generated/akash/base/v1beta3/storage.ts | 164 + ts/src/generated/akash/cert/v1beta2/cert.ts | 826 +++ .../generated/akash/cert/v1beta2/genesis.ts | 235 + ts/src/generated/akash/cert/v1beta2/query.ts | 426 ++ ts/src/generated/akash/cert/v1beta3/cert.ts | 826 +++ .../generated/akash/cert/v1beta3/genesis.ts | 235 + ts/src/generated/akash/cert/v1beta3/query.ts | 426 ++ .../akash/deployment/v1beta1/authz.ts | 143 + .../akash/deployment/v1beta1/deployment.ts | 1320 ++++ .../akash/deployment/v1beta1/genesis.ts | 259 + .../akash/deployment/v1beta1/group.ts | 1038 +++ .../akash/deployment/v1beta1/params.ts | 130 + .../akash/deployment/v1beta1/query.ts | 728 +++ .../akash/deployment/v1beta2/authz.ts | 143 + .../akash/deployment/v1beta2/deployment.ts | 475 ++ .../akash/deployment/v1beta2/deploymentmsg.ts | 813 +++ .../akash/deployment/v1beta2/genesis.ts | 259 + .../akash/deployment/v1beta2/group.ts | 242 + .../akash/deployment/v1beta2/groupid.ts | 157 + .../akash/deployment/v1beta2/groupmsg.ts | 476 ++ .../akash/deployment/v1beta2/groupspec.ts | 172 + .../akash/deployment/v1beta2/params.ts | 130 + .../akash/deployment/v1beta2/query.ts | 729 +++ .../akash/deployment/v1beta2/resource.ts | 167 + .../akash/deployment/v1beta2/service.ts | 136 + .../akash/deployment/v1beta3/authz.ts | 143 + .../akash/deployment/v1beta3/deployment.ts | 475 ++ .../akash/deployment/v1beta3/deploymentmsg.ts | 813 +++ .../akash/deployment/v1beta3/genesis.ts | 259 + .../akash/deployment/v1beta3/group.ts | 242 + .../akash/deployment/v1beta3/groupid.ts | 157 + .../akash/deployment/v1beta3/groupmsg.ts | 476 ++ .../akash/deployment/v1beta3/groupspec.ts | 172 + .../akash/deployment/v1beta3/params.ts | 117 + .../akash/deployment/v1beta3/query.ts | 729 +++ .../akash/deployment/v1beta3/resourceunit.ts | 168 + .../akash/deployment/v1beta3/service.ts | 136 + ts/src/generated/akash/discovery/v1/akash.ts | 120 + .../akash/discovery/v1/client_info.ts | 121 + .../generated/akash/escrow/v1beta1/genesis.ts | 144 + .../generated/akash/escrow/v1beta1/query.ts | 654 ++ .../generated/akash/escrow/v1beta1/types.ts | 621 ++ .../generated/akash/escrow/v1beta2/genesis.ts | 146 + .../generated/akash/escrow/v1beta2/query.ts | 656 ++ .../generated/akash/escrow/v1beta2/types.ts | 679 ++ .../generated/akash/escrow/v1beta3/genesis.ts | 146 + .../generated/akash/escrow/v1beta3/query.ts | 656 ++ .../generated/akash/escrow/v1beta3/types.ts | 679 ++ ts/src/generated/akash/gov/v1beta3/genesis.ts | 130 + ts/src/generated/akash/gov/v1beta3/params.ts | 158 + .../akash/inflation/v1beta2/genesis.ts | 125 + .../akash/inflation/v1beta2/params.ts | 169 + .../akash/inflation/v1beta3/genesis.ts | 125 + .../akash/inflation/v1beta3/params.ts | 169 + .../generated/akash/inventory/v1/cluster.ts | 135 + ts/src/generated/akash/inventory/v1/cpu.ts | 266 + ts/src/generated/akash/inventory/v1/gpu.ts | 306 + ts/src/generated/akash/inventory/v1/memory.ts | 273 + ts/src/generated/akash/inventory/v1/node.ts | 251 + .../akash/inventory/v1/resourcepair.ts | 173 + .../generated/akash/inventory/v1/resources.ts | 252 + .../generated/akash/inventory/v1/service.ts | 118 + .../generated/akash/inventory/v1/storage.ts | 238 + .../generated/akash/manifest/v2beta1/group.ts | 134 + .../akash/manifest/v2beta1/httpoptions.ts | 227 + .../akash/manifest/v2beta1/service.ts | 478 ++ .../akash/manifest/v2beta1/serviceexpose.ts | 282 + .../generated/akash/manifest/v2beta2/group.ts | 134 + .../akash/manifest/v2beta2/httpoptions.ts | 227 + .../akash/manifest/v2beta2/service.ts | 475 ++ .../akash/manifest/v2beta2/serviceexpose.ts | 282 + ts/src/generated/akash/market/v1beta2/bid.ts | 904 +++ .../generated/akash/market/v1beta2/genesis.ts | 168 + .../generated/akash/market/v1beta2/lease.ts | 1013 +++ .../generated/akash/market/v1beta2/order.ts | 515 ++ .../generated/akash/market/v1beta2/params.ts | 145 + .../generated/akash/market/v1beta2/query.ts | 1332 ++++ .../generated/akash/market/v1beta2/service.ts | 94 + ts/src/generated/akash/market/v1beta3/bid.ts | 904 +++ .../generated/akash/market/v1beta3/genesis.ts | 188 + .../generated/akash/market/v1beta3/lease.ts | 1013 +++ .../generated/akash/market/v1beta3/order.ts | 515 ++ .../generated/akash/market/v1beta3/params.ts | 145 + .../generated/akash/market/v1beta3/query.ts | 1332 ++++ .../generated/akash/market/v1beta3/service.ts | 94 + ts/src/generated/akash/market/v1beta4/bid.ts | 1059 ++++ .../generated/akash/market/v1beta4/genesis.ts | 188 + .../generated/akash/market/v1beta4/lease.ts | 1013 +++ .../generated/akash/market/v1beta4/order.ts | 515 ++ .../generated/akash/market/v1beta4/params.ts | 145 + .../generated/akash/market/v1beta4/query.ts | 1332 ++++ .../generated/akash/market/v1beta4/service.ts | 94 + .../akash/provider/lease/v1/service.ts | 1577 +++++ ts/src/generated/akash/provider/v1/service.ts | 74 + ts/src/generated/akash/provider/v1/status.ts | 1245 ++++ .../akash/provider/v1beta1/provider.ts | 894 +++ .../akash/provider/v1beta2/genesis.ts | 121 + .../akash/provider/v1beta2/provider.ts | 894 +++ .../generated/akash/provider/v1beta2/query.ts | 462 ++ .../akash/provider/v1beta3/genesis.ts | 121 + .../akash/provider/v1beta3/provider.ts | 894 +++ .../generated/akash/provider/v1beta3/query.ts | 462 ++ .../akash/staking/v1beta3/genesis.ts | 125 + .../generated/akash/staking/v1beta3/params.ts | 120 + .../generated/akash/take/v1beta3/genesis.ts | 125 + ts/src/generated/akash/take/v1beta3/params.ts | 241 + ts/src/generated/akash/take/v1beta3/query.ts | 24 + .../cosmos/base/query/v1beta1/pagination.ts | 377 ++ ts/src/generated/cosmos/base/v1beta1/coin.ts | 378 ++ ts/src/generated/cosmos_proto/cosmos.ts | 3 + ts/src/generated/gogoproto/gogo.ts | 3 + ts/src/generated/google/api/annotations.ts | 3 + ts/src/generated/google/api/http.ts | 746 +++ .../generated/google/protobuf/descriptor.ts | 5544 +++++++++++++++++ ts/src/generated/google/protobuf/empty.ts | 100 + ts/src/generated/google/protobuf/timestamp.ts | 241 + .../pkg/api/resource/generated.ts | 277 + ts/src/generated/typeRegistry.ts | 36 + 141 files changed, 60289 insertions(+) create mode 100644 ts/src/generated/akash/audit/v1beta1/audit.ts create mode 100644 ts/src/generated/akash/audit/v1beta2/audit.ts create mode 100644 ts/src/generated/akash/audit/v1beta2/genesis.ts create mode 100644 ts/src/generated/akash/audit/v1beta2/query.ts create mode 100644 ts/src/generated/akash/audit/v1beta3/audit.ts create mode 100644 ts/src/generated/akash/audit/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/audit/v1beta3/query.ts create mode 100644 ts/src/generated/akash/base/v1beta1/attribute.ts create mode 100644 ts/src/generated/akash/base/v1beta1/endpoint.ts create mode 100644 ts/src/generated/akash/base/v1beta1/resource.ts create mode 100644 ts/src/generated/akash/base/v1beta1/resourcevalue.ts create mode 100644 ts/src/generated/akash/base/v1beta2/attribute.ts create mode 100644 ts/src/generated/akash/base/v1beta2/endpoint.ts create mode 100644 ts/src/generated/akash/base/v1beta2/resource.ts create mode 100644 ts/src/generated/akash/base/v1beta2/resourceunits.ts create mode 100644 ts/src/generated/akash/base/v1beta2/resourcevalue.ts create mode 100644 ts/src/generated/akash/base/v1beta3/attribute.ts create mode 100644 ts/src/generated/akash/base/v1beta3/cpu.ts create mode 100644 ts/src/generated/akash/base/v1beta3/endpoint.ts create mode 100644 ts/src/generated/akash/base/v1beta3/gpu.ts create mode 100644 ts/src/generated/akash/base/v1beta3/memory.ts create mode 100644 ts/src/generated/akash/base/v1beta3/resources.ts create mode 100644 ts/src/generated/akash/base/v1beta3/resourcevalue.ts create mode 100644 ts/src/generated/akash/base/v1beta3/storage.ts create mode 100644 ts/src/generated/akash/cert/v1beta2/cert.ts create mode 100644 ts/src/generated/akash/cert/v1beta2/genesis.ts create mode 100644 ts/src/generated/akash/cert/v1beta2/query.ts create mode 100644 ts/src/generated/akash/cert/v1beta3/cert.ts create mode 100644 ts/src/generated/akash/cert/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/cert/v1beta3/query.ts create mode 100644 ts/src/generated/akash/deployment/v1beta1/authz.ts create mode 100644 ts/src/generated/akash/deployment/v1beta1/deployment.ts create mode 100644 ts/src/generated/akash/deployment/v1beta1/genesis.ts create mode 100644 ts/src/generated/akash/deployment/v1beta1/group.ts create mode 100644 ts/src/generated/akash/deployment/v1beta1/params.ts create mode 100644 ts/src/generated/akash/deployment/v1beta1/query.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/authz.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/deployment.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/genesis.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/group.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/groupid.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/groupmsg.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/groupspec.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/params.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/query.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/resource.ts create mode 100644 ts/src/generated/akash/deployment/v1beta2/service.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/authz.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/deployment.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/group.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/groupid.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/groupmsg.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/groupspec.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/params.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/query.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/resourceunit.ts create mode 100644 ts/src/generated/akash/deployment/v1beta3/service.ts create mode 100644 ts/src/generated/akash/discovery/v1/akash.ts create mode 100644 ts/src/generated/akash/discovery/v1/client_info.ts create mode 100644 ts/src/generated/akash/escrow/v1beta1/genesis.ts create mode 100644 ts/src/generated/akash/escrow/v1beta1/query.ts create mode 100644 ts/src/generated/akash/escrow/v1beta1/types.ts create mode 100644 ts/src/generated/akash/escrow/v1beta2/genesis.ts create mode 100644 ts/src/generated/akash/escrow/v1beta2/query.ts create mode 100644 ts/src/generated/akash/escrow/v1beta2/types.ts create mode 100644 ts/src/generated/akash/escrow/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/escrow/v1beta3/query.ts create mode 100644 ts/src/generated/akash/escrow/v1beta3/types.ts create mode 100644 ts/src/generated/akash/gov/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/gov/v1beta3/params.ts create mode 100644 ts/src/generated/akash/inflation/v1beta2/genesis.ts create mode 100644 ts/src/generated/akash/inflation/v1beta2/params.ts create mode 100644 ts/src/generated/akash/inflation/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/inflation/v1beta3/params.ts create mode 100644 ts/src/generated/akash/inventory/v1/cluster.ts create mode 100644 ts/src/generated/akash/inventory/v1/cpu.ts create mode 100644 ts/src/generated/akash/inventory/v1/gpu.ts create mode 100644 ts/src/generated/akash/inventory/v1/memory.ts create mode 100644 ts/src/generated/akash/inventory/v1/node.ts create mode 100644 ts/src/generated/akash/inventory/v1/resourcepair.ts create mode 100644 ts/src/generated/akash/inventory/v1/resources.ts create mode 100644 ts/src/generated/akash/inventory/v1/service.ts create mode 100644 ts/src/generated/akash/inventory/v1/storage.ts create mode 100644 ts/src/generated/akash/manifest/v2beta1/group.ts create mode 100644 ts/src/generated/akash/manifest/v2beta1/httpoptions.ts create mode 100644 ts/src/generated/akash/manifest/v2beta1/service.ts create mode 100644 ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts create mode 100644 ts/src/generated/akash/manifest/v2beta2/group.ts create mode 100644 ts/src/generated/akash/manifest/v2beta2/httpoptions.ts create mode 100644 ts/src/generated/akash/manifest/v2beta2/service.ts create mode 100644 ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts create mode 100644 ts/src/generated/akash/market/v1beta2/bid.ts create mode 100644 ts/src/generated/akash/market/v1beta2/genesis.ts create mode 100644 ts/src/generated/akash/market/v1beta2/lease.ts create mode 100644 ts/src/generated/akash/market/v1beta2/order.ts create mode 100644 ts/src/generated/akash/market/v1beta2/params.ts create mode 100644 ts/src/generated/akash/market/v1beta2/query.ts create mode 100644 ts/src/generated/akash/market/v1beta2/service.ts create mode 100644 ts/src/generated/akash/market/v1beta3/bid.ts create mode 100644 ts/src/generated/akash/market/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/market/v1beta3/lease.ts create mode 100644 ts/src/generated/akash/market/v1beta3/order.ts create mode 100644 ts/src/generated/akash/market/v1beta3/params.ts create mode 100644 ts/src/generated/akash/market/v1beta3/query.ts create mode 100644 ts/src/generated/akash/market/v1beta3/service.ts create mode 100644 ts/src/generated/akash/market/v1beta4/bid.ts create mode 100644 ts/src/generated/akash/market/v1beta4/genesis.ts create mode 100644 ts/src/generated/akash/market/v1beta4/lease.ts create mode 100644 ts/src/generated/akash/market/v1beta4/order.ts create mode 100644 ts/src/generated/akash/market/v1beta4/params.ts create mode 100644 ts/src/generated/akash/market/v1beta4/query.ts create mode 100644 ts/src/generated/akash/market/v1beta4/service.ts create mode 100644 ts/src/generated/akash/provider/lease/v1/service.ts create mode 100644 ts/src/generated/akash/provider/v1/service.ts create mode 100644 ts/src/generated/akash/provider/v1/status.ts create mode 100644 ts/src/generated/akash/provider/v1beta1/provider.ts create mode 100644 ts/src/generated/akash/provider/v1beta2/genesis.ts create mode 100644 ts/src/generated/akash/provider/v1beta2/provider.ts create mode 100644 ts/src/generated/akash/provider/v1beta2/query.ts create mode 100644 ts/src/generated/akash/provider/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/provider/v1beta3/provider.ts create mode 100644 ts/src/generated/akash/provider/v1beta3/query.ts create mode 100644 ts/src/generated/akash/staking/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/staking/v1beta3/params.ts create mode 100644 ts/src/generated/akash/take/v1beta3/genesis.ts create mode 100644 ts/src/generated/akash/take/v1beta3/params.ts create mode 100644 ts/src/generated/akash/take/v1beta3/query.ts create mode 100644 ts/src/generated/cosmos/base/query/v1beta1/pagination.ts create mode 100644 ts/src/generated/cosmos/base/v1beta1/coin.ts create mode 100644 ts/src/generated/cosmos_proto/cosmos.ts create mode 100644 ts/src/generated/gogoproto/gogo.ts create mode 100644 ts/src/generated/google/api/annotations.ts create mode 100644 ts/src/generated/google/api/http.ts create mode 100644 ts/src/generated/google/protobuf/descriptor.ts create mode 100644 ts/src/generated/google/protobuf/empty.ts create mode 100644 ts/src/generated/google/protobuf/timestamp.ts create mode 100644 ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts create mode 100644 ts/src/generated/typeRegistry.ts diff --git a/ts/src/generated/akash/audit/v1beta1/audit.ts b/ts/src/generated/akash/audit/v1beta1/audit.ts new file mode 100644 index 00000000..8b96669b --- /dev/null +++ b/ts/src/generated/akash/audit/v1beta1/audit.ts @@ -0,0 +1,901 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from '../../base/v1beta1/attribute'; + +export const protobufPackage = 'akash.audit.v1beta1'; + +/** Provider stores owner auditor and attributes details */ +export interface Provider { + $type: 'akash.audit.v1beta1.Provider'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** Attributes */ +export interface AuditedAttributes { + $type: 'akash.audit.v1beta1.AuditedAttributes'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** AttributesResponse represents details of deployment along with group details */ +export interface AttributesResponse { + $type: 'akash.audit.v1beta1.AttributesResponse'; + attributes: AuditedAttributes[]; +} + +/** AttributesFilters defines filters used to filter deployments */ +export interface AttributesFilters { + $type: 'akash.audit.v1beta1.AttributesFilters'; + auditors: string[]; + owners: string[]; +} + +/** MsgSignProviderAttributes defines an SDK message for signing a provider attributes */ +export interface MsgSignProviderAttributes { + $type: 'akash.audit.v1beta1.MsgSignProviderAttributes'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** MsgSignProviderAttributesResponse defines the Msg/CreateProvider response type. */ +export interface MsgSignProviderAttributesResponse { + $type: 'akash.audit.v1beta1.MsgSignProviderAttributesResponse'; +} + +/** MsgDeleteProviderAttributes defined the Msg/DeleteProviderAttributes */ +export interface MsgDeleteProviderAttributes { + $type: 'akash.audit.v1beta1.MsgDeleteProviderAttributes'; + owner: string; + auditor: string; + keys: string[]; +} + +/** MsgDeleteProviderAttributesResponse defines the Msg/ProviderAttributes response type. */ +export interface MsgDeleteProviderAttributesResponse { + $type: 'akash.audit.v1beta1.MsgDeleteProviderAttributesResponse'; +} + +function createBaseProvider(): Provider { + return { + $type: 'akash.audit.v1beta1.Provider', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const Provider = { + $type: 'akash.audit.v1beta1.Provider' as const, + + encode( + message: Provider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Provider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Provider { + return { + $type: Provider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Provider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Provider { + return Provider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Provider { + const message = createBaseProvider(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Provider.$type, Provider); + +function createBaseAuditedAttributes(): AuditedAttributes { + return { + $type: 'akash.audit.v1beta1.AuditedAttributes', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const AuditedAttributes = { + $type: 'akash.audit.v1beta1.AuditedAttributes' as const, + + encode( + message: AuditedAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AuditedAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuditedAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AuditedAttributes { + return { + $type: AuditedAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: AuditedAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): AuditedAttributes { + return AuditedAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AuditedAttributes { + const message = createBaseAuditedAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(AuditedAttributes.$type, AuditedAttributes); + +function createBaseAttributesResponse(): AttributesResponse { + return { $type: 'akash.audit.v1beta1.AttributesResponse', attributes: [] }; +} + +export const AttributesResponse = { + $type: 'akash.audit.v1beta1.AttributesResponse' as const, + + encode( + message: AttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.attributes) { + AuditedAttributes.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.attributes.push( + AuditedAttributes.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributesResponse { + return { + $type: AttributesResponse.$type, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) + : [], + }; + }, + + toJSON(message: AttributesResponse): unknown { + const obj: any = {}; + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => + AuditedAttributes.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): AttributesResponse { + return AttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AttributesResponse { + const message = createBaseAttributesResponse(); + message.attributes = + object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(AttributesResponse.$type, AttributesResponse); + +function createBaseAttributesFilters(): AttributesFilters { + return { + $type: 'akash.audit.v1beta1.AttributesFilters', + auditors: [], + owners: [], + }; +} + +export const AttributesFilters = { + $type: 'akash.audit.v1beta1.AttributesFilters' as const, + + encode( + message: AttributesFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.auditors) { + writer.uint32(10).string(v!); + } + for (const v of message.owners) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AttributesFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributesFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditors.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owners.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributesFilters { + return { + $type: AttributesFilters.$type, + auditors: globalThis.Array.isArray(object?.auditors) + ? object.auditors.map((e: any) => globalThis.String(e)) + : [], + owners: globalThis.Array.isArray(object?.owners) + ? object.owners.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: AttributesFilters): unknown { + const obj: any = {}; + if (message.auditors?.length) { + obj.auditors = message.auditors; + } + if (message.owners?.length) { + obj.owners = message.owners; + } + return obj; + }, + + create, I>>( + base?: I, + ): AttributesFilters { + return AttributesFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AttributesFilters { + const message = createBaseAttributesFilters(); + message.auditors = object.auditors?.map((e) => e) || []; + message.owners = object.owners?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(AttributesFilters.$type, AttributesFilters); + +function createBaseMsgSignProviderAttributes(): MsgSignProviderAttributes { + return { + $type: 'akash.audit.v1beta1.MsgSignProviderAttributes', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const MsgSignProviderAttributes = { + $type: 'akash.audit.v1beta1.MsgSignProviderAttributes' as const, + + encode( + message: MsgSignProviderAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgSignProviderAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignProviderAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSignProviderAttributes { + return { + $type: MsgSignProviderAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MsgSignProviderAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgSignProviderAttributes { + return MsgSignProviderAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgSignProviderAttributes { + const message = createBaseMsgSignProviderAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MsgSignProviderAttributes.$type, + MsgSignProviderAttributes, +); + +function createBaseMsgSignProviderAttributesResponse(): MsgSignProviderAttributesResponse { + return { $type: 'akash.audit.v1beta1.MsgSignProviderAttributesResponse' }; +} + +export const MsgSignProviderAttributesResponse = { + $type: 'akash.audit.v1beta1.MsgSignProviderAttributesResponse' as const, + + encode( + _: MsgSignProviderAttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgSignProviderAttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignProviderAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgSignProviderAttributesResponse { + return { $type: MsgSignProviderAttributesResponse.$type }; + }, + + toJSON(_: MsgSignProviderAttributesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgSignProviderAttributesResponse { + return MsgSignProviderAttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(_: I): MsgSignProviderAttributesResponse { + const message = createBaseMsgSignProviderAttributesResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgSignProviderAttributesResponse.$type, + MsgSignProviderAttributesResponse, +); + +function createBaseMsgDeleteProviderAttributes(): MsgDeleteProviderAttributes { + return { + $type: 'akash.audit.v1beta1.MsgDeleteProviderAttributes', + owner: '', + auditor: '', + keys: [], + }; +} + +export const MsgDeleteProviderAttributes = { + $type: 'akash.audit.v1beta1.MsgDeleteProviderAttributes' as const, + + encode( + message: MsgDeleteProviderAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.keys) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.keys.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDeleteProviderAttributes { + return { + $type: MsgDeleteProviderAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + keys: globalThis.Array.isArray(object?.keys) + ? object.keys.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: MsgDeleteProviderAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.keys?.length) { + obj.keys = message.keys; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderAttributes { + return MsgDeleteProviderAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDeleteProviderAttributes { + const message = createBaseMsgDeleteProviderAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.keys = object.keys?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderAttributes.$type, + MsgDeleteProviderAttributes, +); + +function createBaseMsgDeleteProviderAttributesResponse(): MsgDeleteProviderAttributesResponse { + return { $type: 'akash.audit.v1beta1.MsgDeleteProviderAttributesResponse' }; +} + +export const MsgDeleteProviderAttributesResponse = { + $type: 'akash.audit.v1beta1.MsgDeleteProviderAttributesResponse' as const, + + encode( + _: MsgDeleteProviderAttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderAttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDeleteProviderAttributesResponse { + return { $type: MsgDeleteProviderAttributesResponse.$type }; + }, + + toJSON(_: MsgDeleteProviderAttributesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderAttributesResponse { + return MsgDeleteProviderAttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(_: I): MsgDeleteProviderAttributesResponse { + const message = createBaseMsgDeleteProviderAttributesResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderAttributesResponse.$type, + MsgDeleteProviderAttributesResponse, +); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** SignProviderAttributes defines a method that signs provider attributes */ + SignProviderAttributes( + request: MsgSignProviderAttributes, + ): Promise; + /** DeleteProviderAttributes defines a method that deletes provider attributes */ + DeleteProviderAttributes( + request: MsgDeleteProviderAttributes, + ): Promise; +} + +export const MsgServiceName = 'akash.audit.v1beta1.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.SignProviderAttributes = this.SignProviderAttributes.bind(this); + this.DeleteProviderAttributes = this.DeleteProviderAttributes.bind(this); + } + SignProviderAttributes( + request: MsgSignProviderAttributes, + ): Promise { + const data = MsgSignProviderAttributes.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'SignProviderAttributes', + data, + ); + return promise.then((data) => + MsgSignProviderAttributesResponse.decode(_m0.Reader.create(data)), + ); + } + + DeleteProviderAttributes( + request: MsgDeleteProviderAttributes, + ): Promise { + const data = MsgDeleteProviderAttributes.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'DeleteProviderAttributes', + data, + ); + return promise.then((data) => + MsgDeleteProviderAttributesResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/audit/v1beta2/audit.ts b/ts/src/generated/akash/audit/v1beta2/audit.ts new file mode 100644 index 00000000..1935d33c --- /dev/null +++ b/ts/src/generated/akash/audit/v1beta2/audit.ts @@ -0,0 +1,901 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from '../../base/v1beta2/attribute'; + +export const protobufPackage = 'akash.audit.v1beta2'; + +/** Provider stores owner auditor and attributes details */ +export interface Provider { + $type: 'akash.audit.v1beta2.Provider'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** Attributes */ +export interface AuditedAttributes { + $type: 'akash.audit.v1beta2.AuditedAttributes'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** AttributesResponse represents details of deployment along with group details */ +export interface AttributesResponse { + $type: 'akash.audit.v1beta2.AttributesResponse'; + attributes: AuditedAttributes[]; +} + +/** AttributesFilters defines filters used to filter deployments */ +export interface AttributesFilters { + $type: 'akash.audit.v1beta2.AttributesFilters'; + auditors: string[]; + owners: string[]; +} + +/** MsgSignProviderAttributes defines an SDK message for signing a provider attributes */ +export interface MsgSignProviderAttributes { + $type: 'akash.audit.v1beta2.MsgSignProviderAttributes'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** MsgSignProviderAttributesResponse defines the Msg/CreateProvider response type. */ +export interface MsgSignProviderAttributesResponse { + $type: 'akash.audit.v1beta2.MsgSignProviderAttributesResponse'; +} + +/** MsgDeleteProviderAttributes defined the Msg/DeleteProviderAttributes */ +export interface MsgDeleteProviderAttributes { + $type: 'akash.audit.v1beta2.MsgDeleteProviderAttributes'; + owner: string; + auditor: string; + keys: string[]; +} + +/** MsgDeleteProviderAttributesResponse defines the Msg/ProviderAttributes response type. */ +export interface MsgDeleteProviderAttributesResponse { + $type: 'akash.audit.v1beta2.MsgDeleteProviderAttributesResponse'; +} + +function createBaseProvider(): Provider { + return { + $type: 'akash.audit.v1beta2.Provider', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const Provider = { + $type: 'akash.audit.v1beta2.Provider' as const, + + encode( + message: Provider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Provider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Provider { + return { + $type: Provider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Provider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Provider { + return Provider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Provider { + const message = createBaseProvider(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Provider.$type, Provider); + +function createBaseAuditedAttributes(): AuditedAttributes { + return { + $type: 'akash.audit.v1beta2.AuditedAttributes', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const AuditedAttributes = { + $type: 'akash.audit.v1beta2.AuditedAttributes' as const, + + encode( + message: AuditedAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AuditedAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuditedAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AuditedAttributes { + return { + $type: AuditedAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: AuditedAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): AuditedAttributes { + return AuditedAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AuditedAttributes { + const message = createBaseAuditedAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(AuditedAttributes.$type, AuditedAttributes); + +function createBaseAttributesResponse(): AttributesResponse { + return { $type: 'akash.audit.v1beta2.AttributesResponse', attributes: [] }; +} + +export const AttributesResponse = { + $type: 'akash.audit.v1beta2.AttributesResponse' as const, + + encode( + message: AttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.attributes) { + AuditedAttributes.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.attributes.push( + AuditedAttributes.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributesResponse { + return { + $type: AttributesResponse.$type, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) + : [], + }; + }, + + toJSON(message: AttributesResponse): unknown { + const obj: any = {}; + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => + AuditedAttributes.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): AttributesResponse { + return AttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AttributesResponse { + const message = createBaseAttributesResponse(); + message.attributes = + object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(AttributesResponse.$type, AttributesResponse); + +function createBaseAttributesFilters(): AttributesFilters { + return { + $type: 'akash.audit.v1beta2.AttributesFilters', + auditors: [], + owners: [], + }; +} + +export const AttributesFilters = { + $type: 'akash.audit.v1beta2.AttributesFilters' as const, + + encode( + message: AttributesFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.auditors) { + writer.uint32(10).string(v!); + } + for (const v of message.owners) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AttributesFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributesFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditors.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owners.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributesFilters { + return { + $type: AttributesFilters.$type, + auditors: globalThis.Array.isArray(object?.auditors) + ? object.auditors.map((e: any) => globalThis.String(e)) + : [], + owners: globalThis.Array.isArray(object?.owners) + ? object.owners.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: AttributesFilters): unknown { + const obj: any = {}; + if (message.auditors?.length) { + obj.auditors = message.auditors; + } + if (message.owners?.length) { + obj.owners = message.owners; + } + return obj; + }, + + create, I>>( + base?: I, + ): AttributesFilters { + return AttributesFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AttributesFilters { + const message = createBaseAttributesFilters(); + message.auditors = object.auditors?.map((e) => e) || []; + message.owners = object.owners?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(AttributesFilters.$type, AttributesFilters); + +function createBaseMsgSignProviderAttributes(): MsgSignProviderAttributes { + return { + $type: 'akash.audit.v1beta2.MsgSignProviderAttributes', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const MsgSignProviderAttributes = { + $type: 'akash.audit.v1beta2.MsgSignProviderAttributes' as const, + + encode( + message: MsgSignProviderAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgSignProviderAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignProviderAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSignProviderAttributes { + return { + $type: MsgSignProviderAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MsgSignProviderAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgSignProviderAttributes { + return MsgSignProviderAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgSignProviderAttributes { + const message = createBaseMsgSignProviderAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MsgSignProviderAttributes.$type, + MsgSignProviderAttributes, +); + +function createBaseMsgSignProviderAttributesResponse(): MsgSignProviderAttributesResponse { + return { $type: 'akash.audit.v1beta2.MsgSignProviderAttributesResponse' }; +} + +export const MsgSignProviderAttributesResponse = { + $type: 'akash.audit.v1beta2.MsgSignProviderAttributesResponse' as const, + + encode( + _: MsgSignProviderAttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgSignProviderAttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignProviderAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgSignProviderAttributesResponse { + return { $type: MsgSignProviderAttributesResponse.$type }; + }, + + toJSON(_: MsgSignProviderAttributesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgSignProviderAttributesResponse { + return MsgSignProviderAttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(_: I): MsgSignProviderAttributesResponse { + const message = createBaseMsgSignProviderAttributesResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgSignProviderAttributesResponse.$type, + MsgSignProviderAttributesResponse, +); + +function createBaseMsgDeleteProviderAttributes(): MsgDeleteProviderAttributes { + return { + $type: 'akash.audit.v1beta2.MsgDeleteProviderAttributes', + owner: '', + auditor: '', + keys: [], + }; +} + +export const MsgDeleteProviderAttributes = { + $type: 'akash.audit.v1beta2.MsgDeleteProviderAttributes' as const, + + encode( + message: MsgDeleteProviderAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.keys) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.keys.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDeleteProviderAttributes { + return { + $type: MsgDeleteProviderAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + keys: globalThis.Array.isArray(object?.keys) + ? object.keys.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: MsgDeleteProviderAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.keys?.length) { + obj.keys = message.keys; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderAttributes { + return MsgDeleteProviderAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDeleteProviderAttributes { + const message = createBaseMsgDeleteProviderAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.keys = object.keys?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderAttributes.$type, + MsgDeleteProviderAttributes, +); + +function createBaseMsgDeleteProviderAttributesResponse(): MsgDeleteProviderAttributesResponse { + return { $type: 'akash.audit.v1beta2.MsgDeleteProviderAttributesResponse' }; +} + +export const MsgDeleteProviderAttributesResponse = { + $type: 'akash.audit.v1beta2.MsgDeleteProviderAttributesResponse' as const, + + encode( + _: MsgDeleteProviderAttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderAttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDeleteProviderAttributesResponse { + return { $type: MsgDeleteProviderAttributesResponse.$type }; + }, + + toJSON(_: MsgDeleteProviderAttributesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderAttributesResponse { + return MsgDeleteProviderAttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(_: I): MsgDeleteProviderAttributesResponse { + const message = createBaseMsgDeleteProviderAttributesResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderAttributesResponse.$type, + MsgDeleteProviderAttributesResponse, +); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** SignProviderAttributes defines a method that signs provider attributes */ + SignProviderAttributes( + request: MsgSignProviderAttributes, + ): Promise; + /** DeleteProviderAttributes defines a method that deletes provider attributes */ + DeleteProviderAttributes( + request: MsgDeleteProviderAttributes, + ): Promise; +} + +export const MsgServiceName = 'akash.audit.v1beta2.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.SignProviderAttributes = this.SignProviderAttributes.bind(this); + this.DeleteProviderAttributes = this.DeleteProviderAttributes.bind(this); + } + SignProviderAttributes( + request: MsgSignProviderAttributes, + ): Promise { + const data = MsgSignProviderAttributes.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'SignProviderAttributes', + data, + ); + return promise.then((data) => + MsgSignProviderAttributesResponse.decode(_m0.Reader.create(data)), + ); + } + + DeleteProviderAttributes( + request: MsgDeleteProviderAttributes, + ): Promise { + const data = MsgDeleteProviderAttributes.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'DeleteProviderAttributes', + data, + ); + return promise.then((data) => + MsgDeleteProviderAttributesResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/audit/v1beta2/genesis.ts b/ts/src/generated/akash/audit/v1beta2/genesis.ts new file mode 100644 index 00000000..4a2d7825 --- /dev/null +++ b/ts/src/generated/akash/audit/v1beta2/genesis.ts @@ -0,0 +1,125 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { AuditedAttributes } from './audit'; + +export const protobufPackage = 'akash.audit.v1beta2'; + +/** GenesisState defines the basic genesis state used by audit module */ +export interface GenesisState { + $type: 'akash.audit.v1beta2.GenesisState'; + attributes: AuditedAttributes[]; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.audit.v1beta2.GenesisState', attributes: [] }; +} + +export const GenesisState = { + $type: 'akash.audit.v1beta2.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.attributes) { + AuditedAttributes.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.attributes.push( + AuditedAttributes.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => + AuditedAttributes.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.attributes = + object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/audit/v1beta2/query.ts b/ts/src/generated/akash/audit/v1beta2/query.ts new file mode 100644 index 00000000..26acc6f4 --- /dev/null +++ b/ts/src/generated/akash/audit/v1beta2/query.ts @@ -0,0 +1,780 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Provider } from './audit'; + +export const protobufPackage = 'akash.audit.v1beta2'; + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryProvidersResponse { + $type: 'akash.audit.v1beta2.QueryProvidersResponse'; + providers: Provider[]; + pagination: PageResponse | undefined; +} + +/** QueryProviderRequest is request type for the Query/Provider RPC method */ +export interface QueryProviderRequest { + $type: 'akash.audit.v1beta2.QueryProviderRequest'; + auditor: string; + owner: string; +} + +/** QueryAllProvidersAttributesRequest is request type for the Query/All Providers RPC method */ +export interface QueryAllProvidersAttributesRequest { + $type: 'akash.audit.v1beta2.QueryAllProvidersAttributesRequest'; + pagination: PageRequest | undefined; +} + +/** QueryProviderAttributesRequest is request type for the Query/Provider RPC method */ +export interface QueryProviderAttributesRequest { + $type: 'akash.audit.v1beta2.QueryProviderAttributesRequest'; + owner: string; + pagination: PageRequest | undefined; +} + +/** QueryProviderAuditorRequest is request type for the Query/Providers RPC method */ +export interface QueryProviderAuditorRequest { + $type: 'akash.audit.v1beta2.QueryProviderAuditorRequest'; + auditor: string; + owner: string; +} + +/** QueryAuditorAttributesRequest is request type for the Query/Providers RPC method */ +export interface QueryAuditorAttributesRequest { + $type: 'akash.audit.v1beta2.QueryAuditorAttributesRequest'; + auditor: string; + pagination: PageRequest | undefined; +} + +function createBaseQueryProvidersResponse(): QueryProvidersResponse { + return { + $type: 'akash.audit.v1beta2.QueryProvidersResponse', + providers: [], + pagination: undefined, + }; +} + +export const QueryProvidersResponse = { + $type: 'akash.audit.v1beta2.QueryProvidersResponse' as const, + + encode( + message: QueryProvidersResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.providers) { + Provider.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProvidersResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProvidersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.providers.push(Provider.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProvidersResponse { + return { + $type: QueryProvidersResponse.$type, + providers: globalThis.Array.isArray(object?.providers) + ? object.providers.map((e: any) => Provider.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProvidersResponse): unknown { + const obj: any = {}; + if (message.providers?.length) { + obj.providers = message.providers.map((e) => Provider.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProvidersResponse { + const message = createBaseQueryProvidersResponse(); + message.providers = + object.providers?.map((e) => Provider.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProvidersResponse.$type, QueryProvidersResponse); + +function createBaseQueryProviderRequest(): QueryProviderRequest { + return { + $type: 'akash.audit.v1beta2.QueryProviderRequest', + auditor: '', + owner: '', + }; +} + +export const QueryProviderRequest = { + $type: 'akash.audit.v1beta2.QueryProviderRequest' as const, + + encode( + message: QueryProviderRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.auditor !== '') { + writer.uint32(10).string(message.auditor); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderRequest { + return { + $type: QueryProviderRequest.$type, + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: QueryProviderRequest): unknown { + const obj: any = {}; + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderRequest { + const message = createBaseQueryProviderRequest(); + message.auditor = object.auditor ?? ''; + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(QueryProviderRequest.$type, QueryProviderRequest); + +function createBaseQueryAllProvidersAttributesRequest(): QueryAllProvidersAttributesRequest { + return { + $type: 'akash.audit.v1beta2.QueryAllProvidersAttributesRequest', + pagination: undefined, + }; +} + +export const QueryAllProvidersAttributesRequest = { + $type: 'akash.audit.v1beta2.QueryAllProvidersAttributesRequest' as const, + + encode( + message: QueryAllProvidersAttributesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAllProvidersAttributesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllProvidersAttributesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAllProvidersAttributesRequest { + return { + $type: QueryAllProvidersAttributesRequest.$type, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAllProvidersAttributesRequest): unknown { + const obj: any = {}; + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAllProvidersAttributesRequest { + return QueryAllProvidersAttributesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(object: I): QueryAllProvidersAttributesRequest { + const message = createBaseQueryAllProvidersAttributesRequest(); + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryAllProvidersAttributesRequest.$type, + QueryAllProvidersAttributesRequest, +); + +function createBaseQueryProviderAttributesRequest(): QueryProviderAttributesRequest { + return { + $type: 'akash.audit.v1beta2.QueryProviderAttributesRequest', + owner: '', + pagination: undefined, + }; +} + +export const QueryProviderAttributesRequest = { + $type: 'akash.audit.v1beta2.QueryProviderAttributesRequest' as const, + + encode( + message: QueryProviderAttributesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderAttributesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderAttributesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderAttributesRequest { + return { + $type: QueryProviderAttributesRequest.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProviderAttributesRequest): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderAttributesRequest { + return QueryProviderAttributesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderAttributesRequest { + const message = createBaseQueryProviderAttributesRequest(); + message.owner = object.owner ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryProviderAttributesRequest.$type, + QueryProviderAttributesRequest, +); + +function createBaseQueryProviderAuditorRequest(): QueryProviderAuditorRequest { + return { + $type: 'akash.audit.v1beta2.QueryProviderAuditorRequest', + auditor: '', + owner: '', + }; +} + +export const QueryProviderAuditorRequest = { + $type: 'akash.audit.v1beta2.QueryProviderAuditorRequest' as const, + + encode( + message: QueryProviderAuditorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.auditor !== '') { + writer.uint32(10).string(message.auditor); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderAuditorRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderAuditorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderAuditorRequest { + return { + $type: QueryProviderAuditorRequest.$type, + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: QueryProviderAuditorRequest): unknown { + const obj: any = {}; + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderAuditorRequest { + return QueryProviderAuditorRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderAuditorRequest { + const message = createBaseQueryProviderAuditorRequest(); + message.auditor = object.auditor ?? ''; + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set( + QueryProviderAuditorRequest.$type, + QueryProviderAuditorRequest, +); + +function createBaseQueryAuditorAttributesRequest(): QueryAuditorAttributesRequest { + return { + $type: 'akash.audit.v1beta2.QueryAuditorAttributesRequest', + auditor: '', + pagination: undefined, + }; +} + +export const QueryAuditorAttributesRequest = { + $type: 'akash.audit.v1beta2.QueryAuditorAttributesRequest' as const, + + encode( + message: QueryAuditorAttributesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.auditor !== '') { + writer.uint32(10).string(message.auditor); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAuditorAttributesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuditorAttributesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAuditorAttributesRequest { + return { + $type: QueryAuditorAttributesRequest.$type, + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAuditorAttributesRequest): unknown { + const obj: any = {}; + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAuditorAttributesRequest { + return QueryAuditorAttributesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAuditorAttributesRequest { + const message = createBaseQueryAuditorAttributesRequest(); + message.auditor = object.auditor ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryAuditorAttributesRequest.$type, + QueryAuditorAttributesRequest, +); + +/** Query defines the gRPC querier service */ +export interface Query { + /** + * AllProvidersAttributes queries all providers + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + AllProvidersAttributes( + request: QueryAllProvidersAttributesRequest, + ): Promise; + /** + * ProviderAttributes queries all provider signed attributes + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + ProviderAttributes( + request: QueryProviderAttributesRequest, + ): Promise; + /** + * ProviderAuditorAttributes queries provider signed attributes by specific auditor + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + ProviderAuditorAttributes( + request: QueryProviderAuditorRequest, + ): Promise; + /** + * AuditorAttributes queries all providers signed by this auditor + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + AuditorAttributes( + request: QueryAuditorAttributesRequest, + ): Promise; +} + +export const QueryServiceName = 'akash.audit.v1beta2.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.AllProvidersAttributes = this.AllProvidersAttributes.bind(this); + this.ProviderAttributes = this.ProviderAttributes.bind(this); + this.ProviderAuditorAttributes = this.ProviderAuditorAttributes.bind(this); + this.AuditorAttributes = this.AuditorAttributes.bind(this); + } + AllProvidersAttributes( + request: QueryAllProvidersAttributesRequest, + ): Promise { + const data = QueryAllProvidersAttributesRequest.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'AllProvidersAttributes', + data, + ); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + ProviderAttributes( + request: QueryProviderAttributesRequest, + ): Promise { + const data = QueryProviderAttributesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'ProviderAttributes', data); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + ProviderAuditorAttributes( + request: QueryProviderAuditorRequest, + ): Promise { + const data = QueryProviderAuditorRequest.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'ProviderAuditorAttributes', + data, + ); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + AuditorAttributes( + request: QueryAuditorAttributesRequest, + ): Promise { + const data = QueryAuditorAttributesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'AuditorAttributes', data); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/audit/v1beta3/audit.ts b/ts/src/generated/akash/audit/v1beta3/audit.ts new file mode 100644 index 00000000..641f5fd6 --- /dev/null +++ b/ts/src/generated/akash/audit/v1beta3/audit.ts @@ -0,0 +1,901 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from '../../base/v1beta3/attribute'; + +export const protobufPackage = 'akash.audit.v1beta3'; + +/** Provider stores owner auditor and attributes details */ +export interface Provider { + $type: 'akash.audit.v1beta3.Provider'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** Attributes */ +export interface AuditedAttributes { + $type: 'akash.audit.v1beta3.AuditedAttributes'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** AttributesResponse represents details of deployment along with group details */ +export interface AttributesResponse { + $type: 'akash.audit.v1beta3.AttributesResponse'; + attributes: AuditedAttributes[]; +} + +/** AttributesFilters defines filters used to filter deployments */ +export interface AttributesFilters { + $type: 'akash.audit.v1beta3.AttributesFilters'; + auditors: string[]; + owners: string[]; +} + +/** MsgSignProviderAttributes defines an SDK message for signing a provider attributes */ +export interface MsgSignProviderAttributes { + $type: 'akash.audit.v1beta3.MsgSignProviderAttributes'; + owner: string; + auditor: string; + attributes: Attribute[]; +} + +/** MsgSignProviderAttributesResponse defines the Msg/CreateProvider response type. */ +export interface MsgSignProviderAttributesResponse { + $type: 'akash.audit.v1beta3.MsgSignProviderAttributesResponse'; +} + +/** MsgDeleteProviderAttributes defined the Msg/DeleteProviderAttributes */ +export interface MsgDeleteProviderAttributes { + $type: 'akash.audit.v1beta3.MsgDeleteProviderAttributes'; + owner: string; + auditor: string; + keys: string[]; +} + +/** MsgDeleteProviderAttributesResponse defines the Msg/ProviderAttributes response type. */ +export interface MsgDeleteProviderAttributesResponse { + $type: 'akash.audit.v1beta3.MsgDeleteProviderAttributesResponse'; +} + +function createBaseProvider(): Provider { + return { + $type: 'akash.audit.v1beta3.Provider', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const Provider = { + $type: 'akash.audit.v1beta3.Provider' as const, + + encode( + message: Provider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Provider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Provider { + return { + $type: Provider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Provider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Provider { + return Provider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Provider { + const message = createBaseProvider(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Provider.$type, Provider); + +function createBaseAuditedAttributes(): AuditedAttributes { + return { + $type: 'akash.audit.v1beta3.AuditedAttributes', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const AuditedAttributes = { + $type: 'akash.audit.v1beta3.AuditedAttributes' as const, + + encode( + message: AuditedAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AuditedAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuditedAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AuditedAttributes { + return { + $type: AuditedAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: AuditedAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): AuditedAttributes { + return AuditedAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AuditedAttributes { + const message = createBaseAuditedAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(AuditedAttributes.$type, AuditedAttributes); + +function createBaseAttributesResponse(): AttributesResponse { + return { $type: 'akash.audit.v1beta3.AttributesResponse', attributes: [] }; +} + +export const AttributesResponse = { + $type: 'akash.audit.v1beta3.AttributesResponse' as const, + + encode( + message: AttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.attributes) { + AuditedAttributes.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.attributes.push( + AuditedAttributes.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributesResponse { + return { + $type: AttributesResponse.$type, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) + : [], + }; + }, + + toJSON(message: AttributesResponse): unknown { + const obj: any = {}; + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => + AuditedAttributes.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): AttributesResponse { + return AttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AttributesResponse { + const message = createBaseAttributesResponse(); + message.attributes = + object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(AttributesResponse.$type, AttributesResponse); + +function createBaseAttributesFilters(): AttributesFilters { + return { + $type: 'akash.audit.v1beta3.AttributesFilters', + auditors: [], + owners: [], + }; +} + +export const AttributesFilters = { + $type: 'akash.audit.v1beta3.AttributesFilters' as const, + + encode( + message: AttributesFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.auditors) { + writer.uint32(10).string(v!); + } + for (const v of message.owners) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AttributesFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributesFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditors.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owners.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributesFilters { + return { + $type: AttributesFilters.$type, + auditors: globalThis.Array.isArray(object?.auditors) + ? object.auditors.map((e: any) => globalThis.String(e)) + : [], + owners: globalThis.Array.isArray(object?.owners) + ? object.owners.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: AttributesFilters): unknown { + const obj: any = {}; + if (message.auditors?.length) { + obj.auditors = message.auditors; + } + if (message.owners?.length) { + obj.owners = message.owners; + } + return obj; + }, + + create, I>>( + base?: I, + ): AttributesFilters { + return AttributesFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AttributesFilters { + const message = createBaseAttributesFilters(); + message.auditors = object.auditors?.map((e) => e) || []; + message.owners = object.owners?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(AttributesFilters.$type, AttributesFilters); + +function createBaseMsgSignProviderAttributes(): MsgSignProviderAttributes { + return { + $type: 'akash.audit.v1beta3.MsgSignProviderAttributes', + owner: '', + auditor: '', + attributes: [], + }; +} + +export const MsgSignProviderAttributes = { + $type: 'akash.audit.v1beta3.MsgSignProviderAttributes' as const, + + encode( + message: MsgSignProviderAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgSignProviderAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignProviderAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSignProviderAttributes { + return { + $type: MsgSignProviderAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MsgSignProviderAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgSignProviderAttributes { + return MsgSignProviderAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgSignProviderAttributes { + const message = createBaseMsgSignProviderAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MsgSignProviderAttributes.$type, + MsgSignProviderAttributes, +); + +function createBaseMsgSignProviderAttributesResponse(): MsgSignProviderAttributesResponse { + return { $type: 'akash.audit.v1beta3.MsgSignProviderAttributesResponse' }; +} + +export const MsgSignProviderAttributesResponse = { + $type: 'akash.audit.v1beta3.MsgSignProviderAttributesResponse' as const, + + encode( + _: MsgSignProviderAttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgSignProviderAttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignProviderAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgSignProviderAttributesResponse { + return { $type: MsgSignProviderAttributesResponse.$type }; + }, + + toJSON(_: MsgSignProviderAttributesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgSignProviderAttributesResponse { + return MsgSignProviderAttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(_: I): MsgSignProviderAttributesResponse { + const message = createBaseMsgSignProviderAttributesResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgSignProviderAttributesResponse.$type, + MsgSignProviderAttributesResponse, +); + +function createBaseMsgDeleteProviderAttributes(): MsgDeleteProviderAttributes { + return { + $type: 'akash.audit.v1beta3.MsgDeleteProviderAttributes', + owner: '', + auditor: '', + keys: [], + }; +} + +export const MsgDeleteProviderAttributes = { + $type: 'akash.audit.v1beta3.MsgDeleteProviderAttributes' as const, + + encode( + message: MsgDeleteProviderAttributes, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.auditor !== '') { + writer.uint32(18).string(message.auditor); + } + for (const v of message.keys) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderAttributes { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.auditor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.keys.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDeleteProviderAttributes { + return { + $type: MsgDeleteProviderAttributes.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + keys: globalThis.Array.isArray(object?.keys) + ? object.keys.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: MsgDeleteProviderAttributes): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.keys?.length) { + obj.keys = message.keys; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderAttributes { + return MsgDeleteProviderAttributes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDeleteProviderAttributes { + const message = createBaseMsgDeleteProviderAttributes(); + message.owner = object.owner ?? ''; + message.auditor = object.auditor ?? ''; + message.keys = object.keys?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderAttributes.$type, + MsgDeleteProviderAttributes, +); + +function createBaseMsgDeleteProviderAttributesResponse(): MsgDeleteProviderAttributesResponse { + return { $type: 'akash.audit.v1beta3.MsgDeleteProviderAttributesResponse' }; +} + +export const MsgDeleteProviderAttributesResponse = { + $type: 'akash.audit.v1beta3.MsgDeleteProviderAttributesResponse' as const, + + encode( + _: MsgDeleteProviderAttributesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderAttributesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderAttributesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDeleteProviderAttributesResponse { + return { $type: MsgDeleteProviderAttributesResponse.$type }; + }, + + toJSON(_: MsgDeleteProviderAttributesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderAttributesResponse { + return MsgDeleteProviderAttributesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(_: I): MsgDeleteProviderAttributesResponse { + const message = createBaseMsgDeleteProviderAttributesResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderAttributesResponse.$type, + MsgDeleteProviderAttributesResponse, +); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** SignProviderAttributes defines a method that signs provider attributes */ + SignProviderAttributes( + request: MsgSignProviderAttributes, + ): Promise; + /** DeleteProviderAttributes defines a method that deletes provider attributes */ + DeleteProviderAttributes( + request: MsgDeleteProviderAttributes, + ): Promise; +} + +export const MsgServiceName = 'akash.audit.v1beta3.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.SignProviderAttributes = this.SignProviderAttributes.bind(this); + this.DeleteProviderAttributes = this.DeleteProviderAttributes.bind(this); + } + SignProviderAttributes( + request: MsgSignProviderAttributes, + ): Promise { + const data = MsgSignProviderAttributes.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'SignProviderAttributes', + data, + ); + return promise.then((data) => + MsgSignProviderAttributesResponse.decode(_m0.Reader.create(data)), + ); + } + + DeleteProviderAttributes( + request: MsgDeleteProviderAttributes, + ): Promise { + const data = MsgDeleteProviderAttributes.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'DeleteProviderAttributes', + data, + ); + return promise.then((data) => + MsgDeleteProviderAttributesResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/audit/v1beta3/genesis.ts b/ts/src/generated/akash/audit/v1beta3/genesis.ts new file mode 100644 index 00000000..5593e250 --- /dev/null +++ b/ts/src/generated/akash/audit/v1beta3/genesis.ts @@ -0,0 +1,125 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { AuditedAttributes } from './audit'; + +export const protobufPackage = 'akash.audit.v1beta3'; + +/** GenesisState defines the basic genesis state used by audit module */ +export interface GenesisState { + $type: 'akash.audit.v1beta3.GenesisState'; + attributes: AuditedAttributes[]; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.audit.v1beta3.GenesisState', attributes: [] }; +} + +export const GenesisState = { + $type: 'akash.audit.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.attributes) { + AuditedAttributes.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.attributes.push( + AuditedAttributes.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => + AuditedAttributes.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.attributes = + object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/audit/v1beta3/query.ts b/ts/src/generated/akash/audit/v1beta3/query.ts new file mode 100644 index 00000000..c73241fb --- /dev/null +++ b/ts/src/generated/akash/audit/v1beta3/query.ts @@ -0,0 +1,780 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Provider } from './audit'; + +export const protobufPackage = 'akash.audit.v1beta3'; + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryProvidersResponse { + $type: 'akash.audit.v1beta3.QueryProvidersResponse'; + providers: Provider[]; + pagination: PageResponse | undefined; +} + +/** QueryProviderRequest is request type for the Query/Provider RPC method */ +export interface QueryProviderRequest { + $type: 'akash.audit.v1beta3.QueryProviderRequest'; + auditor: string; + owner: string; +} + +/** QueryAllProvidersAttributesRequest is request type for the Query/All Providers RPC method */ +export interface QueryAllProvidersAttributesRequest { + $type: 'akash.audit.v1beta3.QueryAllProvidersAttributesRequest'; + pagination: PageRequest | undefined; +} + +/** QueryProviderAttributesRequest is request type for the Query/Provider RPC method */ +export interface QueryProviderAttributesRequest { + $type: 'akash.audit.v1beta3.QueryProviderAttributesRequest'; + owner: string; + pagination: PageRequest | undefined; +} + +/** QueryProviderAuditorRequest is request type for the Query/Providers RPC method */ +export interface QueryProviderAuditorRequest { + $type: 'akash.audit.v1beta3.QueryProviderAuditorRequest'; + auditor: string; + owner: string; +} + +/** QueryAuditorAttributesRequest is request type for the Query/Providers RPC method */ +export interface QueryAuditorAttributesRequest { + $type: 'akash.audit.v1beta3.QueryAuditorAttributesRequest'; + auditor: string; + pagination: PageRequest | undefined; +} + +function createBaseQueryProvidersResponse(): QueryProvidersResponse { + return { + $type: 'akash.audit.v1beta3.QueryProvidersResponse', + providers: [], + pagination: undefined, + }; +} + +export const QueryProvidersResponse = { + $type: 'akash.audit.v1beta3.QueryProvidersResponse' as const, + + encode( + message: QueryProvidersResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.providers) { + Provider.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProvidersResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProvidersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.providers.push(Provider.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProvidersResponse { + return { + $type: QueryProvidersResponse.$type, + providers: globalThis.Array.isArray(object?.providers) + ? object.providers.map((e: any) => Provider.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProvidersResponse): unknown { + const obj: any = {}; + if (message.providers?.length) { + obj.providers = message.providers.map((e) => Provider.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProvidersResponse { + const message = createBaseQueryProvidersResponse(); + message.providers = + object.providers?.map((e) => Provider.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProvidersResponse.$type, QueryProvidersResponse); + +function createBaseQueryProviderRequest(): QueryProviderRequest { + return { + $type: 'akash.audit.v1beta3.QueryProviderRequest', + auditor: '', + owner: '', + }; +} + +export const QueryProviderRequest = { + $type: 'akash.audit.v1beta3.QueryProviderRequest' as const, + + encode( + message: QueryProviderRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.auditor !== '') { + writer.uint32(10).string(message.auditor); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderRequest { + return { + $type: QueryProviderRequest.$type, + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: QueryProviderRequest): unknown { + const obj: any = {}; + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderRequest { + const message = createBaseQueryProviderRequest(); + message.auditor = object.auditor ?? ''; + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(QueryProviderRequest.$type, QueryProviderRequest); + +function createBaseQueryAllProvidersAttributesRequest(): QueryAllProvidersAttributesRequest { + return { + $type: 'akash.audit.v1beta3.QueryAllProvidersAttributesRequest', + pagination: undefined, + }; +} + +export const QueryAllProvidersAttributesRequest = { + $type: 'akash.audit.v1beta3.QueryAllProvidersAttributesRequest' as const, + + encode( + message: QueryAllProvidersAttributesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAllProvidersAttributesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllProvidersAttributesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAllProvidersAttributesRequest { + return { + $type: QueryAllProvidersAttributesRequest.$type, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAllProvidersAttributesRequest): unknown { + const obj: any = {}; + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAllProvidersAttributesRequest { + return QueryAllProvidersAttributesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(object: I): QueryAllProvidersAttributesRequest { + const message = createBaseQueryAllProvidersAttributesRequest(); + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryAllProvidersAttributesRequest.$type, + QueryAllProvidersAttributesRequest, +); + +function createBaseQueryProviderAttributesRequest(): QueryProviderAttributesRequest { + return { + $type: 'akash.audit.v1beta3.QueryProviderAttributesRequest', + owner: '', + pagination: undefined, + }; +} + +export const QueryProviderAttributesRequest = { + $type: 'akash.audit.v1beta3.QueryProviderAttributesRequest' as const, + + encode( + message: QueryProviderAttributesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderAttributesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderAttributesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderAttributesRequest { + return { + $type: QueryProviderAttributesRequest.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProviderAttributesRequest): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderAttributesRequest { + return QueryProviderAttributesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderAttributesRequest { + const message = createBaseQueryProviderAttributesRequest(); + message.owner = object.owner ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryProviderAttributesRequest.$type, + QueryProviderAttributesRequest, +); + +function createBaseQueryProviderAuditorRequest(): QueryProviderAuditorRequest { + return { + $type: 'akash.audit.v1beta3.QueryProviderAuditorRequest', + auditor: '', + owner: '', + }; +} + +export const QueryProviderAuditorRequest = { + $type: 'akash.audit.v1beta3.QueryProviderAuditorRequest' as const, + + encode( + message: QueryProviderAuditorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.auditor !== '') { + writer.uint32(10).string(message.auditor); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderAuditorRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderAuditorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderAuditorRequest { + return { + $type: QueryProviderAuditorRequest.$type, + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: QueryProviderAuditorRequest): unknown { + const obj: any = {}; + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderAuditorRequest { + return QueryProviderAuditorRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderAuditorRequest { + const message = createBaseQueryProviderAuditorRequest(); + message.auditor = object.auditor ?? ''; + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set( + QueryProviderAuditorRequest.$type, + QueryProviderAuditorRequest, +); + +function createBaseQueryAuditorAttributesRequest(): QueryAuditorAttributesRequest { + return { + $type: 'akash.audit.v1beta3.QueryAuditorAttributesRequest', + auditor: '', + pagination: undefined, + }; +} + +export const QueryAuditorAttributesRequest = { + $type: 'akash.audit.v1beta3.QueryAuditorAttributesRequest' as const, + + encode( + message: QueryAuditorAttributesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.auditor !== '') { + writer.uint32(10).string(message.auditor); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAuditorAttributesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuditorAttributesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.auditor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAuditorAttributesRequest { + return { + $type: QueryAuditorAttributesRequest.$type, + auditor: isSet(object.auditor) ? globalThis.String(object.auditor) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAuditorAttributesRequest): unknown { + const obj: any = {}; + if (message.auditor !== '') { + obj.auditor = message.auditor; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAuditorAttributesRequest { + return QueryAuditorAttributesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAuditorAttributesRequest { + const message = createBaseQueryAuditorAttributesRequest(); + message.auditor = object.auditor ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryAuditorAttributesRequest.$type, + QueryAuditorAttributesRequest, +); + +/** Query defines the gRPC querier service */ +export interface Query { + /** + * AllProvidersAttributes queries all providers + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + AllProvidersAttributes( + request: QueryAllProvidersAttributesRequest, + ): Promise; + /** + * ProviderAttributes queries all provider signed attributes + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + ProviderAttributes( + request: QueryProviderAttributesRequest, + ): Promise; + /** + * ProviderAuditorAttributes queries provider signed attributes by specific auditor + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + ProviderAuditorAttributes( + request: QueryProviderAuditorRequest, + ): Promise; + /** + * AuditorAttributes queries all providers signed by this auditor + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + AuditorAttributes( + request: QueryAuditorAttributesRequest, + ): Promise; +} + +export const QueryServiceName = 'akash.audit.v1beta3.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.AllProvidersAttributes = this.AllProvidersAttributes.bind(this); + this.ProviderAttributes = this.ProviderAttributes.bind(this); + this.ProviderAuditorAttributes = this.ProviderAuditorAttributes.bind(this); + this.AuditorAttributes = this.AuditorAttributes.bind(this); + } + AllProvidersAttributes( + request: QueryAllProvidersAttributesRequest, + ): Promise { + const data = QueryAllProvidersAttributesRequest.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'AllProvidersAttributes', + data, + ); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + ProviderAttributes( + request: QueryProviderAttributesRequest, + ): Promise { + const data = QueryProviderAttributesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'ProviderAttributes', data); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + ProviderAuditorAttributes( + request: QueryProviderAuditorRequest, + ): Promise { + const data = QueryProviderAuditorRequest.encode(request).finish(); + const promise = this.rpc.request( + this.service, + 'ProviderAuditorAttributes', + data, + ); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + AuditorAttributes( + request: QueryAuditorAttributesRequest, + ): Promise { + const data = QueryAuditorAttributesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'AuditorAttributes', data); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta1/attribute.ts b/ts/src/generated/akash/base/v1beta1/attribute.ts new file mode 100644 index 00000000..e99e5c59 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta1/attribute.ts @@ -0,0 +1,347 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta1'; + +/** Attribute represents key value pair */ +export interface Attribute { + $type: 'akash.base.v1beta1.Attribute'; + key: string; + value: string; +} + +/** + * SignedBy represents validation accounts that tenant expects signatures for provider attributes + * AllOf has precedence i.e. if there is at least one entry AnyOf is ignored regardless to how many + * entries there + * this behaviour to be discussed + */ +export interface SignedBy { + $type: 'akash.base.v1beta1.SignedBy'; + /** all_of all keys in this list must have signed attributes */ + allOf: string[]; + /** any_of at least of of the keys from the list must have signed attributes */ + anyOf: string[]; +} + +/** PlacementRequirements */ +export interface PlacementRequirements { + $type: 'akash.base.v1beta1.PlacementRequirements'; + /** SignedBy list of keys that tenants expect to have signatures from */ + signedBy: SignedBy | undefined; + /** Attribute list of attributes tenant expects from the provider */ + attributes: Attribute[]; +} + +function createBaseAttribute(): Attribute { + return { $type: 'akash.base.v1beta1.Attribute', key: '', value: '' }; +} + +export const Attribute = { + $type: 'akash.base.v1beta1.Attribute' as const, + + encode( + message: Attribute, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.key !== '') { + writer.uint32(10).string(message.key); + } + if (message.value !== '') { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Attribute { + return { + $type: Attribute.$type, + key: isSet(object.key) ? globalThis.String(object.key) : '', + value: isSet(object.value) ? globalThis.String(object.value) : '', + }; + }, + + toJSON(message: Attribute): unknown { + const obj: any = {}; + if (message.key !== '') { + obj.key = message.key; + } + if (message.value !== '') { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Attribute { + return Attribute.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Attribute { + const message = createBaseAttribute(); + message.key = object.key ?? ''; + message.value = object.value ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Attribute.$type, Attribute); + +function createBaseSignedBy(): SignedBy { + return { $type: 'akash.base.v1beta1.SignedBy', allOf: [], anyOf: [] }; +} + +export const SignedBy = { + $type: 'akash.base.v1beta1.SignedBy' as const, + + encode( + message: SignedBy, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.allOf) { + writer.uint32(10).string(v!); + } + for (const v of message.anyOf) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignedBy { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedBy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.allOf.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.anyOf.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): SignedBy { + return { + $type: SignedBy.$type, + allOf: globalThis.Array.isArray(object?.allOf) + ? object.allOf.map((e: any) => globalThis.String(e)) + : [], + anyOf: globalThis.Array.isArray(object?.anyOf) + ? object.anyOf.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: SignedBy): unknown { + const obj: any = {}; + if (message.allOf?.length) { + obj.allOf = message.allOf; + } + if (message.anyOf?.length) { + obj.anyOf = message.anyOf; + } + return obj; + }, + + create, I>>(base?: I): SignedBy { + return SignedBy.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SignedBy { + const message = createBaseSignedBy(); + message.allOf = object.allOf?.map((e) => e) || []; + message.anyOf = object.anyOf?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(SignedBy.$type, SignedBy); + +function createBasePlacementRequirements(): PlacementRequirements { + return { + $type: 'akash.base.v1beta1.PlacementRequirements', + signedBy: undefined, + attributes: [], + }; +} + +export const PlacementRequirements = { + $type: 'akash.base.v1beta1.PlacementRequirements' as const, + + encode( + message: PlacementRequirements, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signedBy !== undefined) { + SignedBy.encode(message.signedBy, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): PlacementRequirements { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlacementRequirements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.signedBy = SignedBy.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): PlacementRequirements { + return { + $type: PlacementRequirements.$type, + signedBy: isSet(object.signedBy) + ? SignedBy.fromJSON(object.signedBy) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: PlacementRequirements): unknown { + const obj: any = {}; + if (message.signedBy !== undefined) { + obj.signedBy = SignedBy.toJSON(message.signedBy); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): PlacementRequirements { + return PlacementRequirements.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): PlacementRequirements { + const message = createBasePlacementRequirements(); + message.signedBy = + object.signedBy !== undefined && object.signedBy !== null + ? SignedBy.fromPartial(object.signedBy) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(PlacementRequirements.$type, PlacementRequirements); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta1/endpoint.ts b/ts/src/generated/akash/base/v1beta1/endpoint.ts new file mode 100644 index 00000000..49c04f50 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta1/endpoint.ts @@ -0,0 +1,153 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta1'; + +/** Endpoint describes a publicly accessible IP service */ +export interface Endpoint { + $type: 'akash.base.v1beta1.Endpoint'; + kind: Endpoint_Kind; +} + +/** This describes how the endpoint is implemented when the lease is deployed */ +export enum Endpoint_Kind { + /** SHARED_HTTP - Describes an endpoint that becomes a Kubernetes Ingress */ + SHARED_HTTP = 0, + /** RANDOM_PORT - Describes an endpoint that becomes a Kubernetes NodePort */ + RANDOM_PORT = 1, + UNRECOGNIZED = -1, +} + +export function endpoint_KindFromJSON(object: any): Endpoint_Kind { + switch (object) { + case 0: + case 'SHARED_HTTP': + return Endpoint_Kind.SHARED_HTTP; + case 1: + case 'RANDOM_PORT': + return Endpoint_Kind.RANDOM_PORT; + case -1: + case 'UNRECOGNIZED': + default: + return Endpoint_Kind.UNRECOGNIZED; + } +} + +export function endpoint_KindToJSON(object: Endpoint_Kind): string { + switch (object) { + case Endpoint_Kind.SHARED_HTTP: + return 'SHARED_HTTP'; + case Endpoint_Kind.RANDOM_PORT: + return 'RANDOM_PORT'; + case Endpoint_Kind.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseEndpoint(): Endpoint { + return { $type: 'akash.base.v1beta1.Endpoint', kind: 0 }; +} + +export const Endpoint = { + $type: 'akash.base.v1beta1.Endpoint' as const, + + encode( + message: Endpoint, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.kind !== 0) { + writer.uint32(8).int32(message.kind); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Endpoint { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEndpoint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.kind = reader.int32() as any; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Endpoint { + return { + $type: Endpoint.$type, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + }; + }, + + toJSON(message: Endpoint): unknown { + const obj: any = {}; + if (message.kind !== 0) { + obj.kind = endpoint_KindToJSON(message.kind); + } + return obj; + }, + + create, I>>(base?: I): Endpoint { + return Endpoint.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Endpoint { + const message = createBaseEndpoint(); + message.kind = object.kind ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Endpoint.$type, Endpoint); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta1/resource.ts b/ts/src/generated/akash/base/v1beta1/resource.ts new file mode 100644 index 00000000..c9dec621 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta1/resource.ts @@ -0,0 +1,494 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from './attribute'; +import { Endpoint } from './endpoint'; +import { ResourceValue } from './resourcevalue'; + +export const protobufPackage = 'akash.base.v1beta1'; + +/** CPU stores resource units and cpu config attributes */ +export interface CPU { + $type: 'akash.base.v1beta1.CPU'; + units: ResourceValue | undefined; + attributes: Attribute[]; +} + +/** Memory stores resource quantity and memory attributes */ +export interface Memory { + $type: 'akash.base.v1beta1.Memory'; + quantity: ResourceValue | undefined; + attributes: Attribute[]; +} + +/** Storage stores resource quantity and storage attributes */ +export interface Storage { + $type: 'akash.base.v1beta1.Storage'; + quantity: ResourceValue | undefined; + attributes: Attribute[]; +} + +/** + * ResourceUnits describes all available resources types for deployment/node etc + * if field is nil resource is not present in the given data-structure + */ +export interface ResourceUnits { + $type: 'akash.base.v1beta1.ResourceUnits'; + cpu: CPU | undefined; + memory: Memory | undefined; + storage: Storage | undefined; + endpoints: Endpoint[]; +} + +function createBaseCPU(): CPU { + return { $type: 'akash.base.v1beta1.CPU', units: undefined, attributes: [] }; +} + +export const CPU = { + $type: 'akash.base.v1beta1.CPU' as const, + + encode(message: CPU, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.units !== undefined) { + ResourceValue.encode(message.units, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CPU { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCPU(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.units = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CPU { + return { + $type: CPU.$type, + units: isSet(object.units) + ? ResourceValue.fromJSON(object.units) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: CPU): unknown { + const obj: any = {}; + if (message.units !== undefined) { + obj.units = ResourceValue.toJSON(message.units); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): CPU { + return CPU.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CPU { + const message = createBaseCPU(); + message.units = + object.units !== undefined && object.units !== null + ? ResourceValue.fromPartial(object.units) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CPU.$type, CPU); + +function createBaseMemory(): Memory { + return { + $type: 'akash.base.v1beta1.Memory', + quantity: undefined, + attributes: [], + }; +} + +export const Memory = { + $type: 'akash.base.v1beta1.Memory' as const, + + encode( + message: Memory, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.quantity !== undefined) { + ResourceValue.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Memory { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMemory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Memory { + return { + $type: Memory.$type, + quantity: isSet(object.quantity) + ? ResourceValue.fromJSON(object.quantity) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Memory): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourceValue.toJSON(message.quantity); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Memory { + return Memory.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Memory { + const message = createBaseMemory(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourceValue.fromPartial(object.quantity) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Memory.$type, Memory); + +function createBaseStorage(): Storage { + return { + $type: 'akash.base.v1beta1.Storage', + quantity: undefined, + attributes: [], + }; +} + +export const Storage = { + $type: 'akash.base.v1beta1.Storage' as const, + + encode( + message: Storage, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.quantity !== undefined) { + ResourceValue.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Storage { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Storage { + return { + $type: Storage.$type, + quantity: isSet(object.quantity) + ? ResourceValue.fromJSON(object.quantity) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Storage): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourceValue.toJSON(message.quantity); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Storage { + return Storage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Storage { + const message = createBaseStorage(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourceValue.fromPartial(object.quantity) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Storage.$type, Storage); + +function createBaseResourceUnits(): ResourceUnits { + return { + $type: 'akash.base.v1beta1.ResourceUnits', + cpu: undefined, + memory: undefined, + storage: undefined, + endpoints: [], + }; +} + +export const ResourceUnits = { + $type: 'akash.base.v1beta1.ResourceUnits' as const, + + encode( + message: ResourceUnits, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.cpu !== undefined) { + CPU.encode(message.cpu, writer.uint32(10).fork()).ldelim(); + } + if (message.memory !== undefined) { + Memory.encode(message.memory, writer.uint32(18).fork()).ldelim(); + } + if (message.storage !== undefined) { + Storage.encode(message.storage, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.endpoints) { + Endpoint.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceUnits { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceUnits(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.cpu = CPU.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.memory = Memory.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.storage = Storage.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.endpoints.push(Endpoint.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourceUnits { + return { + $type: ResourceUnits.$type, + cpu: isSet(object.cpu) ? CPU.fromJSON(object.cpu) : undefined, + memory: isSet(object.memory) ? Memory.fromJSON(object.memory) : undefined, + storage: isSet(object.storage) + ? Storage.fromJSON(object.storage) + : undefined, + endpoints: globalThis.Array.isArray(object?.endpoints) + ? object.endpoints.map((e: any) => Endpoint.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ResourceUnits): unknown { + const obj: any = {}; + if (message.cpu !== undefined) { + obj.cpu = CPU.toJSON(message.cpu); + } + if (message.memory !== undefined) { + obj.memory = Memory.toJSON(message.memory); + } + if (message.storage !== undefined) { + obj.storage = Storage.toJSON(message.storage); + } + if (message.endpoints?.length) { + obj.endpoints = message.endpoints.map((e) => Endpoint.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourceUnits { + return ResourceUnits.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourceUnits { + const message = createBaseResourceUnits(); + message.cpu = + object.cpu !== undefined && object.cpu !== null + ? CPU.fromPartial(object.cpu) + : undefined; + message.memory = + object.memory !== undefined && object.memory !== null + ? Memory.fromPartial(object.memory) + : undefined; + message.storage = + object.storage !== undefined && object.storage !== null + ? Storage.fromPartial(object.storage) + : undefined; + message.endpoints = + object.endpoints?.map((e) => Endpoint.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ResourceUnits.$type, ResourceUnits); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta1/resourcevalue.ts b/ts/src/generated/akash/base/v1beta1/resourcevalue.ts new file mode 100644 index 00000000..2ab2a681 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta1/resourcevalue.ts @@ -0,0 +1,146 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta1'; + +/** Unit stores cpu, memory and storage metrics */ +export interface ResourceValue { + $type: 'akash.base.v1beta1.ResourceValue'; + val: Uint8Array; +} + +function createBaseResourceValue(): ResourceValue { + return { $type: 'akash.base.v1beta1.ResourceValue', val: new Uint8Array(0) }; +} + +export const ResourceValue = { + $type: 'akash.base.v1beta1.ResourceValue' as const, + + encode( + message: ResourceValue, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.val.length !== 0) { + writer.uint32(10).bytes(message.val); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceValue { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.val = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourceValue { + return { + $type: ResourceValue.$type, + val: isSet(object.val) ? bytesFromBase64(object.val) : new Uint8Array(0), + }; + }, + + toJSON(message: ResourceValue): unknown { + const obj: any = {}; + if (message.val.length !== 0) { + obj.val = base64FromBytes(message.val); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourceValue { + return ResourceValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourceValue { + const message = createBaseResourceValue(); + message.val = object.val ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(ResourceValue.$type, ResourceValue); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta2/attribute.ts b/ts/src/generated/akash/base/v1beta2/attribute.ts new file mode 100644 index 00000000..9cf0c10a --- /dev/null +++ b/ts/src/generated/akash/base/v1beta2/attribute.ts @@ -0,0 +1,347 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta2'; + +/** Attribute represents key value pair */ +export interface Attribute { + $type: 'akash.base.v1beta2.Attribute'; + key: string; + value: string; +} + +/** + * SignedBy represents validation accounts that tenant expects signatures for provider attributes + * AllOf has precedence i.e. if there is at least one entry AnyOf is ignored regardless to how many + * entries there + * this behaviour to be discussed + */ +export interface SignedBy { + $type: 'akash.base.v1beta2.SignedBy'; + /** all_of all keys in this list must have signed attributes */ + allOf: string[]; + /** any_of at least of of the keys from the list must have signed attributes */ + anyOf: string[]; +} + +/** PlacementRequirements */ +export interface PlacementRequirements { + $type: 'akash.base.v1beta2.PlacementRequirements'; + /** SignedBy list of keys that tenants expect to have signatures from */ + signedBy: SignedBy | undefined; + /** Attribute list of attributes tenant expects from the provider */ + attributes: Attribute[]; +} + +function createBaseAttribute(): Attribute { + return { $type: 'akash.base.v1beta2.Attribute', key: '', value: '' }; +} + +export const Attribute = { + $type: 'akash.base.v1beta2.Attribute' as const, + + encode( + message: Attribute, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.key !== '') { + writer.uint32(10).string(message.key); + } + if (message.value !== '') { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Attribute { + return { + $type: Attribute.$type, + key: isSet(object.key) ? globalThis.String(object.key) : '', + value: isSet(object.value) ? globalThis.String(object.value) : '', + }; + }, + + toJSON(message: Attribute): unknown { + const obj: any = {}; + if (message.key !== '') { + obj.key = message.key; + } + if (message.value !== '') { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Attribute { + return Attribute.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Attribute { + const message = createBaseAttribute(); + message.key = object.key ?? ''; + message.value = object.value ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Attribute.$type, Attribute); + +function createBaseSignedBy(): SignedBy { + return { $type: 'akash.base.v1beta2.SignedBy', allOf: [], anyOf: [] }; +} + +export const SignedBy = { + $type: 'akash.base.v1beta2.SignedBy' as const, + + encode( + message: SignedBy, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.allOf) { + writer.uint32(10).string(v!); + } + for (const v of message.anyOf) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignedBy { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedBy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.allOf.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.anyOf.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): SignedBy { + return { + $type: SignedBy.$type, + allOf: globalThis.Array.isArray(object?.allOf) + ? object.allOf.map((e: any) => globalThis.String(e)) + : [], + anyOf: globalThis.Array.isArray(object?.anyOf) + ? object.anyOf.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: SignedBy): unknown { + const obj: any = {}; + if (message.allOf?.length) { + obj.allOf = message.allOf; + } + if (message.anyOf?.length) { + obj.anyOf = message.anyOf; + } + return obj; + }, + + create, I>>(base?: I): SignedBy { + return SignedBy.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SignedBy { + const message = createBaseSignedBy(); + message.allOf = object.allOf?.map((e) => e) || []; + message.anyOf = object.anyOf?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(SignedBy.$type, SignedBy); + +function createBasePlacementRequirements(): PlacementRequirements { + return { + $type: 'akash.base.v1beta2.PlacementRequirements', + signedBy: undefined, + attributes: [], + }; +} + +export const PlacementRequirements = { + $type: 'akash.base.v1beta2.PlacementRequirements' as const, + + encode( + message: PlacementRequirements, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signedBy !== undefined) { + SignedBy.encode(message.signedBy, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): PlacementRequirements { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlacementRequirements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.signedBy = SignedBy.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): PlacementRequirements { + return { + $type: PlacementRequirements.$type, + signedBy: isSet(object.signedBy) + ? SignedBy.fromJSON(object.signedBy) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: PlacementRequirements): unknown { + const obj: any = {}; + if (message.signedBy !== undefined) { + obj.signedBy = SignedBy.toJSON(message.signedBy); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): PlacementRequirements { + return PlacementRequirements.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): PlacementRequirements { + const message = createBasePlacementRequirements(); + message.signedBy = + object.signedBy !== undefined && object.signedBy !== null + ? SignedBy.fromPartial(object.signedBy) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(PlacementRequirements.$type, PlacementRequirements); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta2/endpoint.ts b/ts/src/generated/akash/base/v1beta2/endpoint.ts new file mode 100644 index 00000000..cb0ef190 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta2/endpoint.ts @@ -0,0 +1,178 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta2'; + +/** Endpoint describes a publicly accessible IP service */ +export interface Endpoint { + $type: 'akash.base.v1beta2.Endpoint'; + kind: Endpoint_Kind; + sequenceNumber: number; +} + +/** This describes how the endpoint is implemented when the lease is deployed */ +export enum Endpoint_Kind { + /** SHARED_HTTP - Describes an endpoint that becomes a Kubernetes Ingress */ + SHARED_HTTP = 0, + /** RANDOM_PORT - Describes an endpoint that becomes a Kubernetes NodePort */ + RANDOM_PORT = 1, + /** LEASED_IP - Describes an endpoint that becomes a leased IP */ + LEASED_IP = 2, + UNRECOGNIZED = -1, +} + +export function endpoint_KindFromJSON(object: any): Endpoint_Kind { + switch (object) { + case 0: + case 'SHARED_HTTP': + return Endpoint_Kind.SHARED_HTTP; + case 1: + case 'RANDOM_PORT': + return Endpoint_Kind.RANDOM_PORT; + case 2: + case 'LEASED_IP': + return Endpoint_Kind.LEASED_IP; + case -1: + case 'UNRECOGNIZED': + default: + return Endpoint_Kind.UNRECOGNIZED; + } +} + +export function endpoint_KindToJSON(object: Endpoint_Kind): string { + switch (object) { + case Endpoint_Kind.SHARED_HTTP: + return 'SHARED_HTTP'; + case Endpoint_Kind.RANDOM_PORT: + return 'RANDOM_PORT'; + case Endpoint_Kind.LEASED_IP: + return 'LEASED_IP'; + case Endpoint_Kind.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseEndpoint(): Endpoint { + return { $type: 'akash.base.v1beta2.Endpoint', kind: 0, sequenceNumber: 0 }; +} + +export const Endpoint = { + $type: 'akash.base.v1beta2.Endpoint' as const, + + encode( + message: Endpoint, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.kind !== 0) { + writer.uint32(8).int32(message.kind); + } + if (message.sequenceNumber !== 0) { + writer.uint32(16).uint32(message.sequenceNumber); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Endpoint { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEndpoint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.kind = reader.int32() as any; + continue; + case 2: + if (tag !== 16) { + break; + } + + message.sequenceNumber = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Endpoint { + return { + $type: Endpoint.$type, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + sequenceNumber: isSet(object.sequenceNumber) + ? globalThis.Number(object.sequenceNumber) + : 0, + }; + }, + + toJSON(message: Endpoint): unknown { + const obj: any = {}; + if (message.kind !== 0) { + obj.kind = endpoint_KindToJSON(message.kind); + } + if (message.sequenceNumber !== 0) { + obj.sequenceNumber = Math.round(message.sequenceNumber); + } + return obj; + }, + + create, I>>(base?: I): Endpoint { + return Endpoint.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Endpoint { + const message = createBaseEndpoint(); + message.kind = object.kind ?? 0; + message.sequenceNumber = object.sequenceNumber ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Endpoint.$type, Endpoint); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta2/resource.ts b/ts/src/generated/akash/base/v1beta2/resource.ts new file mode 100644 index 00000000..2448f8b4 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta2/resource.ts @@ -0,0 +1,361 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from './attribute'; +import { ResourceValue } from './resourcevalue'; + +export const protobufPackage = 'akash.base.v1beta2'; + +/** CPU stores resource units and cpu config attributes */ +export interface CPU { + $type: 'akash.base.v1beta2.CPU'; + units: ResourceValue | undefined; + attributes: Attribute[]; +} + +/** Memory stores resource quantity and memory attributes */ +export interface Memory { + $type: 'akash.base.v1beta2.Memory'; + quantity: ResourceValue | undefined; + attributes: Attribute[]; +} + +/** Storage stores resource quantity and storage attributes */ +export interface Storage { + $type: 'akash.base.v1beta2.Storage'; + name: string; + quantity: ResourceValue | undefined; + attributes: Attribute[]; +} + +function createBaseCPU(): CPU { + return { $type: 'akash.base.v1beta2.CPU', units: undefined, attributes: [] }; +} + +export const CPU = { + $type: 'akash.base.v1beta2.CPU' as const, + + encode(message: CPU, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.units !== undefined) { + ResourceValue.encode(message.units, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CPU { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCPU(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.units = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CPU { + return { + $type: CPU.$type, + units: isSet(object.units) + ? ResourceValue.fromJSON(object.units) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: CPU): unknown { + const obj: any = {}; + if (message.units !== undefined) { + obj.units = ResourceValue.toJSON(message.units); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): CPU { + return CPU.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CPU { + const message = createBaseCPU(); + message.units = + object.units !== undefined && object.units !== null + ? ResourceValue.fromPartial(object.units) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CPU.$type, CPU); + +function createBaseMemory(): Memory { + return { + $type: 'akash.base.v1beta2.Memory', + quantity: undefined, + attributes: [], + }; +} + +export const Memory = { + $type: 'akash.base.v1beta2.Memory' as const, + + encode( + message: Memory, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.quantity !== undefined) { + ResourceValue.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Memory { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMemory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Memory { + return { + $type: Memory.$type, + quantity: isSet(object.quantity) + ? ResourceValue.fromJSON(object.quantity) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Memory): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourceValue.toJSON(message.quantity); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Memory { + return Memory.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Memory { + const message = createBaseMemory(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourceValue.fromPartial(object.quantity) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Memory.$type, Memory); + +function createBaseStorage(): Storage { + return { + $type: 'akash.base.v1beta2.Storage', + name: '', + quantity: undefined, + attributes: [], + }; +} + +export const Storage = { + $type: 'akash.base.v1beta2.Storage' as const, + + encode( + message: Storage, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.quantity !== undefined) { + ResourceValue.encode(message.quantity, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Storage { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.quantity = ResourceValue.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Storage { + return { + $type: Storage.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + quantity: isSet(object.quantity) + ? ResourceValue.fromJSON(object.quantity) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Storage): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.quantity !== undefined) { + obj.quantity = ResourceValue.toJSON(message.quantity); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Storage { + return Storage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Storage { + const message = createBaseStorage(); + message.name = object.name ?? ''; + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourceValue.fromPartial(object.quantity) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Storage.$type, Storage); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta2/resourceunits.ts b/ts/src/generated/akash/base/v1beta2/resourceunits.ts new file mode 100644 index 00000000..72bb091e --- /dev/null +++ b/ts/src/generated/akash/base/v1beta2/resourceunits.ts @@ -0,0 +1,191 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Endpoint } from './endpoint'; +import { CPU, Memory, Storage } from './resource'; + +export const protobufPackage = 'akash.base.v1beta2'; + +/** + * ResourceUnits describes all available resources types for deployment/node etc + * if field is nil resource is not present in the given data-structure + */ +export interface ResourceUnits { + $type: 'akash.base.v1beta2.ResourceUnits'; + cpu: CPU | undefined; + memory: Memory | undefined; + storage: Storage[]; + endpoints: Endpoint[]; +} + +function createBaseResourceUnits(): ResourceUnits { + return { + $type: 'akash.base.v1beta2.ResourceUnits', + cpu: undefined, + memory: undefined, + storage: [], + endpoints: [], + }; +} + +export const ResourceUnits = { + $type: 'akash.base.v1beta2.ResourceUnits' as const, + + encode( + message: ResourceUnits, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.cpu !== undefined) { + CPU.encode(message.cpu, writer.uint32(10).fork()).ldelim(); + } + if (message.memory !== undefined) { + Memory.encode(message.memory, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.storage) { + Storage.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.endpoints) { + Endpoint.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceUnits { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceUnits(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.cpu = CPU.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.memory = Memory.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.storage.push(Storage.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.endpoints.push(Endpoint.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourceUnits { + return { + $type: ResourceUnits.$type, + cpu: isSet(object.cpu) ? CPU.fromJSON(object.cpu) : undefined, + memory: isSet(object.memory) ? Memory.fromJSON(object.memory) : undefined, + storage: globalThis.Array.isArray(object?.storage) + ? object.storage.map((e: any) => Storage.fromJSON(e)) + : [], + endpoints: globalThis.Array.isArray(object?.endpoints) + ? object.endpoints.map((e: any) => Endpoint.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ResourceUnits): unknown { + const obj: any = {}; + if (message.cpu !== undefined) { + obj.cpu = CPU.toJSON(message.cpu); + } + if (message.memory !== undefined) { + obj.memory = Memory.toJSON(message.memory); + } + if (message.storage?.length) { + obj.storage = message.storage.map((e) => Storage.toJSON(e)); + } + if (message.endpoints?.length) { + obj.endpoints = message.endpoints.map((e) => Endpoint.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourceUnits { + return ResourceUnits.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourceUnits { + const message = createBaseResourceUnits(); + message.cpu = + object.cpu !== undefined && object.cpu !== null + ? CPU.fromPartial(object.cpu) + : undefined; + message.memory = + object.memory !== undefined && object.memory !== null + ? Memory.fromPartial(object.memory) + : undefined; + message.storage = object.storage?.map((e) => Storage.fromPartial(e)) || []; + message.endpoints = + object.endpoints?.map((e) => Endpoint.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ResourceUnits.$type, ResourceUnits); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta2/resourcevalue.ts b/ts/src/generated/akash/base/v1beta2/resourcevalue.ts new file mode 100644 index 00000000..b719b165 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta2/resourcevalue.ts @@ -0,0 +1,146 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta2'; + +/** Unit stores cpu, memory and storage metrics */ +export interface ResourceValue { + $type: 'akash.base.v1beta2.ResourceValue'; + val: Uint8Array; +} + +function createBaseResourceValue(): ResourceValue { + return { $type: 'akash.base.v1beta2.ResourceValue', val: new Uint8Array(0) }; +} + +export const ResourceValue = { + $type: 'akash.base.v1beta2.ResourceValue' as const, + + encode( + message: ResourceValue, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.val.length !== 0) { + writer.uint32(10).bytes(message.val); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceValue { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.val = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourceValue { + return { + $type: ResourceValue.$type, + val: isSet(object.val) ? bytesFromBase64(object.val) : new Uint8Array(0), + }; + }, + + toJSON(message: ResourceValue): unknown { + const obj: any = {}; + if (message.val.length !== 0) { + obj.val = base64FromBytes(message.val); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourceValue { + return ResourceValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourceValue { + const message = createBaseResourceValue(); + message.val = object.val ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(ResourceValue.$type, ResourceValue); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/attribute.ts b/ts/src/generated/akash/base/v1beta3/attribute.ts new file mode 100644 index 00000000..b3ec6baa --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/attribute.ts @@ -0,0 +1,347 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** Attribute represents key value pair */ +export interface Attribute { + $type: 'akash.base.v1beta3.Attribute'; + key: string; + value: string; +} + +/** + * SignedBy represents validation accounts that tenant expects signatures for provider attributes + * AllOf has precedence i.e. if there is at least one entry AnyOf is ignored regardless to how many + * entries there + * this behaviour to be discussed + */ +export interface SignedBy { + $type: 'akash.base.v1beta3.SignedBy'; + /** all_of all keys in this list must have signed attributes */ + allOf: string[]; + /** any_of at least of of the keys from the list must have signed attributes */ + anyOf: string[]; +} + +/** PlacementRequirements */ +export interface PlacementRequirements { + $type: 'akash.base.v1beta3.PlacementRequirements'; + /** SignedBy list of keys that tenants expect to have signatures from */ + signedBy: SignedBy | undefined; + /** Attribute list of attributes tenant expects from the provider */ + attributes: Attribute[]; +} + +function createBaseAttribute(): Attribute { + return { $type: 'akash.base.v1beta3.Attribute', key: '', value: '' }; +} + +export const Attribute = { + $type: 'akash.base.v1beta3.Attribute' as const, + + encode( + message: Attribute, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.key !== '') { + writer.uint32(10).string(message.key); + } + if (message.value !== '') { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Attribute { + return { + $type: Attribute.$type, + key: isSet(object.key) ? globalThis.String(object.key) : '', + value: isSet(object.value) ? globalThis.String(object.value) : '', + }; + }, + + toJSON(message: Attribute): unknown { + const obj: any = {}; + if (message.key !== '') { + obj.key = message.key; + } + if (message.value !== '') { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Attribute { + return Attribute.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Attribute { + const message = createBaseAttribute(); + message.key = object.key ?? ''; + message.value = object.value ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Attribute.$type, Attribute); + +function createBaseSignedBy(): SignedBy { + return { $type: 'akash.base.v1beta3.SignedBy', allOf: [], anyOf: [] }; +} + +export const SignedBy = { + $type: 'akash.base.v1beta3.SignedBy' as const, + + encode( + message: SignedBy, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.allOf) { + writer.uint32(10).string(v!); + } + for (const v of message.anyOf) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignedBy { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedBy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.allOf.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.anyOf.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): SignedBy { + return { + $type: SignedBy.$type, + allOf: globalThis.Array.isArray(object?.allOf) + ? object.allOf.map((e: any) => globalThis.String(e)) + : [], + anyOf: globalThis.Array.isArray(object?.anyOf) + ? object.anyOf.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: SignedBy): unknown { + const obj: any = {}; + if (message.allOf?.length) { + obj.allOf = message.allOf; + } + if (message.anyOf?.length) { + obj.anyOf = message.anyOf; + } + return obj; + }, + + create, I>>(base?: I): SignedBy { + return SignedBy.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SignedBy { + const message = createBaseSignedBy(); + message.allOf = object.allOf?.map((e) => e) || []; + message.anyOf = object.anyOf?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(SignedBy.$type, SignedBy); + +function createBasePlacementRequirements(): PlacementRequirements { + return { + $type: 'akash.base.v1beta3.PlacementRequirements', + signedBy: undefined, + attributes: [], + }; +} + +export const PlacementRequirements = { + $type: 'akash.base.v1beta3.PlacementRequirements' as const, + + encode( + message: PlacementRequirements, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signedBy !== undefined) { + SignedBy.encode(message.signedBy, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): PlacementRequirements { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlacementRequirements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.signedBy = SignedBy.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): PlacementRequirements { + return { + $type: PlacementRequirements.$type, + signedBy: isSet(object.signedBy) + ? SignedBy.fromJSON(object.signedBy) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: PlacementRequirements): unknown { + const obj: any = {}; + if (message.signedBy !== undefined) { + obj.signedBy = SignedBy.toJSON(message.signedBy); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): PlacementRequirements { + return PlacementRequirements.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): PlacementRequirements { + const message = createBasePlacementRequirements(); + message.signedBy = + object.signedBy !== undefined && object.signedBy !== null + ? SignedBy.fromPartial(object.signedBy) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(PlacementRequirements.$type, PlacementRequirements); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/cpu.ts b/ts/src/generated/akash/base/v1beta3/cpu.ts new file mode 100644 index 00000000..3d31cc49 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/cpu.ts @@ -0,0 +1,140 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from './attribute'; +import { ResourceValue } from './resourcevalue'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** CPU stores resource units and cpu config attributes */ +export interface CPU { + $type: 'akash.base.v1beta3.CPU'; + units: ResourceValue | undefined; + attributes: Attribute[]; +} + +function createBaseCPU(): CPU { + return { $type: 'akash.base.v1beta3.CPU', units: undefined, attributes: [] }; +} + +export const CPU = { + $type: 'akash.base.v1beta3.CPU' as const, + + encode(message: CPU, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.units !== undefined) { + ResourceValue.encode(message.units, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CPU { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCPU(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.units = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CPU { + return { + $type: CPU.$type, + units: isSet(object.units) + ? ResourceValue.fromJSON(object.units) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: CPU): unknown { + const obj: any = {}; + if (message.units !== undefined) { + obj.units = ResourceValue.toJSON(message.units); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): CPU { + return CPU.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CPU { + const message = createBaseCPU(); + message.units = + object.units !== undefined && object.units !== null + ? ResourceValue.fromPartial(object.units) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CPU.$type, CPU); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/endpoint.ts b/ts/src/generated/akash/base/v1beta3/endpoint.ts new file mode 100644 index 00000000..1310d2f0 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/endpoint.ts @@ -0,0 +1,178 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** Endpoint describes a publicly accessible IP service */ +export interface Endpoint { + $type: 'akash.base.v1beta3.Endpoint'; + kind: Endpoint_Kind; + sequenceNumber: number; +} + +/** This describes how the endpoint is implemented when the lease is deployed */ +export enum Endpoint_Kind { + /** SHARED_HTTP - Describes an endpoint that becomes a Kubernetes Ingress */ + SHARED_HTTP = 0, + /** RANDOM_PORT - Describes an endpoint that becomes a Kubernetes NodePort */ + RANDOM_PORT = 1, + /** LEASED_IP - Describes an endpoint that becomes a leased IP */ + LEASED_IP = 2, + UNRECOGNIZED = -1, +} + +export function endpoint_KindFromJSON(object: any): Endpoint_Kind { + switch (object) { + case 0: + case 'SHARED_HTTP': + return Endpoint_Kind.SHARED_HTTP; + case 1: + case 'RANDOM_PORT': + return Endpoint_Kind.RANDOM_PORT; + case 2: + case 'LEASED_IP': + return Endpoint_Kind.LEASED_IP; + case -1: + case 'UNRECOGNIZED': + default: + return Endpoint_Kind.UNRECOGNIZED; + } +} + +export function endpoint_KindToJSON(object: Endpoint_Kind): string { + switch (object) { + case Endpoint_Kind.SHARED_HTTP: + return 'SHARED_HTTP'; + case Endpoint_Kind.RANDOM_PORT: + return 'RANDOM_PORT'; + case Endpoint_Kind.LEASED_IP: + return 'LEASED_IP'; + case Endpoint_Kind.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseEndpoint(): Endpoint { + return { $type: 'akash.base.v1beta3.Endpoint', kind: 0, sequenceNumber: 0 }; +} + +export const Endpoint = { + $type: 'akash.base.v1beta3.Endpoint' as const, + + encode( + message: Endpoint, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.kind !== 0) { + writer.uint32(8).int32(message.kind); + } + if (message.sequenceNumber !== 0) { + writer.uint32(16).uint32(message.sequenceNumber); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Endpoint { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEndpoint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.kind = reader.int32() as any; + continue; + case 2: + if (tag !== 16) { + break; + } + + message.sequenceNumber = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Endpoint { + return { + $type: Endpoint.$type, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + sequenceNumber: isSet(object.sequenceNumber) + ? globalThis.Number(object.sequenceNumber) + : 0, + }; + }, + + toJSON(message: Endpoint): unknown { + const obj: any = {}; + if (message.kind !== 0) { + obj.kind = endpoint_KindToJSON(message.kind); + } + if (message.sequenceNumber !== 0) { + obj.sequenceNumber = Math.round(message.sequenceNumber); + } + return obj; + }, + + create, I>>(base?: I): Endpoint { + return Endpoint.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Endpoint { + const message = createBaseEndpoint(); + message.kind = object.kind ?? 0; + message.sequenceNumber = object.sequenceNumber ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Endpoint.$type, Endpoint); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/gpu.ts b/ts/src/generated/akash/base/v1beta3/gpu.ts new file mode 100644 index 00000000..c4d9b279 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/gpu.ts @@ -0,0 +1,140 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from './attribute'; +import { ResourceValue } from './resourcevalue'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** GPU stores resource units and cpu config attributes */ +export interface GPU { + $type: 'akash.base.v1beta3.GPU'; + units: ResourceValue | undefined; + attributes: Attribute[]; +} + +function createBaseGPU(): GPU { + return { $type: 'akash.base.v1beta3.GPU', units: undefined, attributes: [] }; +} + +export const GPU = { + $type: 'akash.base.v1beta3.GPU' as const, + + encode(message: GPU, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.units !== undefined) { + ResourceValue.encode(message.units, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GPU { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGPU(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.units = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GPU { + return { + $type: GPU.$type, + units: isSet(object.units) + ? ResourceValue.fromJSON(object.units) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GPU): unknown { + const obj: any = {}; + if (message.units !== undefined) { + obj.units = ResourceValue.toJSON(message.units); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): GPU { + return GPU.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GPU { + const message = createBaseGPU(); + message.units = + object.units !== undefined && object.units !== null + ? ResourceValue.fromPartial(object.units) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GPU.$type, GPU); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/memory.ts b/ts/src/generated/akash/base/v1beta3/memory.ts new file mode 100644 index 00000000..6ee7cc78 --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/memory.ts @@ -0,0 +1,147 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from './attribute'; +import { ResourceValue } from './resourcevalue'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** Memory stores resource quantity and memory attributes */ +export interface Memory { + $type: 'akash.base.v1beta3.Memory'; + quantity: ResourceValue | undefined; + attributes: Attribute[]; +} + +function createBaseMemory(): Memory { + return { + $type: 'akash.base.v1beta3.Memory', + quantity: undefined, + attributes: [], + }; +} + +export const Memory = { + $type: 'akash.base.v1beta3.Memory' as const, + + encode( + message: Memory, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.quantity !== undefined) { + ResourceValue.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Memory { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMemory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourceValue.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Memory { + return { + $type: Memory.$type, + quantity: isSet(object.quantity) + ? ResourceValue.fromJSON(object.quantity) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Memory): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourceValue.toJSON(message.quantity); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Memory { + return Memory.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Memory { + const message = createBaseMemory(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourceValue.fromPartial(object.quantity) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Memory.$type, Memory); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/resources.ts b/ts/src/generated/akash/base/v1beta3/resources.ts new file mode 100644 index 00000000..a470ebfb --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/resources.ts @@ -0,0 +1,229 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { CPU } from './cpu'; +import { Endpoint } from './endpoint'; +import { GPU } from './gpu'; +import { Memory } from './memory'; +import { Storage } from './storage'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** + * Resources describes all available resources types for deployment/node etc + * if field is nil resource is not present in the given data-structure + */ +export interface Resources { + $type: 'akash.base.v1beta3.Resources'; + id: number; + cpu: CPU | undefined; + memory: Memory | undefined; + storage: Storage[]; + gpu: GPU | undefined; + endpoints: Endpoint[]; +} + +function createBaseResources(): Resources { + return { + $type: 'akash.base.v1beta3.Resources', + id: 0, + cpu: undefined, + memory: undefined, + storage: [], + gpu: undefined, + endpoints: [], + }; +} + +export const Resources = { + $type: 'akash.base.v1beta3.Resources' as const, + + encode( + message: Resources, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.cpu !== undefined) { + CPU.encode(message.cpu, writer.uint32(18).fork()).ldelim(); + } + if (message.memory !== undefined) { + Memory.encode(message.memory, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.storage) { + Storage.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.gpu !== undefined) { + GPU.encode(message.gpu, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.endpoints) { + Endpoint.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Resources { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResources(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.uint32(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.cpu = CPU.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.memory = Memory.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.storage.push(Storage.decode(reader, reader.uint32())); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.gpu = GPU.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.endpoints.push(Endpoint.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Resources { + return { + $type: Resources.$type, + id: isSet(object.id) ? globalThis.Number(object.id) : 0, + cpu: isSet(object.cpu) ? CPU.fromJSON(object.cpu) : undefined, + memory: isSet(object.memory) ? Memory.fromJSON(object.memory) : undefined, + storage: globalThis.Array.isArray(object?.storage) + ? object.storage.map((e: any) => Storage.fromJSON(e)) + : [], + gpu: isSet(object.gpu) ? GPU.fromJSON(object.gpu) : undefined, + endpoints: globalThis.Array.isArray(object?.endpoints) + ? object.endpoints.map((e: any) => Endpoint.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Resources): unknown { + const obj: any = {}; + if (message.id !== 0) { + obj.id = Math.round(message.id); + } + if (message.cpu !== undefined) { + obj.cpu = CPU.toJSON(message.cpu); + } + if (message.memory !== undefined) { + obj.memory = Memory.toJSON(message.memory); + } + if (message.storage?.length) { + obj.storage = message.storage.map((e) => Storage.toJSON(e)); + } + if (message.gpu !== undefined) { + obj.gpu = GPU.toJSON(message.gpu); + } + if (message.endpoints?.length) { + obj.endpoints = message.endpoints.map((e) => Endpoint.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Resources { + return Resources.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Resources { + const message = createBaseResources(); + message.id = object.id ?? 0; + message.cpu = + object.cpu !== undefined && object.cpu !== null + ? CPU.fromPartial(object.cpu) + : undefined; + message.memory = + object.memory !== undefined && object.memory !== null + ? Memory.fromPartial(object.memory) + : undefined; + message.storage = object.storage?.map((e) => Storage.fromPartial(e)) || []; + message.gpu = + object.gpu !== undefined && object.gpu !== null + ? GPU.fromPartial(object.gpu) + : undefined; + message.endpoints = + object.endpoints?.map((e) => Endpoint.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Resources.$type, Resources); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/resourcevalue.ts b/ts/src/generated/akash/base/v1beta3/resourcevalue.ts new file mode 100644 index 00000000..edb83f2e --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/resourcevalue.ts @@ -0,0 +1,146 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** Unit stores cpu, memory and storage metrics */ +export interface ResourceValue { + $type: 'akash.base.v1beta3.ResourceValue'; + val: Uint8Array; +} + +function createBaseResourceValue(): ResourceValue { + return { $type: 'akash.base.v1beta3.ResourceValue', val: new Uint8Array(0) }; +} + +export const ResourceValue = { + $type: 'akash.base.v1beta3.ResourceValue' as const, + + encode( + message: ResourceValue, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.val.length !== 0) { + writer.uint32(10).bytes(message.val); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceValue { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.val = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourceValue { + return { + $type: ResourceValue.$type, + val: isSet(object.val) ? bytesFromBase64(object.val) : new Uint8Array(0), + }; + }, + + toJSON(message: ResourceValue): unknown { + const obj: any = {}; + if (message.val.length !== 0) { + obj.val = base64FromBytes(message.val); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourceValue { + return ResourceValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourceValue { + const message = createBaseResourceValue(); + message.val = object.val ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(ResourceValue.$type, ResourceValue); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/base/v1beta3/storage.ts b/ts/src/generated/akash/base/v1beta3/storage.ts new file mode 100644 index 00000000..88acdc3e --- /dev/null +++ b/ts/src/generated/akash/base/v1beta3/storage.ts @@ -0,0 +1,164 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from './attribute'; +import { ResourceValue } from './resourcevalue'; + +export const protobufPackage = 'akash.base.v1beta3'; + +/** Storage stores resource quantity and storage attributes */ +export interface Storage { + $type: 'akash.base.v1beta3.Storage'; + name: string; + quantity: ResourceValue | undefined; + attributes: Attribute[]; +} + +function createBaseStorage(): Storage { + return { + $type: 'akash.base.v1beta3.Storage', + name: '', + quantity: undefined, + attributes: [], + }; +} + +export const Storage = { + $type: 'akash.base.v1beta3.Storage' as const, + + encode( + message: Storage, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.quantity !== undefined) { + ResourceValue.encode(message.quantity, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Storage { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.quantity = ResourceValue.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Storage { + return { + $type: Storage.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + quantity: isSet(object.quantity) + ? ResourceValue.fromJSON(object.quantity) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Storage): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.quantity !== undefined) { + obj.quantity = ResourceValue.toJSON(message.quantity); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Storage { + return Storage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Storage { + const message = createBaseStorage(); + message.name = object.name ?? ''; + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourceValue.fromPartial(object.quantity) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Storage.$type, Storage); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/cert/v1beta2/cert.ts b/ts/src/generated/akash/cert/v1beta2/cert.ts new file mode 100644 index 00000000..d336d8a2 --- /dev/null +++ b/ts/src/generated/akash/cert/v1beta2/cert.ts @@ -0,0 +1,826 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.cert.v1beta2'; + +/** CertificateID stores owner and sequence number */ +export interface CertificateID { + $type: 'akash.cert.v1beta2.CertificateID'; + owner: string; + serial: string; +} + +/** Certificate stores state, certificate and it's public key */ +export interface Certificate { + $type: 'akash.cert.v1beta2.Certificate'; + state: Certificate_State; + cert: Uint8Array; + pubkey: Uint8Array; +} + +/** State is an enum which refers to state of deployment */ +export enum Certificate_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** valid - CertificateValid denotes state for deployment active */ + valid = 1, + /** revoked - CertificateRevoked denotes state for deployment closed */ + revoked = 2, + UNRECOGNIZED = -1, +} + +export function certificate_StateFromJSON(object: any): Certificate_State { + switch (object) { + case 0: + case 'invalid': + return Certificate_State.invalid; + case 1: + case 'valid': + return Certificate_State.valid; + case 2: + case 'revoked': + return Certificate_State.revoked; + case -1: + case 'UNRECOGNIZED': + default: + return Certificate_State.UNRECOGNIZED; + } +} + +export function certificate_StateToJSON(object: Certificate_State): string { + switch (object) { + case Certificate_State.invalid: + return 'invalid'; + case Certificate_State.valid: + return 'valid'; + case Certificate_State.revoked: + return 'revoked'; + case Certificate_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** CertificateFilter defines filters used to filter certificates */ +export interface CertificateFilter { + $type: 'akash.cert.v1beta2.CertificateFilter'; + owner: string; + serial: string; + state: string; +} + +/** MsgCreateCertificate defines an SDK message for creating certificate */ +export interface MsgCreateCertificate { + $type: 'akash.cert.v1beta2.MsgCreateCertificate'; + owner: string; + cert: Uint8Array; + pubkey: Uint8Array; +} + +/** MsgCreateCertificateResponse defines the Msg/CreateCertificate response type. */ +export interface MsgCreateCertificateResponse { + $type: 'akash.cert.v1beta2.MsgCreateCertificateResponse'; +} + +/** MsgRevokeCertificate defines an SDK message for revoking certificate */ +export interface MsgRevokeCertificate { + $type: 'akash.cert.v1beta2.MsgRevokeCertificate'; + id: CertificateID | undefined; +} + +/** MsgRevokeCertificateResponse defines the Msg/RevokeCertificate response type. */ +export interface MsgRevokeCertificateResponse { + $type: 'akash.cert.v1beta2.MsgRevokeCertificateResponse'; +} + +function createBaseCertificateID(): CertificateID { + return { $type: 'akash.cert.v1beta2.CertificateID', owner: '', serial: '' }; +} + +export const CertificateID = { + $type: 'akash.cert.v1beta2.CertificateID' as const, + + encode( + message: CertificateID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.serial !== '') { + writer.uint32(18).string(message.serial); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CertificateID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificateID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.serial = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CertificateID { + return { + $type: CertificateID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + serial: isSet(object.serial) ? globalThis.String(object.serial) : '', + }; + }, + + toJSON(message: CertificateID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.serial !== '') { + obj.serial = message.serial; + } + return obj; + }, + + create, I>>( + base?: I, + ): CertificateID { + return CertificateID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CertificateID { + const message = createBaseCertificateID(); + message.owner = object.owner ?? ''; + message.serial = object.serial ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(CertificateID.$type, CertificateID); + +function createBaseCertificate(): Certificate { + return { + $type: 'akash.cert.v1beta2.Certificate', + state: 0, + cert: new Uint8Array(0), + pubkey: new Uint8Array(0), + }; +} + +export const Certificate = { + $type: 'akash.cert.v1beta2.Certificate' as const, + + encode( + message: Certificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.cert.length !== 0) { + writer.uint32(26).bytes(message.cert); + } + if (message.pubkey.length !== 0) { + writer.uint32(34).bytes(message.pubkey); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Certificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.cert = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.pubkey = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Certificate { + return { + $type: Certificate.$type, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + cert: isSet(object.cert) + ? bytesFromBase64(object.cert) + : new Uint8Array(0), + pubkey: isSet(object.pubkey) + ? bytesFromBase64(object.pubkey) + : new Uint8Array(0), + }; + }, + + toJSON(message: Certificate): unknown { + const obj: any = {}; + if (message.state !== 0) { + obj.state = certificate_StateToJSON(message.state); + } + if (message.cert.length !== 0) { + obj.cert = base64FromBytes(message.cert); + } + if (message.pubkey.length !== 0) { + obj.pubkey = base64FromBytes(message.pubkey); + } + return obj; + }, + + create, I>>(base?: I): Certificate { + return Certificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Certificate { + const message = createBaseCertificate(); + message.state = object.state ?? 0; + message.cert = object.cert ?? new Uint8Array(0); + message.pubkey = object.pubkey ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(Certificate.$type, Certificate); + +function createBaseCertificateFilter(): CertificateFilter { + return { + $type: 'akash.cert.v1beta2.CertificateFilter', + owner: '', + serial: '', + state: '', + }; +} + +export const CertificateFilter = { + $type: 'akash.cert.v1beta2.CertificateFilter' as const, + + encode( + message: CertificateFilter, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.serial !== '') { + writer.uint32(18).string(message.serial); + } + if (message.state !== '') { + writer.uint32(26).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CertificateFilter { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificateFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.serial = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CertificateFilter { + return { + $type: CertificateFilter.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + serial: isSet(object.serial) ? globalThis.String(object.serial) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: CertificateFilter): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.serial !== '') { + obj.serial = message.serial; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): CertificateFilter { + return CertificateFilter.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CertificateFilter { + const message = createBaseCertificateFilter(); + message.owner = object.owner ?? ''; + message.serial = object.serial ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(CertificateFilter.$type, CertificateFilter); + +function createBaseMsgCreateCertificate(): MsgCreateCertificate { + return { + $type: 'akash.cert.v1beta2.MsgCreateCertificate', + owner: '', + cert: new Uint8Array(0), + pubkey: new Uint8Array(0), + }; +} + +export const MsgCreateCertificate = { + $type: 'akash.cert.v1beta2.MsgCreateCertificate' as const, + + encode( + message: MsgCreateCertificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.cert.length !== 0) { + writer.uint32(18).bytes(message.cert); + } + if (message.pubkey.length !== 0) { + writer.uint32(26).bytes(message.pubkey); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateCertificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.cert = reader.bytes(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.pubkey = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateCertificate { + return { + $type: MsgCreateCertificate.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + cert: isSet(object.cert) + ? bytesFromBase64(object.cert) + : new Uint8Array(0), + pubkey: isSet(object.pubkey) + ? bytesFromBase64(object.pubkey) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgCreateCertificate): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.cert.length !== 0) { + obj.cert = base64FromBytes(message.cert); + } + if (message.pubkey.length !== 0) { + obj.pubkey = base64FromBytes(message.pubkey); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateCertificate { + return MsgCreateCertificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateCertificate { + const message = createBaseMsgCreateCertificate(); + message.owner = object.owner ?? ''; + message.cert = object.cert ?? new Uint8Array(0); + message.pubkey = object.pubkey ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateCertificate.$type, MsgCreateCertificate); + +function createBaseMsgCreateCertificateResponse(): MsgCreateCertificateResponse { + return { $type: 'akash.cert.v1beta2.MsgCreateCertificateResponse' }; +} + +export const MsgCreateCertificateResponse = { + $type: 'akash.cert.v1beta2.MsgCreateCertificateResponse' as const, + + encode( + _: MsgCreateCertificateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateCertificateResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateCertificateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateCertificateResponse { + return { $type: MsgCreateCertificateResponse.$type }; + }, + + toJSON(_: MsgCreateCertificateResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateCertificateResponse { + return MsgCreateCertificateResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateCertificateResponse { + const message = createBaseMsgCreateCertificateResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateCertificateResponse.$type, + MsgCreateCertificateResponse, +); + +function createBaseMsgRevokeCertificate(): MsgRevokeCertificate { + return { $type: 'akash.cert.v1beta2.MsgRevokeCertificate', id: undefined }; +} + +export const MsgRevokeCertificate = { + $type: 'akash.cert.v1beta2.MsgRevokeCertificate' as const, + + encode( + message: MsgRevokeCertificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + CertificateID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgRevokeCertificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = CertificateID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgRevokeCertificate { + return { + $type: MsgRevokeCertificate.$type, + id: isSet(object.id) ? CertificateID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgRevokeCertificate): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = CertificateID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgRevokeCertificate { + return MsgRevokeCertificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgRevokeCertificate { + const message = createBaseMsgRevokeCertificate(); + message.id = + object.id !== undefined && object.id !== null + ? CertificateID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgRevokeCertificate.$type, MsgRevokeCertificate); + +function createBaseMsgRevokeCertificateResponse(): MsgRevokeCertificateResponse { + return { $type: 'akash.cert.v1beta2.MsgRevokeCertificateResponse' }; +} + +export const MsgRevokeCertificateResponse = { + $type: 'akash.cert.v1beta2.MsgRevokeCertificateResponse' as const, + + encode( + _: MsgRevokeCertificateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgRevokeCertificateResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeCertificateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgRevokeCertificateResponse { + return { $type: MsgRevokeCertificateResponse.$type }; + }, + + toJSON(_: MsgRevokeCertificateResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgRevokeCertificateResponse { + return MsgRevokeCertificateResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgRevokeCertificateResponse { + const message = createBaseMsgRevokeCertificateResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgRevokeCertificateResponse.$type, + MsgRevokeCertificateResponse, +); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** CreateCertificate defines a method to create new certificate given proper inputs. */ + CreateCertificate( + request: MsgCreateCertificate, + ): Promise; + /** RevokeCertificate defines a method to revoke the certificate */ + RevokeCertificate( + request: MsgRevokeCertificate, + ): Promise; +} + +export const MsgServiceName = 'akash.cert.v1beta2.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateCertificate = this.CreateCertificate.bind(this); + this.RevokeCertificate = this.RevokeCertificate.bind(this); + } + CreateCertificate( + request: MsgCreateCertificate, + ): Promise { + const data = MsgCreateCertificate.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateCertificate', data); + return promise.then((data) => + MsgCreateCertificateResponse.decode(_m0.Reader.create(data)), + ); + } + + RevokeCertificate( + request: MsgRevokeCertificate, + ): Promise { + const data = MsgRevokeCertificate.encode(request).finish(); + const promise = this.rpc.request(this.service, 'RevokeCertificate', data); + return promise.then((data) => + MsgRevokeCertificateResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/cert/v1beta2/genesis.ts b/ts/src/generated/akash/cert/v1beta2/genesis.ts new file mode 100644 index 00000000..e33c4799 --- /dev/null +++ b/ts/src/generated/akash/cert/v1beta2/genesis.ts @@ -0,0 +1,235 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Certificate } from './cert'; + +export const protobufPackage = 'akash.cert.v1beta2'; + +/** GenesisCertificate defines certificate entry at genesis */ +export interface GenesisCertificate { + $type: 'akash.cert.v1beta2.GenesisCertificate'; + owner: string; + certificate: Certificate | undefined; +} + +/** GenesisState defines the basic genesis state used by cert module */ +export interface GenesisState { + $type: 'akash.cert.v1beta2.GenesisState'; + certificates: GenesisCertificate[]; +} + +function createBaseGenesisCertificate(): GenesisCertificate { + return { + $type: 'akash.cert.v1beta2.GenesisCertificate', + owner: '', + certificate: undefined, + }; +} + +export const GenesisCertificate = { + $type: 'akash.cert.v1beta2.GenesisCertificate' as const, + + encode( + message: GenesisCertificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.certificate !== undefined) { + Certificate.encode( + message.certificate, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisCertificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.certificate = Certificate.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisCertificate { + return { + $type: GenesisCertificate.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + certificate: isSet(object.certificate) + ? Certificate.fromJSON(object.certificate) + : undefined, + }; + }, + + toJSON(message: GenesisCertificate): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.certificate !== undefined) { + obj.certificate = Certificate.toJSON(message.certificate); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisCertificate { + return GenesisCertificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisCertificate { + const message = createBaseGenesisCertificate(); + message.owner = object.owner ?? ''; + message.certificate = + object.certificate !== undefined && object.certificate !== null + ? Certificate.fromPartial(object.certificate) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisCertificate.$type, GenesisCertificate); + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.cert.v1beta2.GenesisState', certificates: [] }; +} + +export const GenesisState = { + $type: 'akash.cert.v1beta2.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.certificates) { + GenesisCertificate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.certificates.push( + GenesisCertificate.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + certificates: globalThis.Array.isArray(object?.certificates) + ? object.certificates.map((e: any) => GenesisCertificate.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.certificates?.length) { + obj.certificates = message.certificates.map((e) => + GenesisCertificate.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.certificates = + object.certificates?.map((e) => GenesisCertificate.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/cert/v1beta2/query.ts b/ts/src/generated/akash/cert/v1beta2/query.ts new file mode 100644 index 00000000..59d7c9a4 --- /dev/null +++ b/ts/src/generated/akash/cert/v1beta2/query.ts @@ -0,0 +1,426 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Certificate, CertificateFilter } from './cert'; + +export const protobufPackage = 'akash.cert.v1beta2'; + +/** CertificateResponse contains a single X509 certificate and its serial number */ +export interface CertificateResponse { + $type: 'akash.cert.v1beta2.CertificateResponse'; + certificate: Certificate | undefined; + serial: string; +} + +/** QueryDeploymentsRequest is request type for the Query/Deployments RPC method */ +export interface QueryCertificatesRequest { + $type: 'akash.cert.v1beta2.QueryCertificatesRequest'; + filter: CertificateFilter | undefined; + pagination: PageRequest | undefined; +} + +/** QueryCertificatesResponse is response type for the Query/Certificates RPC method */ +export interface QueryCertificatesResponse { + $type: 'akash.cert.v1beta2.QueryCertificatesResponse'; + certificates: CertificateResponse[]; + pagination: PageResponse | undefined; +} + +function createBaseCertificateResponse(): CertificateResponse { + return { + $type: 'akash.cert.v1beta2.CertificateResponse', + certificate: undefined, + serial: '', + }; +} + +export const CertificateResponse = { + $type: 'akash.cert.v1beta2.CertificateResponse' as const, + + encode( + message: CertificateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.certificate !== undefined) { + Certificate.encode( + message.certificate, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.serial !== '') { + writer.uint32(18).string(message.serial); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CertificateResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.certificate = Certificate.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.serial = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CertificateResponse { + return { + $type: CertificateResponse.$type, + certificate: isSet(object.certificate) + ? Certificate.fromJSON(object.certificate) + : undefined, + serial: isSet(object.serial) ? globalThis.String(object.serial) : '', + }; + }, + + toJSON(message: CertificateResponse): unknown { + const obj: any = {}; + if (message.certificate !== undefined) { + obj.certificate = Certificate.toJSON(message.certificate); + } + if (message.serial !== '') { + obj.serial = message.serial; + } + return obj; + }, + + create, I>>( + base?: I, + ): CertificateResponse { + return CertificateResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CertificateResponse { + const message = createBaseCertificateResponse(); + message.certificate = + object.certificate !== undefined && object.certificate !== null + ? Certificate.fromPartial(object.certificate) + : undefined; + message.serial = object.serial ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(CertificateResponse.$type, CertificateResponse); + +function createBaseQueryCertificatesRequest(): QueryCertificatesRequest { + return { + $type: 'akash.cert.v1beta2.QueryCertificatesRequest', + filter: undefined, + pagination: undefined, + }; +} + +export const QueryCertificatesRequest = { + $type: 'akash.cert.v1beta2.QueryCertificatesRequest' as const, + + encode( + message: QueryCertificatesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filter !== undefined) { + CertificateFilter.encode( + message.filter, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryCertificatesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCertificatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filter = CertificateFilter.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryCertificatesRequest { + return { + $type: QueryCertificatesRequest.$type, + filter: isSet(object.filter) + ? CertificateFilter.fromJSON(object.filter) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryCertificatesRequest): unknown { + const obj: any = {}; + if (message.filter !== undefined) { + obj.filter = CertificateFilter.toJSON(message.filter); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryCertificatesRequest { + return QueryCertificatesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryCertificatesRequest { + const message = createBaseQueryCertificatesRequest(); + message.filter = + object.filter !== undefined && object.filter !== null + ? CertificateFilter.fromPartial(object.filter) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryCertificatesRequest.$type, + QueryCertificatesRequest, +); + +function createBaseQueryCertificatesResponse(): QueryCertificatesResponse { + return { + $type: 'akash.cert.v1beta2.QueryCertificatesResponse', + certificates: [], + pagination: undefined, + }; +} + +export const QueryCertificatesResponse = { + $type: 'akash.cert.v1beta2.QueryCertificatesResponse' as const, + + encode( + message: QueryCertificatesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.certificates) { + CertificateResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryCertificatesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCertificatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.certificates.push( + CertificateResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryCertificatesResponse { + return { + $type: QueryCertificatesResponse.$type, + certificates: globalThis.Array.isArray(object?.certificates) + ? object.certificates.map((e: any) => CertificateResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryCertificatesResponse): unknown { + const obj: any = {}; + if (message.certificates?.length) { + obj.certificates = message.certificates.map((e) => + CertificateResponse.toJSON(e), + ); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryCertificatesResponse { + return QueryCertificatesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryCertificatesResponse { + const message = createBaseQueryCertificatesResponse(); + message.certificates = + object.certificates?.map((e) => CertificateResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryCertificatesResponse.$type, + QueryCertificatesResponse, +); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Certificates queries certificates */ + Certificates( + request: QueryCertificatesRequest, + ): Promise; +} + +export const QueryServiceName = 'akash.cert.v1beta2.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Certificates = this.Certificates.bind(this); + } + Certificates( + request: QueryCertificatesRequest, + ): Promise { + const data = QueryCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Certificates', data); + return promise.then((data) => + QueryCertificatesResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/cert/v1beta3/cert.ts b/ts/src/generated/akash/cert/v1beta3/cert.ts new file mode 100644 index 00000000..01de9985 --- /dev/null +++ b/ts/src/generated/akash/cert/v1beta3/cert.ts @@ -0,0 +1,826 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.cert.v1beta3'; + +/** CertificateID stores owner and sequence number */ +export interface CertificateID { + $type: 'akash.cert.v1beta3.CertificateID'; + owner: string; + serial: string; +} + +/** Certificate stores state, certificate and it's public key */ +export interface Certificate { + $type: 'akash.cert.v1beta3.Certificate'; + state: Certificate_State; + cert: Uint8Array; + pubkey: Uint8Array; +} + +/** State is an enum which refers to state of deployment */ +export enum Certificate_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** valid - CertificateValid denotes state for deployment active */ + valid = 1, + /** revoked - CertificateRevoked denotes state for deployment closed */ + revoked = 2, + UNRECOGNIZED = -1, +} + +export function certificate_StateFromJSON(object: any): Certificate_State { + switch (object) { + case 0: + case 'invalid': + return Certificate_State.invalid; + case 1: + case 'valid': + return Certificate_State.valid; + case 2: + case 'revoked': + return Certificate_State.revoked; + case -1: + case 'UNRECOGNIZED': + default: + return Certificate_State.UNRECOGNIZED; + } +} + +export function certificate_StateToJSON(object: Certificate_State): string { + switch (object) { + case Certificate_State.invalid: + return 'invalid'; + case Certificate_State.valid: + return 'valid'; + case Certificate_State.revoked: + return 'revoked'; + case Certificate_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** CertificateFilter defines filters used to filter certificates */ +export interface CertificateFilter { + $type: 'akash.cert.v1beta3.CertificateFilter'; + owner: string; + serial: string; + state: string; +} + +/** MsgCreateCertificate defines an SDK message for creating certificate */ +export interface MsgCreateCertificate { + $type: 'akash.cert.v1beta3.MsgCreateCertificate'; + owner: string; + cert: Uint8Array; + pubkey: Uint8Array; +} + +/** MsgCreateCertificateResponse defines the Msg/CreateCertificate response type. */ +export interface MsgCreateCertificateResponse { + $type: 'akash.cert.v1beta3.MsgCreateCertificateResponse'; +} + +/** MsgRevokeCertificate defines an SDK message for revoking certificate */ +export interface MsgRevokeCertificate { + $type: 'akash.cert.v1beta3.MsgRevokeCertificate'; + id: CertificateID | undefined; +} + +/** MsgRevokeCertificateResponse defines the Msg/RevokeCertificate response type. */ +export interface MsgRevokeCertificateResponse { + $type: 'akash.cert.v1beta3.MsgRevokeCertificateResponse'; +} + +function createBaseCertificateID(): CertificateID { + return { $type: 'akash.cert.v1beta3.CertificateID', owner: '', serial: '' }; +} + +export const CertificateID = { + $type: 'akash.cert.v1beta3.CertificateID' as const, + + encode( + message: CertificateID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.serial !== '') { + writer.uint32(18).string(message.serial); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CertificateID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificateID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.serial = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CertificateID { + return { + $type: CertificateID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + serial: isSet(object.serial) ? globalThis.String(object.serial) : '', + }; + }, + + toJSON(message: CertificateID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.serial !== '') { + obj.serial = message.serial; + } + return obj; + }, + + create, I>>( + base?: I, + ): CertificateID { + return CertificateID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CertificateID { + const message = createBaseCertificateID(); + message.owner = object.owner ?? ''; + message.serial = object.serial ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(CertificateID.$type, CertificateID); + +function createBaseCertificate(): Certificate { + return { + $type: 'akash.cert.v1beta3.Certificate', + state: 0, + cert: new Uint8Array(0), + pubkey: new Uint8Array(0), + }; +} + +export const Certificate = { + $type: 'akash.cert.v1beta3.Certificate' as const, + + encode( + message: Certificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.cert.length !== 0) { + writer.uint32(26).bytes(message.cert); + } + if (message.pubkey.length !== 0) { + writer.uint32(34).bytes(message.pubkey); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Certificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.cert = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.pubkey = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Certificate { + return { + $type: Certificate.$type, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + cert: isSet(object.cert) + ? bytesFromBase64(object.cert) + : new Uint8Array(0), + pubkey: isSet(object.pubkey) + ? bytesFromBase64(object.pubkey) + : new Uint8Array(0), + }; + }, + + toJSON(message: Certificate): unknown { + const obj: any = {}; + if (message.state !== 0) { + obj.state = certificate_StateToJSON(message.state); + } + if (message.cert.length !== 0) { + obj.cert = base64FromBytes(message.cert); + } + if (message.pubkey.length !== 0) { + obj.pubkey = base64FromBytes(message.pubkey); + } + return obj; + }, + + create, I>>(base?: I): Certificate { + return Certificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Certificate { + const message = createBaseCertificate(); + message.state = object.state ?? 0; + message.cert = object.cert ?? new Uint8Array(0); + message.pubkey = object.pubkey ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(Certificate.$type, Certificate); + +function createBaseCertificateFilter(): CertificateFilter { + return { + $type: 'akash.cert.v1beta3.CertificateFilter', + owner: '', + serial: '', + state: '', + }; +} + +export const CertificateFilter = { + $type: 'akash.cert.v1beta3.CertificateFilter' as const, + + encode( + message: CertificateFilter, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.serial !== '') { + writer.uint32(18).string(message.serial); + } + if (message.state !== '') { + writer.uint32(26).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CertificateFilter { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificateFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.serial = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CertificateFilter { + return { + $type: CertificateFilter.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + serial: isSet(object.serial) ? globalThis.String(object.serial) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: CertificateFilter): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.serial !== '') { + obj.serial = message.serial; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): CertificateFilter { + return CertificateFilter.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CertificateFilter { + const message = createBaseCertificateFilter(); + message.owner = object.owner ?? ''; + message.serial = object.serial ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(CertificateFilter.$type, CertificateFilter); + +function createBaseMsgCreateCertificate(): MsgCreateCertificate { + return { + $type: 'akash.cert.v1beta3.MsgCreateCertificate', + owner: '', + cert: new Uint8Array(0), + pubkey: new Uint8Array(0), + }; +} + +export const MsgCreateCertificate = { + $type: 'akash.cert.v1beta3.MsgCreateCertificate' as const, + + encode( + message: MsgCreateCertificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.cert.length !== 0) { + writer.uint32(18).bytes(message.cert); + } + if (message.pubkey.length !== 0) { + writer.uint32(26).bytes(message.pubkey); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateCertificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.cert = reader.bytes(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.pubkey = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateCertificate { + return { + $type: MsgCreateCertificate.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + cert: isSet(object.cert) + ? bytesFromBase64(object.cert) + : new Uint8Array(0), + pubkey: isSet(object.pubkey) + ? bytesFromBase64(object.pubkey) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgCreateCertificate): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.cert.length !== 0) { + obj.cert = base64FromBytes(message.cert); + } + if (message.pubkey.length !== 0) { + obj.pubkey = base64FromBytes(message.pubkey); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateCertificate { + return MsgCreateCertificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateCertificate { + const message = createBaseMsgCreateCertificate(); + message.owner = object.owner ?? ''; + message.cert = object.cert ?? new Uint8Array(0); + message.pubkey = object.pubkey ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateCertificate.$type, MsgCreateCertificate); + +function createBaseMsgCreateCertificateResponse(): MsgCreateCertificateResponse { + return { $type: 'akash.cert.v1beta3.MsgCreateCertificateResponse' }; +} + +export const MsgCreateCertificateResponse = { + $type: 'akash.cert.v1beta3.MsgCreateCertificateResponse' as const, + + encode( + _: MsgCreateCertificateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateCertificateResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateCertificateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateCertificateResponse { + return { $type: MsgCreateCertificateResponse.$type }; + }, + + toJSON(_: MsgCreateCertificateResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateCertificateResponse { + return MsgCreateCertificateResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateCertificateResponse { + const message = createBaseMsgCreateCertificateResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateCertificateResponse.$type, + MsgCreateCertificateResponse, +); + +function createBaseMsgRevokeCertificate(): MsgRevokeCertificate { + return { $type: 'akash.cert.v1beta3.MsgRevokeCertificate', id: undefined }; +} + +export const MsgRevokeCertificate = { + $type: 'akash.cert.v1beta3.MsgRevokeCertificate' as const, + + encode( + message: MsgRevokeCertificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + CertificateID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgRevokeCertificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = CertificateID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgRevokeCertificate { + return { + $type: MsgRevokeCertificate.$type, + id: isSet(object.id) ? CertificateID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgRevokeCertificate): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = CertificateID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgRevokeCertificate { + return MsgRevokeCertificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgRevokeCertificate { + const message = createBaseMsgRevokeCertificate(); + message.id = + object.id !== undefined && object.id !== null + ? CertificateID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgRevokeCertificate.$type, MsgRevokeCertificate); + +function createBaseMsgRevokeCertificateResponse(): MsgRevokeCertificateResponse { + return { $type: 'akash.cert.v1beta3.MsgRevokeCertificateResponse' }; +} + +export const MsgRevokeCertificateResponse = { + $type: 'akash.cert.v1beta3.MsgRevokeCertificateResponse' as const, + + encode( + _: MsgRevokeCertificateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgRevokeCertificateResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeCertificateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgRevokeCertificateResponse { + return { $type: MsgRevokeCertificateResponse.$type }; + }, + + toJSON(_: MsgRevokeCertificateResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgRevokeCertificateResponse { + return MsgRevokeCertificateResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgRevokeCertificateResponse { + const message = createBaseMsgRevokeCertificateResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgRevokeCertificateResponse.$type, + MsgRevokeCertificateResponse, +); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** CreateCertificate defines a method to create new certificate given proper inputs. */ + CreateCertificate( + request: MsgCreateCertificate, + ): Promise; + /** RevokeCertificate defines a method to revoke the certificate */ + RevokeCertificate( + request: MsgRevokeCertificate, + ): Promise; +} + +export const MsgServiceName = 'akash.cert.v1beta3.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateCertificate = this.CreateCertificate.bind(this); + this.RevokeCertificate = this.RevokeCertificate.bind(this); + } + CreateCertificate( + request: MsgCreateCertificate, + ): Promise { + const data = MsgCreateCertificate.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateCertificate', data); + return promise.then((data) => + MsgCreateCertificateResponse.decode(_m0.Reader.create(data)), + ); + } + + RevokeCertificate( + request: MsgRevokeCertificate, + ): Promise { + const data = MsgRevokeCertificate.encode(request).finish(); + const promise = this.rpc.request(this.service, 'RevokeCertificate', data); + return promise.then((data) => + MsgRevokeCertificateResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/cert/v1beta3/genesis.ts b/ts/src/generated/akash/cert/v1beta3/genesis.ts new file mode 100644 index 00000000..1fedc248 --- /dev/null +++ b/ts/src/generated/akash/cert/v1beta3/genesis.ts @@ -0,0 +1,235 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Certificate } from './cert'; + +export const protobufPackage = 'akash.cert.v1beta3'; + +/** GenesisCertificate defines certificate entry at genesis */ +export interface GenesisCertificate { + $type: 'akash.cert.v1beta3.GenesisCertificate'; + owner: string; + certificate: Certificate | undefined; +} + +/** GenesisState defines the basic genesis state used by cert module */ +export interface GenesisState { + $type: 'akash.cert.v1beta3.GenesisState'; + certificates: GenesisCertificate[]; +} + +function createBaseGenesisCertificate(): GenesisCertificate { + return { + $type: 'akash.cert.v1beta3.GenesisCertificate', + owner: '', + certificate: undefined, + }; +} + +export const GenesisCertificate = { + $type: 'akash.cert.v1beta3.GenesisCertificate' as const, + + encode( + message: GenesisCertificate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.certificate !== undefined) { + Certificate.encode( + message.certificate, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisCertificate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisCertificate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.certificate = Certificate.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisCertificate { + return { + $type: GenesisCertificate.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + certificate: isSet(object.certificate) + ? Certificate.fromJSON(object.certificate) + : undefined, + }; + }, + + toJSON(message: GenesisCertificate): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.certificate !== undefined) { + obj.certificate = Certificate.toJSON(message.certificate); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisCertificate { + return GenesisCertificate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisCertificate { + const message = createBaseGenesisCertificate(); + message.owner = object.owner ?? ''; + message.certificate = + object.certificate !== undefined && object.certificate !== null + ? Certificate.fromPartial(object.certificate) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisCertificate.$type, GenesisCertificate); + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.cert.v1beta3.GenesisState', certificates: [] }; +} + +export const GenesisState = { + $type: 'akash.cert.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.certificates) { + GenesisCertificate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.certificates.push( + GenesisCertificate.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + certificates: globalThis.Array.isArray(object?.certificates) + ? object.certificates.map((e: any) => GenesisCertificate.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.certificates?.length) { + obj.certificates = message.certificates.map((e) => + GenesisCertificate.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.certificates = + object.certificates?.map((e) => GenesisCertificate.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/cert/v1beta3/query.ts b/ts/src/generated/akash/cert/v1beta3/query.ts new file mode 100644 index 00000000..4dd25116 --- /dev/null +++ b/ts/src/generated/akash/cert/v1beta3/query.ts @@ -0,0 +1,426 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Certificate, CertificateFilter } from './cert'; + +export const protobufPackage = 'akash.cert.v1beta3'; + +/** CertificateResponse contains a single X509 certificate and its serial number */ +export interface CertificateResponse { + $type: 'akash.cert.v1beta3.CertificateResponse'; + certificate: Certificate | undefined; + serial: string; +} + +/** QueryDeploymentsRequest is request type for the Query/Deployments RPC method */ +export interface QueryCertificatesRequest { + $type: 'akash.cert.v1beta3.QueryCertificatesRequest'; + filter: CertificateFilter | undefined; + pagination: PageRequest | undefined; +} + +/** QueryCertificatesResponse is response type for the Query/Certificates RPC method */ +export interface QueryCertificatesResponse { + $type: 'akash.cert.v1beta3.QueryCertificatesResponse'; + certificates: CertificateResponse[]; + pagination: PageResponse | undefined; +} + +function createBaseCertificateResponse(): CertificateResponse { + return { + $type: 'akash.cert.v1beta3.CertificateResponse', + certificate: undefined, + serial: '', + }; +} + +export const CertificateResponse = { + $type: 'akash.cert.v1beta3.CertificateResponse' as const, + + encode( + message: CertificateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.certificate !== undefined) { + Certificate.encode( + message.certificate, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.serial !== '') { + writer.uint32(18).string(message.serial); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CertificateResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCertificateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.certificate = Certificate.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.serial = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CertificateResponse { + return { + $type: CertificateResponse.$type, + certificate: isSet(object.certificate) + ? Certificate.fromJSON(object.certificate) + : undefined, + serial: isSet(object.serial) ? globalThis.String(object.serial) : '', + }; + }, + + toJSON(message: CertificateResponse): unknown { + const obj: any = {}; + if (message.certificate !== undefined) { + obj.certificate = Certificate.toJSON(message.certificate); + } + if (message.serial !== '') { + obj.serial = message.serial; + } + return obj; + }, + + create, I>>( + base?: I, + ): CertificateResponse { + return CertificateResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CertificateResponse { + const message = createBaseCertificateResponse(); + message.certificate = + object.certificate !== undefined && object.certificate !== null + ? Certificate.fromPartial(object.certificate) + : undefined; + message.serial = object.serial ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(CertificateResponse.$type, CertificateResponse); + +function createBaseQueryCertificatesRequest(): QueryCertificatesRequest { + return { + $type: 'akash.cert.v1beta3.QueryCertificatesRequest', + filter: undefined, + pagination: undefined, + }; +} + +export const QueryCertificatesRequest = { + $type: 'akash.cert.v1beta3.QueryCertificatesRequest' as const, + + encode( + message: QueryCertificatesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filter !== undefined) { + CertificateFilter.encode( + message.filter, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryCertificatesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCertificatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filter = CertificateFilter.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryCertificatesRequest { + return { + $type: QueryCertificatesRequest.$type, + filter: isSet(object.filter) + ? CertificateFilter.fromJSON(object.filter) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryCertificatesRequest): unknown { + const obj: any = {}; + if (message.filter !== undefined) { + obj.filter = CertificateFilter.toJSON(message.filter); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryCertificatesRequest { + return QueryCertificatesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryCertificatesRequest { + const message = createBaseQueryCertificatesRequest(); + message.filter = + object.filter !== undefined && object.filter !== null + ? CertificateFilter.fromPartial(object.filter) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryCertificatesRequest.$type, + QueryCertificatesRequest, +); + +function createBaseQueryCertificatesResponse(): QueryCertificatesResponse { + return { + $type: 'akash.cert.v1beta3.QueryCertificatesResponse', + certificates: [], + pagination: undefined, + }; +} + +export const QueryCertificatesResponse = { + $type: 'akash.cert.v1beta3.QueryCertificatesResponse' as const, + + encode( + message: QueryCertificatesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.certificates) { + CertificateResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryCertificatesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCertificatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.certificates.push( + CertificateResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryCertificatesResponse { + return { + $type: QueryCertificatesResponse.$type, + certificates: globalThis.Array.isArray(object?.certificates) + ? object.certificates.map((e: any) => CertificateResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryCertificatesResponse): unknown { + const obj: any = {}; + if (message.certificates?.length) { + obj.certificates = message.certificates.map((e) => + CertificateResponse.toJSON(e), + ); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryCertificatesResponse { + return QueryCertificatesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryCertificatesResponse { + const message = createBaseQueryCertificatesResponse(); + message.certificates = + object.certificates?.map((e) => CertificateResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryCertificatesResponse.$type, + QueryCertificatesResponse, +); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Certificates queries certificates */ + Certificates( + request: QueryCertificatesRequest, + ): Promise; +} + +export const QueryServiceName = 'akash.cert.v1beta3.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Certificates = this.Certificates.bind(this); + } + Certificates( + request: QueryCertificatesRequest, + ): Promise { + const data = QueryCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Certificates', data); + return promise.then((data) => + QueryCertificatesResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta1/authz.ts b/ts/src/generated/akash/deployment/v1beta1/authz.ts new file mode 100644 index 00000000..304ef2ea --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta1/authz.ts @@ -0,0 +1,143 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta1'; + +/** + * DepositDeploymentAuthorization allows the grantee to deposit up to spend_limit coins from + * the granter's account for a deployment. + */ +export interface DepositDeploymentAuthorization { + $type: 'akash.deployment.v1beta1.DepositDeploymentAuthorization'; + /** + * SpendLimit is the amount the grantee is authorized to spend from the granter's account for + * the purpose of deployment. + */ + spendLimit: Coin | undefined; +} + +function createBaseDepositDeploymentAuthorization(): DepositDeploymentAuthorization { + return { + $type: 'akash.deployment.v1beta1.DepositDeploymentAuthorization', + spendLimit: undefined, + }; +} + +export const DepositDeploymentAuthorization = { + $type: 'akash.deployment.v1beta1.DepositDeploymentAuthorization' as const, + + encode( + message: DepositDeploymentAuthorization, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.spendLimit !== undefined) { + Coin.encode(message.spendLimit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): DepositDeploymentAuthorization { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositDeploymentAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.spendLimit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DepositDeploymentAuthorization { + return { + $type: DepositDeploymentAuthorization.$type, + spendLimit: isSet(object.spendLimit) + ? Coin.fromJSON(object.spendLimit) + : undefined, + }; + }, + + toJSON(message: DepositDeploymentAuthorization): unknown { + const obj: any = {}; + if (message.spendLimit !== undefined) { + obj.spendLimit = Coin.toJSON(message.spendLimit); + } + return obj; + }, + + create, I>>( + base?: I, + ): DepositDeploymentAuthorization { + return DepositDeploymentAuthorization.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DepositDeploymentAuthorization { + const message = createBaseDepositDeploymentAuthorization(); + message.spendLimit = + object.spendLimit !== undefined && object.spendLimit !== null + ? Coin.fromPartial(object.spendLimit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + DepositDeploymentAuthorization.$type, + DepositDeploymentAuthorization, +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta1/deployment.ts b/ts/src/generated/akash/deployment/v1beta1/deployment.ts new file mode 100644 index 00000000..9e47d336 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta1/deployment.ts @@ -0,0 +1,1320 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { + GroupSpec, + MsgCloseGroup, + MsgCloseGroupResponse, + MsgPauseGroup, + MsgPauseGroupResponse, + MsgStartGroup, + MsgStartGroupResponse, +} from './group'; + +export const protobufPackage = 'akash.deployment.v1beta1'; + +/** MsgCreateDeployment defines an SDK message for creating deployment */ +export interface MsgCreateDeployment { + $type: 'akash.deployment.v1beta1.MsgCreateDeployment'; + id: DeploymentID | undefined; + groups: GroupSpec[]; + version: Uint8Array; + deposit: Coin | undefined; +} + +/** MsgCreateDeploymentResponse defines the Msg/CreateDeployment response type. */ +export interface MsgCreateDeploymentResponse { + $type: 'akash.deployment.v1beta1.MsgCreateDeploymentResponse'; +} + +/** MsgDepositDeployment deposits more funds into the deposit account */ +export interface MsgDepositDeployment { + $type: 'akash.deployment.v1beta1.MsgDepositDeployment'; + id: DeploymentID | undefined; + amount: Coin | undefined; +} + +/** MsgCreateDeploymentResponse defines the Msg/CreateDeployment response type. */ +export interface MsgDepositDeploymentResponse { + $type: 'akash.deployment.v1beta1.MsgDepositDeploymentResponse'; +} + +/** MsgUpdateDeployment defines an SDK message for updating deployment */ +export interface MsgUpdateDeployment { + $type: 'akash.deployment.v1beta1.MsgUpdateDeployment'; + id: DeploymentID | undefined; + groups: GroupSpec[]; + version: Uint8Array; +} + +/** MsgUpdateDeploymentResponse defines the Msg/UpdateDeployment response type. */ +export interface MsgUpdateDeploymentResponse { + $type: 'akash.deployment.v1beta1.MsgUpdateDeploymentResponse'; +} + +/** MsgCloseDeployment defines an SDK message for closing deployment */ +export interface MsgCloseDeployment { + $type: 'akash.deployment.v1beta1.MsgCloseDeployment'; + id: DeploymentID | undefined; +} + +/** MsgCloseDeploymentResponse defines the Msg/CloseDeployment response type. */ +export interface MsgCloseDeploymentResponse { + $type: 'akash.deployment.v1beta1.MsgCloseDeploymentResponse'; +} + +/** DeploymentID stores owner and sequence number */ +export interface DeploymentID { + $type: 'akash.deployment.v1beta1.DeploymentID'; + owner: string; + dseq: Long; +} + +/** Deployment stores deploymentID, state and version details */ +export interface Deployment { + $type: 'akash.deployment.v1beta1.Deployment'; + deploymentId: DeploymentID | undefined; + state: Deployment_State; + version: Uint8Array; + createdAt: Long; +} + +/** State is an enum which refers to state of deployment */ +export enum Deployment_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** active - DeploymentActive denotes state for deployment active */ + active = 1, + /** closed - DeploymentClosed denotes state for deployment closed */ + closed = 2, + UNRECOGNIZED = -1, +} + +export function deployment_StateFromJSON(object: any): Deployment_State { + switch (object) { + case 0: + case 'invalid': + return Deployment_State.invalid; + case 1: + case 'active': + return Deployment_State.active; + case 2: + case 'closed': + return Deployment_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Deployment_State.UNRECOGNIZED; + } +} + +export function deployment_StateToJSON(object: Deployment_State): string { + switch (object) { + case Deployment_State.invalid: + return 'invalid'; + case Deployment_State.active: + return 'active'; + case Deployment_State.closed: + return 'closed'; + case Deployment_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** DeploymentFilters defines filters used to filter deployments */ +export interface DeploymentFilters { + $type: 'akash.deployment.v1beta1.DeploymentFilters'; + owner: string; + dseq: Long; + state: string; +} + +function createBaseMsgCreateDeployment(): MsgCreateDeployment { + return { + $type: 'akash.deployment.v1beta1.MsgCreateDeployment', + id: undefined, + groups: [], + version: new Uint8Array(0), + deposit: undefined, + }; +} + +export const MsgCreateDeployment = { + $type: 'akash.deployment.v1beta1.MsgCreateDeployment' as const, + + encode( + message: MsgCreateDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + GroupSpec.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(GroupSpec.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.deposit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateDeployment { + return { + $type: MsgCreateDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) + : [], + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + deposit: isSet(object.deposit) + ? Coin.fromJSON(object.deposit) + : undefined, + }; + }, + + toJSON(message: MsgCreateDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => GroupSpec.toJSON(e)); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + if (message.deposit !== undefined) { + obj.deposit = Coin.toJSON(message.deposit); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateDeployment { + return MsgCreateDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateDeployment { + const message = createBaseMsgCreateDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.groups = object.groups?.map((e) => GroupSpec.fromPartial(e)) || []; + message.version = object.version ?? new Uint8Array(0); + message.deposit = + object.deposit !== undefined && object.deposit !== null + ? Coin.fromPartial(object.deposit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateDeployment.$type, MsgCreateDeployment); + +function createBaseMsgCreateDeploymentResponse(): MsgCreateDeploymentResponse { + return { $type: 'akash.deployment.v1beta1.MsgCreateDeploymentResponse' }; +} + +export const MsgCreateDeploymentResponse = { + $type: 'akash.deployment.v1beta1.MsgCreateDeploymentResponse' as const, + + encode( + _: MsgCreateDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateDeploymentResponse { + return { $type: MsgCreateDeploymentResponse.$type }; + }, + + toJSON(_: MsgCreateDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateDeploymentResponse { + return MsgCreateDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateDeploymentResponse { + const message = createBaseMsgCreateDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateDeploymentResponse.$type, + MsgCreateDeploymentResponse, +); + +function createBaseMsgDepositDeployment(): MsgDepositDeployment { + return { + $type: 'akash.deployment.v1beta1.MsgDepositDeployment', + id: undefined, + amount: undefined, + }; +} + +export const MsgDepositDeployment = { + $type: 'akash.deployment.v1beta1.MsgDepositDeployment' as const, + + encode( + message: MsgDepositDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDepositDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.amount = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDepositDeployment { + return { + $type: MsgDepositDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + }; + }, + + toJSON(message: MsgDepositDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.amount !== undefined) { + obj.amount = Coin.toJSON(message.amount); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDepositDeployment { + return MsgDepositDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDepositDeployment { + const message = createBaseMsgDepositDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgDepositDeployment.$type, MsgDepositDeployment); + +function createBaseMsgDepositDeploymentResponse(): MsgDepositDeploymentResponse { + return { $type: 'akash.deployment.v1beta1.MsgDepositDeploymentResponse' }; +} + +export const MsgDepositDeploymentResponse = { + $type: 'akash.deployment.v1beta1.MsgDepositDeploymentResponse' as const, + + encode( + _: MsgDepositDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDepositDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDepositDeploymentResponse { + return { $type: MsgDepositDeploymentResponse.$type }; + }, + + toJSON(_: MsgDepositDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDepositDeploymentResponse { + return MsgDepositDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgDepositDeploymentResponse { + const message = createBaseMsgDepositDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDepositDeploymentResponse.$type, + MsgDepositDeploymentResponse, +); + +function createBaseMsgUpdateDeployment(): MsgUpdateDeployment { + return { + $type: 'akash.deployment.v1beta1.MsgUpdateDeployment', + id: undefined, + groups: [], + version: new Uint8Array(0), + }; +} + +export const MsgUpdateDeployment = { + $type: 'akash.deployment.v1beta1.MsgUpdateDeployment' as const, + + encode( + message: MsgUpdateDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + GroupSpec.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(GroupSpec.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateDeployment { + return { + $type: MsgUpdateDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) + : [], + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgUpdateDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => GroupSpec.toJSON(e)); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateDeployment { + return MsgUpdateDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgUpdateDeployment { + const message = createBaseMsgUpdateDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.groups = object.groups?.map((e) => GroupSpec.fromPartial(e)) || []; + message.version = object.version ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(MsgUpdateDeployment.$type, MsgUpdateDeployment); + +function createBaseMsgUpdateDeploymentResponse(): MsgUpdateDeploymentResponse { + return { $type: 'akash.deployment.v1beta1.MsgUpdateDeploymentResponse' }; +} + +export const MsgUpdateDeploymentResponse = { + $type: 'akash.deployment.v1beta1.MsgUpdateDeploymentResponse' as const, + + encode( + _: MsgUpdateDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdateDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateDeploymentResponse { + return { $type: MsgUpdateDeploymentResponse.$type }; + }, + + toJSON(_: MsgUpdateDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateDeploymentResponse { + return MsgUpdateDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateDeploymentResponse { + const message = createBaseMsgUpdateDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgUpdateDeploymentResponse.$type, + MsgUpdateDeploymentResponse, +); + +function createBaseMsgCloseDeployment(): MsgCloseDeployment { + return { + $type: 'akash.deployment.v1beta1.MsgCloseDeployment', + id: undefined, + }; +} + +export const MsgCloseDeployment = { + $type: 'akash.deployment.v1beta1.MsgCloseDeployment' as const, + + encode( + message: MsgCloseDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseDeployment { + return { + $type: MsgCloseDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgCloseDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseDeployment { + return MsgCloseDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseDeployment { + const message = createBaseMsgCloseDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseDeployment.$type, MsgCloseDeployment); + +function createBaseMsgCloseDeploymentResponse(): MsgCloseDeploymentResponse { + return { $type: 'akash.deployment.v1beta1.MsgCloseDeploymentResponse' }; +} + +export const MsgCloseDeploymentResponse = { + $type: 'akash.deployment.v1beta1.MsgCloseDeploymentResponse' as const, + + encode( + _: MsgCloseDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseDeploymentResponse { + return { $type: MsgCloseDeploymentResponse.$type }; + }, + + toJSON(_: MsgCloseDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseDeploymentResponse { + return MsgCloseDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseDeploymentResponse { + const message = createBaseMsgCloseDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCloseDeploymentResponse.$type, + MsgCloseDeploymentResponse, +); + +function createBaseDeploymentID(): DeploymentID { + return { + $type: 'akash.deployment.v1beta1.DeploymentID', + owner: '', + dseq: Long.UZERO, + }; +} + +export const DeploymentID = { + $type: 'akash.deployment.v1beta1.DeploymentID' as const, + + encode( + message: DeploymentID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeploymentID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeploymentID { + return { + $type: DeploymentID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + }; + }, + + toJSON(message: DeploymentID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>( + base?: I, + ): DeploymentID { + return DeploymentID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DeploymentID { + const message = createBaseDeploymentID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + return message; + }, +}; + +messageTypeRegistry.set(DeploymentID.$type, DeploymentID); + +function createBaseDeployment(): Deployment { + return { + $type: 'akash.deployment.v1beta1.Deployment', + deploymentId: undefined, + state: 0, + version: new Uint8Array(0), + createdAt: Long.ZERO, + }; +} + +export const Deployment = { + $type: 'akash.deployment.v1beta1.Deployment' as const, + + encode( + message: Deployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deploymentId !== undefined) { + DeploymentID.encode( + message.deploymentId, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Deployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deploymentId = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Deployment { + return { + $type: Deployment.$type, + deploymentId: isSet(object.deploymentId) + ? DeploymentID.fromJSON(object.deploymentId) + : undefined, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Deployment): unknown { + const obj: any = {}; + if (message.deploymentId !== undefined) { + obj.deploymentId = DeploymentID.toJSON(message.deploymentId); + } + if (message.state !== 0) { + obj.state = deployment_StateToJSON(message.state); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Deployment { + return Deployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Deployment { + const message = createBaseDeployment(); + message.deploymentId = + object.deploymentId !== undefined && object.deploymentId !== null + ? DeploymentID.fromPartial(object.deploymentId) + : undefined; + message.state = object.state ?? 0; + message.version = object.version ?? new Uint8Array(0); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Deployment.$type, Deployment); + +function createBaseDeploymentFilters(): DeploymentFilters { + return { + $type: 'akash.deployment.v1beta1.DeploymentFilters', + owner: '', + dseq: Long.UZERO, + state: '', + }; +} + +export const DeploymentFilters = { + $type: 'akash.deployment.v1beta1.DeploymentFilters' as const, + + encode( + message: DeploymentFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.state !== '') { + writer.uint32(26).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeploymentFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeploymentFilters { + return { + $type: DeploymentFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: DeploymentFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): DeploymentFilters { + return DeploymentFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DeploymentFilters { + const message = createBaseDeploymentFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(DeploymentFilters.$type, DeploymentFilters); + +/** Msg defines the deployment Msg service. */ +export interface Msg { + /** CreateDeployment defines a method to create new deployment given proper inputs. */ + CreateDeployment( + request: MsgCreateDeployment, + ): Promise; + /** DepositDeployment deposits more funds into the deployment account */ + DepositDeployment( + request: MsgDepositDeployment, + ): Promise; + /** UpdateDeployment defines a method to update a deployment given proper inputs. */ + UpdateDeployment( + request: MsgUpdateDeployment, + ): Promise; + /** CloseDeployment defines a method to close a deployment given proper inputs. */ + CloseDeployment( + request: MsgCloseDeployment, + ): Promise; + /** CloseGroup defines a method to close a group of a deployment given proper inputs. */ + CloseGroup(request: MsgCloseGroup): Promise; + /** PauseGroup defines a method to close a group of a deployment given proper inputs. */ + PauseGroup(request: MsgPauseGroup): Promise; + /** StartGroup defines a method to close a group of a deployment given proper inputs. */ + StartGroup(request: MsgStartGroup): Promise; +} + +export const MsgServiceName = 'akash.deployment.v1beta1.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateDeployment = this.CreateDeployment.bind(this); + this.DepositDeployment = this.DepositDeployment.bind(this); + this.UpdateDeployment = this.UpdateDeployment.bind(this); + this.CloseDeployment = this.CloseDeployment.bind(this); + this.CloseGroup = this.CloseGroup.bind(this); + this.PauseGroup = this.PauseGroup.bind(this); + this.StartGroup = this.StartGroup.bind(this); + } + CreateDeployment( + request: MsgCreateDeployment, + ): Promise { + const data = MsgCreateDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateDeployment', data); + return promise.then((data) => + MsgCreateDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + DepositDeployment( + request: MsgDepositDeployment, + ): Promise { + const data = MsgDepositDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'DepositDeployment', data); + return promise.then((data) => + MsgDepositDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + UpdateDeployment( + request: MsgUpdateDeployment, + ): Promise { + const data = MsgUpdateDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'UpdateDeployment', data); + return promise.then((data) => + MsgUpdateDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseDeployment( + request: MsgCloseDeployment, + ): Promise { + const data = MsgCloseDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseDeployment', data); + return promise.then((data) => + MsgCloseDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseGroup(request: MsgCloseGroup): Promise { + const data = MsgCloseGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseGroup', data); + return promise.then((data) => + MsgCloseGroupResponse.decode(_m0.Reader.create(data)), + ); + } + + PauseGroup(request: MsgPauseGroup): Promise { + const data = MsgPauseGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'PauseGroup', data); + return promise.then((data) => + MsgPauseGroupResponse.decode(_m0.Reader.create(data)), + ); + } + + StartGroup(request: MsgStartGroup): Promise { + const data = MsgStartGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'StartGroup', data); + return promise.then((data) => + MsgStartGroupResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta1/genesis.ts b/ts/src/generated/akash/deployment/v1beta1/genesis.ts new file mode 100644 index 00000000..e3db59eb --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta1/genesis.ts @@ -0,0 +1,259 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Deployment } from './deployment'; +import { Group } from './group'; +import { Params } from './params'; + +export const protobufPackage = 'akash.deployment.v1beta1'; + +/** GenesisDeployment defines the basic genesis state used by deployment module */ +export interface GenesisDeployment { + $type: 'akash.deployment.v1beta1.GenesisDeployment'; + deployment: Deployment | undefined; + groups: Group[]; +} + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.deployment.v1beta1.GenesisState'; + deployments: GenesisDeployment[]; + params: Params | undefined; +} + +function createBaseGenesisDeployment(): GenesisDeployment { + return { + $type: 'akash.deployment.v1beta1.GenesisDeployment', + deployment: undefined, + groups: [], + }; +} + +export const GenesisDeployment = { + $type: 'akash.deployment.v1beta1.GenesisDeployment' as const, + + encode( + message: GenesisDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deployment !== undefined) { + Deployment.encode(message.deployment, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployment = Deployment.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(Group.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisDeployment { + return { + $type: GenesisDeployment.$type, + deployment: isSet(object.deployment) + ? Deployment.fromJSON(object.deployment) + : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => Group.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisDeployment): unknown { + const obj: any = {}; + if (message.deployment !== undefined) { + obj.deployment = Deployment.toJSON(message.deployment); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => Group.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisDeployment { + return GenesisDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisDeployment { + const message = createBaseGenesisDeployment(); + message.deployment = + object.deployment !== undefined && object.deployment !== null + ? Deployment.fromPartial(object.deployment) + : undefined; + message.groups = object.groups?.map((e) => Group.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisDeployment.$type, GenesisDeployment); + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.deployment.v1beta1.GenesisState', + deployments: [], + params: undefined, + }; +} + +export const GenesisState = { + $type: 'akash.deployment.v1beta1.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.deployments) { + GenesisDeployment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployments.push( + GenesisDeployment.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + deployments: globalThis.Array.isArray(object?.deployments) + ? object.deployments.map((e: any) => GenesisDeployment.fromJSON(e)) + : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.deployments?.length) { + obj.deployments = message.deployments.map((e) => + GenesisDeployment.toJSON(e), + ); + } + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.deployments = + object.deployments?.map((e) => GenesisDeployment.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta1/group.ts b/ts/src/generated/akash/deployment/v1beta1/group.ts new file mode 100644 index 00000000..3ecf25d8 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta1/group.ts @@ -0,0 +1,1038 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { PlacementRequirements } from '../../base/v1beta1/attribute'; +import { ResourceUnits } from '../../base/v1beta1/resource'; + +export const protobufPackage = 'akash.deployment.v1beta1'; + +/** MsgCloseGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgCloseGroup { + $type: 'akash.deployment.v1beta1.MsgCloseGroup'; + id: GroupID | undefined; +} + +/** MsgCloseGroupResponse defines the Msg/CloseGroup response type. */ +export interface MsgCloseGroupResponse { + $type: 'akash.deployment.v1beta1.MsgCloseGroupResponse'; +} + +/** MsgPauseGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgPauseGroup { + $type: 'akash.deployment.v1beta1.MsgPauseGroup'; + id: GroupID | undefined; +} + +/** MsgPauseGroupResponse defines the Msg/PauseGroup response type. */ +export interface MsgPauseGroupResponse { + $type: 'akash.deployment.v1beta1.MsgPauseGroupResponse'; +} + +/** MsgStartGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgStartGroup { + $type: 'akash.deployment.v1beta1.MsgStartGroup'; + id: GroupID | undefined; +} + +/** MsgStartGroupResponse defines the Msg/StartGroup response type. */ +export interface MsgStartGroupResponse { + $type: 'akash.deployment.v1beta1.MsgStartGroupResponse'; +} + +/** GroupID stores owner, deployment sequence number and group sequence number */ +export interface GroupID { + $type: 'akash.deployment.v1beta1.GroupID'; + owner: string; + dseq: Long; + gseq: number; +} + +/** GroupSpec stores group specifications */ +export interface GroupSpec { + $type: 'akash.deployment.v1beta1.GroupSpec'; + name: string; + requirements: PlacementRequirements | undefined; + resources: Resource[]; +} + +/** Group stores group id, state and specifications of group */ +export interface Group { + $type: 'akash.deployment.v1beta1.Group'; + groupId: GroupID | undefined; + state: Group_State; + groupSpec: GroupSpec | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of group */ +export enum Group_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - GroupOpen denotes state for group open */ + open = 1, + /** paused - GroupOrdered denotes state for group ordered */ + paused = 2, + /** insufficient_funds - GroupInsufficientFunds denotes state for group insufficient_funds */ + insufficient_funds = 3, + /** closed - GroupClosed denotes state for group closed */ + closed = 4, + UNRECOGNIZED = -1, +} + +export function group_StateFromJSON(object: any): Group_State { + switch (object) { + case 0: + case 'invalid': + return Group_State.invalid; + case 1: + case 'open': + return Group_State.open; + case 2: + case 'paused': + return Group_State.paused; + case 3: + case 'insufficient_funds': + return Group_State.insufficient_funds; + case 4: + case 'closed': + return Group_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Group_State.UNRECOGNIZED; + } +} + +export function group_StateToJSON(object: Group_State): string { + switch (object) { + case Group_State.invalid: + return 'invalid'; + case Group_State.open: + return 'open'; + case Group_State.paused: + return 'paused'; + case Group_State.insufficient_funds: + return 'insufficient_funds'; + case Group_State.closed: + return 'closed'; + case Group_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** Resource stores unit, total count and price of resource */ +export interface Resource { + $type: 'akash.deployment.v1beta1.Resource'; + resources: ResourceUnits | undefined; + count: number; + price: Coin | undefined; +} + +function createBaseMsgCloseGroup(): MsgCloseGroup { + return { $type: 'akash.deployment.v1beta1.MsgCloseGroup', id: undefined }; +} + +export const MsgCloseGroup = { + $type: 'akash.deployment.v1beta1.MsgCloseGroup' as const, + + encode( + message: MsgCloseGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseGroup { + return { + $type: MsgCloseGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgCloseGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseGroup { + return MsgCloseGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseGroup { + const message = createBaseMsgCloseGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseGroup.$type, MsgCloseGroup); + +function createBaseMsgCloseGroupResponse(): MsgCloseGroupResponse { + return { $type: 'akash.deployment.v1beta1.MsgCloseGroupResponse' }; +} + +export const MsgCloseGroupResponse = { + $type: 'akash.deployment.v1beta1.MsgCloseGroupResponse' as const, + + encode( + _: MsgCloseGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseGroupResponse { + return { $type: MsgCloseGroupResponse.$type }; + }, + + toJSON(_: MsgCloseGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseGroupResponse { + return MsgCloseGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseGroupResponse { + const message = createBaseMsgCloseGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseGroupResponse.$type, MsgCloseGroupResponse); + +function createBaseMsgPauseGroup(): MsgPauseGroup { + return { $type: 'akash.deployment.v1beta1.MsgPauseGroup', id: undefined }; +} + +export const MsgPauseGroup = { + $type: 'akash.deployment.v1beta1.MsgPauseGroup' as const, + + encode( + message: MsgPauseGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPauseGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgPauseGroup { + return { + $type: MsgPauseGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgPauseGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseGroup { + return MsgPauseGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgPauseGroup { + const message = createBaseMsgPauseGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgPauseGroup.$type, MsgPauseGroup); + +function createBaseMsgPauseGroupResponse(): MsgPauseGroupResponse { + return { $type: 'akash.deployment.v1beta1.MsgPauseGroupResponse' }; +} + +export const MsgPauseGroupResponse = { + $type: 'akash.deployment.v1beta1.MsgPauseGroupResponse' as const, + + encode( + _: MsgPauseGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgPauseGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgPauseGroupResponse { + return { $type: MsgPauseGroupResponse.$type }; + }, + + toJSON(_: MsgPauseGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseGroupResponse { + return MsgPauseGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgPauseGroupResponse { + const message = createBaseMsgPauseGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgPauseGroupResponse.$type, MsgPauseGroupResponse); + +function createBaseMsgStartGroup(): MsgStartGroup { + return { $type: 'akash.deployment.v1beta1.MsgStartGroup', id: undefined }; +} + +export const MsgStartGroup = { + $type: 'akash.deployment.v1beta1.MsgStartGroup' as const, + + encode( + message: MsgStartGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStartGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStartGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgStartGroup { + return { + $type: MsgStartGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgStartGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgStartGroup { + return MsgStartGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgStartGroup { + const message = createBaseMsgStartGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgStartGroup.$type, MsgStartGroup); + +function createBaseMsgStartGroupResponse(): MsgStartGroupResponse { + return { $type: 'akash.deployment.v1beta1.MsgStartGroupResponse' }; +} + +export const MsgStartGroupResponse = { + $type: 'akash.deployment.v1beta1.MsgStartGroupResponse' as const, + + encode( + _: MsgStartGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgStartGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStartGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgStartGroupResponse { + return { $type: MsgStartGroupResponse.$type }; + }, + + toJSON(_: MsgStartGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgStartGroupResponse { + return MsgStartGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgStartGroupResponse { + const message = createBaseMsgStartGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgStartGroupResponse.$type, MsgStartGroupResponse); + +function createBaseGroupID(): GroupID { + return { + $type: 'akash.deployment.v1beta1.GroupID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + }; +} + +export const GroupID = { + $type: 'akash.deployment.v1beta1.GroupID' as const, + + encode( + message: GroupID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GroupID { + return { + $type: GroupID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + }; + }, + + toJSON(message: GroupID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + return obj; + }, + + create, I>>(base?: I): GroupID { + return GroupID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GroupID { + const message = createBaseGroupID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(GroupID.$type, GroupID); + +function createBaseGroupSpec(): GroupSpec { + return { + $type: 'akash.deployment.v1beta1.GroupSpec', + name: '', + requirements: undefined, + resources: [], + }; +} + +export const GroupSpec = { + $type: 'akash.deployment.v1beta1.GroupSpec' as const, + + encode( + message: GroupSpec, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.requirements !== undefined) { + PlacementRequirements.encode( + message.requirements, + writer.uint32(18).fork(), + ).ldelim(); + } + for (const v of message.resources) { + Resource.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupSpec { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.requirements = PlacementRequirements.decode( + reader, + reader.uint32(), + ); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.resources.push(Resource.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GroupSpec { + return { + $type: GroupSpec.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + requirements: isSet(object.requirements) + ? PlacementRequirements.fromJSON(object.requirements) + : undefined, + resources: globalThis.Array.isArray(object?.resources) + ? object.resources.map((e: any) => Resource.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GroupSpec): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.requirements !== undefined) { + obj.requirements = PlacementRequirements.toJSON(message.requirements); + } + if (message.resources?.length) { + obj.resources = message.resources.map((e) => Resource.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): GroupSpec { + return GroupSpec.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GroupSpec { + const message = createBaseGroupSpec(); + message.name = object.name ?? ''; + message.requirements = + object.requirements !== undefined && object.requirements !== null + ? PlacementRequirements.fromPartial(object.requirements) + : undefined; + message.resources = + object.resources?.map((e) => Resource.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GroupSpec.$type, GroupSpec); + +function createBaseGroup(): Group { + return { + $type: 'akash.deployment.v1beta1.Group', + groupId: undefined, + state: 0, + groupSpec: undefined, + createdAt: Long.ZERO, + }; +} + +export const Group = { + $type: 'akash.deployment.v1beta1.Group' as const, + + encode(message: Group, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.groupId !== undefined) { + GroupID.encode(message.groupId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.groupSpec !== undefined) { + GroupSpec.encode(message.groupSpec, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Group { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.groupId = GroupID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.groupSpec = GroupSpec.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Group { + return { + $type: Group.$type, + groupId: isSet(object.groupId) + ? GroupID.fromJSON(object.groupId) + : undefined, + state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + groupSpec: isSet(object.groupSpec) + ? GroupSpec.fromJSON(object.groupSpec) + : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Group): unknown { + const obj: any = {}; + if (message.groupId !== undefined) { + obj.groupId = GroupID.toJSON(message.groupId); + } + if (message.state !== 0) { + obj.state = group_StateToJSON(message.state); + } + if (message.groupSpec !== undefined) { + obj.groupSpec = GroupSpec.toJSON(message.groupSpec); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Group { + return Group.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Group { + const message = createBaseGroup(); + message.groupId = + object.groupId !== undefined && object.groupId !== null + ? GroupID.fromPartial(object.groupId) + : undefined; + message.state = object.state ?? 0; + message.groupSpec = + object.groupSpec !== undefined && object.groupSpec !== null + ? GroupSpec.fromPartial(object.groupSpec) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Group.$type, Group); + +function createBaseResource(): Resource { + return { + $type: 'akash.deployment.v1beta1.Resource', + resources: undefined, + count: 0, + price: undefined, + }; +} + +export const Resource = { + $type: 'akash.deployment.v1beta1.Resource' as const, + + encode( + message: Resource, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.resources !== undefined) { + ResourceUnits.encode( + message.resources, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.count !== 0) { + writer.uint32(16).uint32(message.count); + } + if (message.price !== undefined) { + Coin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Resource { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResource(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resources = ResourceUnits.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.count = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Resource { + return { + $type: Resource.$type, + resources: isSet(object.resources) + ? ResourceUnits.fromJSON(object.resources) + : undefined, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + price: isSet(object.price) ? Coin.fromJSON(object.price) : undefined, + }; + }, + + toJSON(message: Resource): unknown { + const obj: any = {}; + if (message.resources !== undefined) { + obj.resources = ResourceUnits.toJSON(message.resources); + } + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + if (message.price !== undefined) { + obj.price = Coin.toJSON(message.price); + } + return obj; + }, + + create, I>>(base?: I): Resource { + return Resource.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Resource { + const message = createBaseResource(); + message.resources = + object.resources !== undefined && object.resources !== null + ? ResourceUnits.fromPartial(object.resources) + : undefined; + message.count = object.count ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? Coin.fromPartial(object.price) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Resource.$type, Resource); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta1/params.ts b/ts/src/generated/akash/deployment/v1beta1/params.ts new file mode 100644 index 00000000..45cb63e5 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta1/params.ts @@ -0,0 +1,130 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta1'; + +/** Params defines the parameters for the x/deployment package */ +export interface Params { + $type: 'akash.deployment.v1beta1.Params'; + deploymentMinDeposit: Coin | undefined; +} + +function createBaseParams(): Params { + return { + $type: 'akash.deployment.v1beta1.Params', + deploymentMinDeposit: undefined, + }; +} + +export const Params = { + $type: 'akash.deployment.v1beta1.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deploymentMinDeposit !== undefined) { + Coin.encode( + message.deploymentMinDeposit, + writer.uint32(10).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deploymentMinDeposit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + deploymentMinDeposit: isSet(object.deploymentMinDeposit) + ? Coin.fromJSON(object.deploymentMinDeposit) + : undefined, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.deploymentMinDeposit !== undefined) { + obj.deploymentMinDeposit = Coin.toJSON(message.deploymentMinDeposit); + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.deploymentMinDeposit = + object.deploymentMinDeposit !== undefined && + object.deploymentMinDeposit !== null + ? Coin.fromPartial(object.deploymentMinDeposit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta1/query.ts b/ts/src/generated/akash/deployment/v1beta1/query.ts new file mode 100644 index 00000000..b5f1a7f4 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta1/query.ts @@ -0,0 +1,728 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account } from '../../escrow/v1beta1/types'; +import { Deployment, DeploymentFilters, DeploymentID } from './deployment'; +import { Group, GroupID } from './group'; + +export const protobufPackage = 'akash.deployment.v1beta1'; + +/** QueryDeploymentsRequest is request type for the Query/Deployments RPC method */ +export interface QueryDeploymentsRequest { + $type: 'akash.deployment.v1beta1.QueryDeploymentsRequest'; + filters: DeploymentFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryDeploymentsResponse is response type for the Query/Deployments RPC method */ +export interface QueryDeploymentsResponse { + $type: 'akash.deployment.v1beta1.QueryDeploymentsResponse'; + deployments: QueryDeploymentResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryDeploymentRequest is request type for the Query/Deployment RPC method */ +export interface QueryDeploymentRequest { + $type: 'akash.deployment.v1beta1.QueryDeploymentRequest'; + id: DeploymentID | undefined; +} + +/** QueryDeploymentResponse is response type for the Query/Deployment RPC method */ +export interface QueryDeploymentResponse { + $type: 'akash.deployment.v1beta1.QueryDeploymentResponse'; + deployment: Deployment | undefined; + groups: Group[]; + escrowAccount: Account | undefined; +} + +/** QueryGroupRequest is request type for the Query/Group RPC method */ +export interface QueryGroupRequest { + $type: 'akash.deployment.v1beta1.QueryGroupRequest'; + id: GroupID | undefined; +} + +/** QueryGroupResponse is response type for the Query/Group RPC method */ +export interface QueryGroupResponse { + $type: 'akash.deployment.v1beta1.QueryGroupResponse'; + group: Group | undefined; +} + +function createBaseQueryDeploymentsRequest(): QueryDeploymentsRequest { + return { + $type: 'akash.deployment.v1beta1.QueryDeploymentsRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryDeploymentsRequest = { + $type: 'akash.deployment.v1beta1.QueryDeploymentsRequest' as const, + + encode( + message: QueryDeploymentsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + DeploymentFilters.encode( + message.filters, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = DeploymentFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentsRequest { + return { + $type: QueryDeploymentsRequest.$type, + filters: isSet(object.filters) + ? DeploymentFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentsRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = DeploymentFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentsRequest { + return QueryDeploymentsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentsRequest { + const message = createBaseQueryDeploymentsRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? DeploymentFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentsRequest.$type, QueryDeploymentsRequest); + +function createBaseQueryDeploymentsResponse(): QueryDeploymentsResponse { + return { + $type: 'akash.deployment.v1beta1.QueryDeploymentsResponse', + deployments: [], + pagination: undefined, + }; +} + +export const QueryDeploymentsResponse = { + $type: 'akash.deployment.v1beta1.QueryDeploymentsResponse' as const, + + encode( + message: QueryDeploymentsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.deployments) { + QueryDeploymentResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployments.push( + QueryDeploymentResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentsResponse { + return { + $type: QueryDeploymentsResponse.$type, + deployments: globalThis.Array.isArray(object?.deployments) + ? object.deployments.map((e: any) => + QueryDeploymentResponse.fromJSON(e), + ) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentsResponse): unknown { + const obj: any = {}; + if (message.deployments?.length) { + obj.deployments = message.deployments.map((e) => + QueryDeploymentResponse.toJSON(e), + ); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentsResponse { + return QueryDeploymentsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentsResponse { + const message = createBaseQueryDeploymentsResponse(); + message.deployments = + object.deployments?.map((e) => QueryDeploymentResponse.fromPartial(e)) || + []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryDeploymentsResponse.$type, + QueryDeploymentsResponse, +); + +function createBaseQueryDeploymentRequest(): QueryDeploymentRequest { + return { + $type: 'akash.deployment.v1beta1.QueryDeploymentRequest', + id: undefined, + }; +} + +export const QueryDeploymentRequest = { + $type: 'akash.deployment.v1beta1.QueryDeploymentRequest' as const, + + encode( + message: QueryDeploymentRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentRequest { + return { + $type: QueryDeploymentRequest.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryDeploymentRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentRequest { + return QueryDeploymentRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentRequest { + const message = createBaseQueryDeploymentRequest(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentRequest.$type, QueryDeploymentRequest); + +function createBaseQueryDeploymentResponse(): QueryDeploymentResponse { + return { + $type: 'akash.deployment.v1beta1.QueryDeploymentResponse', + deployment: undefined, + groups: [], + escrowAccount: undefined, + }; +} + +export const QueryDeploymentResponse = { + $type: 'akash.deployment.v1beta1.QueryDeploymentResponse' as const, + + encode( + message: QueryDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deployment !== undefined) { + Deployment.encode(message.deployment, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.escrowAccount !== undefined) { + Account.encode(message.escrowAccount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployment = Deployment.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(Group.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.escrowAccount = Account.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentResponse { + return { + $type: QueryDeploymentResponse.$type, + deployment: isSet(object.deployment) + ? Deployment.fromJSON(object.deployment) + : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => Group.fromJSON(e)) + : [], + escrowAccount: isSet(object.escrowAccount) + ? Account.fromJSON(object.escrowAccount) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentResponse): unknown { + const obj: any = {}; + if (message.deployment !== undefined) { + obj.deployment = Deployment.toJSON(message.deployment); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => Group.toJSON(e)); + } + if (message.escrowAccount !== undefined) { + obj.escrowAccount = Account.toJSON(message.escrowAccount); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentResponse { + return QueryDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentResponse { + const message = createBaseQueryDeploymentResponse(); + message.deployment = + object.deployment !== undefined && object.deployment !== null + ? Deployment.fromPartial(object.deployment) + : undefined; + message.groups = object.groups?.map((e) => Group.fromPartial(e)) || []; + message.escrowAccount = + object.escrowAccount !== undefined && object.escrowAccount !== null + ? Account.fromPartial(object.escrowAccount) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentResponse.$type, QueryDeploymentResponse); + +function createBaseQueryGroupRequest(): QueryGroupRequest { + return { $type: 'akash.deployment.v1beta1.QueryGroupRequest', id: undefined }; +} + +export const QueryGroupRequest = { + $type: 'akash.deployment.v1beta1.QueryGroupRequest' as const, + + encode( + message: QueryGroupRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryGroupRequest { + return { + $type: QueryGroupRequest.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryGroupRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryGroupRequest { + return QueryGroupRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryGroupRequest { + const message = createBaseQueryGroupRequest(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryGroupRequest.$type, QueryGroupRequest); + +function createBaseQueryGroupResponse(): QueryGroupResponse { + return { + $type: 'akash.deployment.v1beta1.QueryGroupResponse', + group: undefined, + }; +} + +export const QueryGroupResponse = { + $type: 'akash.deployment.v1beta1.QueryGroupResponse' as const, + + encode( + message: QueryGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.group !== undefined) { + Group.encode(message.group, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.group = Group.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryGroupResponse { + return { + $type: QueryGroupResponse.$type, + group: isSet(object.group) ? Group.fromJSON(object.group) : undefined, + }; + }, + + toJSON(message: QueryGroupResponse): unknown { + const obj: any = {}; + if (message.group !== undefined) { + obj.group = Group.toJSON(message.group); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryGroupResponse { + return QueryGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryGroupResponse { + const message = createBaseQueryGroupResponse(); + message.group = + object.group !== undefined && object.group !== null + ? Group.fromPartial(object.group) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryGroupResponse.$type, QueryGroupResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Deployments queries deployments */ + Deployments( + request: QueryDeploymentsRequest, + ): Promise; + /** Deployment queries deployment details */ + Deployment(request: QueryDeploymentRequest): Promise; + /** Group queries group details */ + Group(request: QueryGroupRequest): Promise; +} + +export const QueryServiceName = 'akash.deployment.v1beta1.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Deployments = this.Deployments.bind(this); + this.Deployment = this.Deployment.bind(this); + this.Group = this.Group.bind(this); + } + Deployments( + request: QueryDeploymentsRequest, + ): Promise { + const data = QueryDeploymentsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Deployments', data); + return promise.then((data) => + QueryDeploymentsResponse.decode(_m0.Reader.create(data)), + ); + } + + Deployment( + request: QueryDeploymentRequest, + ): Promise { + const data = QueryDeploymentRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Deployment', data); + return promise.then((data) => + QueryDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + Group(request: QueryGroupRequest): Promise { + const data = QueryGroupRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Group', data); + return promise.then((data) => + QueryGroupResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/authz.ts b/ts/src/generated/akash/deployment/v1beta2/authz.ts new file mode 100644 index 00000000..7160b026 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/authz.ts @@ -0,0 +1,143 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** + * DepositDeploymentAuthorization allows the grantee to deposit up to spend_limit coins from + * the granter's account for a deployment. + */ +export interface DepositDeploymentAuthorization { + $type: 'akash.deployment.v1beta2.DepositDeploymentAuthorization'; + /** + * SpendLimit is the amount the grantee is authorized to spend from the granter's account for + * the purpose of deployment. + */ + spendLimit: Coin | undefined; +} + +function createBaseDepositDeploymentAuthorization(): DepositDeploymentAuthorization { + return { + $type: 'akash.deployment.v1beta2.DepositDeploymentAuthorization', + spendLimit: undefined, + }; +} + +export const DepositDeploymentAuthorization = { + $type: 'akash.deployment.v1beta2.DepositDeploymentAuthorization' as const, + + encode( + message: DepositDeploymentAuthorization, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.spendLimit !== undefined) { + Coin.encode(message.spendLimit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): DepositDeploymentAuthorization { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositDeploymentAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.spendLimit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DepositDeploymentAuthorization { + return { + $type: DepositDeploymentAuthorization.$type, + spendLimit: isSet(object.spendLimit) + ? Coin.fromJSON(object.spendLimit) + : undefined, + }; + }, + + toJSON(message: DepositDeploymentAuthorization): unknown { + const obj: any = {}; + if (message.spendLimit !== undefined) { + obj.spendLimit = Coin.toJSON(message.spendLimit); + } + return obj; + }, + + create, I>>( + base?: I, + ): DepositDeploymentAuthorization { + return DepositDeploymentAuthorization.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DepositDeploymentAuthorization { + const message = createBaseDepositDeploymentAuthorization(); + message.spendLimit = + object.spendLimit !== undefined && object.spendLimit !== null + ? Coin.fromPartial(object.spendLimit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + DepositDeploymentAuthorization.$type, + DepositDeploymentAuthorization, +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/deployment.ts b/ts/src/generated/akash/deployment/v1beta2/deployment.ts new file mode 100644 index 00000000..556ff843 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/deployment.ts @@ -0,0 +1,475 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** DeploymentID stores owner and sequence number */ +export interface DeploymentID { + $type: 'akash.deployment.v1beta2.DeploymentID'; + owner: string; + dseq: Long; +} + +/** Deployment stores deploymentID, state and version details */ +export interface Deployment { + $type: 'akash.deployment.v1beta2.Deployment'; + deploymentId: DeploymentID | undefined; + state: Deployment_State; + version: Uint8Array; + createdAt: Long; +} + +/** State is an enum which refers to state of deployment */ +export enum Deployment_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** active - DeploymentActive denotes state for deployment active */ + active = 1, + /** closed - DeploymentClosed denotes state for deployment closed */ + closed = 2, + UNRECOGNIZED = -1, +} + +export function deployment_StateFromJSON(object: any): Deployment_State { + switch (object) { + case 0: + case 'invalid': + return Deployment_State.invalid; + case 1: + case 'active': + return Deployment_State.active; + case 2: + case 'closed': + return Deployment_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Deployment_State.UNRECOGNIZED; + } +} + +export function deployment_StateToJSON(object: Deployment_State): string { + switch (object) { + case Deployment_State.invalid: + return 'invalid'; + case Deployment_State.active: + return 'active'; + case Deployment_State.closed: + return 'closed'; + case Deployment_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** DeploymentFilters defines filters used to filter deployments */ +export interface DeploymentFilters { + $type: 'akash.deployment.v1beta2.DeploymentFilters'; + owner: string; + dseq: Long; + state: string; +} + +function createBaseDeploymentID(): DeploymentID { + return { + $type: 'akash.deployment.v1beta2.DeploymentID', + owner: '', + dseq: Long.UZERO, + }; +} + +export const DeploymentID = { + $type: 'akash.deployment.v1beta2.DeploymentID' as const, + + encode( + message: DeploymentID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeploymentID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeploymentID { + return { + $type: DeploymentID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + }; + }, + + toJSON(message: DeploymentID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>( + base?: I, + ): DeploymentID { + return DeploymentID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DeploymentID { + const message = createBaseDeploymentID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + return message; + }, +}; + +messageTypeRegistry.set(DeploymentID.$type, DeploymentID); + +function createBaseDeployment(): Deployment { + return { + $type: 'akash.deployment.v1beta2.Deployment', + deploymentId: undefined, + state: 0, + version: new Uint8Array(0), + createdAt: Long.ZERO, + }; +} + +export const Deployment = { + $type: 'akash.deployment.v1beta2.Deployment' as const, + + encode( + message: Deployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deploymentId !== undefined) { + DeploymentID.encode( + message.deploymentId, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Deployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deploymentId = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Deployment { + return { + $type: Deployment.$type, + deploymentId: isSet(object.deploymentId) + ? DeploymentID.fromJSON(object.deploymentId) + : undefined, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Deployment): unknown { + const obj: any = {}; + if (message.deploymentId !== undefined) { + obj.deploymentId = DeploymentID.toJSON(message.deploymentId); + } + if (message.state !== 0) { + obj.state = deployment_StateToJSON(message.state); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Deployment { + return Deployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Deployment { + const message = createBaseDeployment(); + message.deploymentId = + object.deploymentId !== undefined && object.deploymentId !== null + ? DeploymentID.fromPartial(object.deploymentId) + : undefined; + message.state = object.state ?? 0; + message.version = object.version ?? new Uint8Array(0); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Deployment.$type, Deployment); + +function createBaseDeploymentFilters(): DeploymentFilters { + return { + $type: 'akash.deployment.v1beta2.DeploymentFilters', + owner: '', + dseq: Long.UZERO, + state: '', + }; +} + +export const DeploymentFilters = { + $type: 'akash.deployment.v1beta2.DeploymentFilters' as const, + + encode( + message: DeploymentFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.state !== '') { + writer.uint32(26).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeploymentFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeploymentFilters { + return { + $type: DeploymentFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: DeploymentFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): DeploymentFilters { + return DeploymentFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DeploymentFilters { + const message = createBaseDeploymentFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(DeploymentFilters.$type, DeploymentFilters); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts b/ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts new file mode 100644 index 00000000..ac7cf0ea --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts @@ -0,0 +1,813 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { DeploymentID } from './deployment'; +import { GroupSpec } from './groupspec'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** MsgCreateDeployment defines an SDK message for creating deployment */ +export interface MsgCreateDeployment { + $type: 'akash.deployment.v1beta2.MsgCreateDeployment'; + id: DeploymentID | undefined; + groups: GroupSpec[]; + version: Uint8Array; + deposit: Coin | undefined; + /** Depositor pays for the deposit */ + depositor: string; +} + +/** MsgCreateDeploymentResponse defines the Msg/CreateDeployment response type. */ +export interface MsgCreateDeploymentResponse { + $type: 'akash.deployment.v1beta2.MsgCreateDeploymentResponse'; +} + +/** MsgDepositDeployment deposits more funds into the deposit account */ +export interface MsgDepositDeployment { + $type: 'akash.deployment.v1beta2.MsgDepositDeployment'; + id: DeploymentID | undefined; + amount: Coin | undefined; + /** Depositor pays for the deposit */ + depositor: string; +} + +/** MsgCreateDeploymentResponse defines the Msg/CreateDeployment response type. */ +export interface MsgDepositDeploymentResponse { + $type: 'akash.deployment.v1beta2.MsgDepositDeploymentResponse'; +} + +/** MsgUpdateDeployment defines an SDK message for updating deployment */ +export interface MsgUpdateDeployment { + $type: 'akash.deployment.v1beta2.MsgUpdateDeployment'; + id: DeploymentID | undefined; + version: Uint8Array; +} + +/** MsgUpdateDeploymentResponse defines the Msg/UpdateDeployment response type. */ +export interface MsgUpdateDeploymentResponse { + $type: 'akash.deployment.v1beta2.MsgUpdateDeploymentResponse'; +} + +/** MsgCloseDeployment defines an SDK message for closing deployment */ +export interface MsgCloseDeployment { + $type: 'akash.deployment.v1beta2.MsgCloseDeployment'; + id: DeploymentID | undefined; +} + +/** MsgCloseDeploymentResponse defines the Msg/CloseDeployment response type. */ +export interface MsgCloseDeploymentResponse { + $type: 'akash.deployment.v1beta2.MsgCloseDeploymentResponse'; +} + +function createBaseMsgCreateDeployment(): MsgCreateDeployment { + return { + $type: 'akash.deployment.v1beta2.MsgCreateDeployment', + id: undefined, + groups: [], + version: new Uint8Array(0), + deposit: undefined, + depositor: '', + }; +} + +export const MsgCreateDeployment = { + $type: 'akash.deployment.v1beta2.MsgCreateDeployment' as const, + + encode( + message: MsgCreateDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + GroupSpec.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(34).fork()).ldelim(); + } + if (message.depositor !== '') { + writer.uint32(42).string(message.depositor); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(GroupSpec.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.deposit = Coin.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.depositor = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateDeployment { + return { + $type: MsgCreateDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) + : [], + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + deposit: isSet(object.deposit) + ? Coin.fromJSON(object.deposit) + : undefined, + depositor: isSet(object.depositor) + ? globalThis.String(object.depositor) + : '', + }; + }, + + toJSON(message: MsgCreateDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => GroupSpec.toJSON(e)); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + if (message.deposit !== undefined) { + obj.deposit = Coin.toJSON(message.deposit); + } + if (message.depositor !== '') { + obj.depositor = message.depositor; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateDeployment { + return MsgCreateDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateDeployment { + const message = createBaseMsgCreateDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.groups = object.groups?.map((e) => GroupSpec.fromPartial(e)) || []; + message.version = object.version ?? new Uint8Array(0); + message.deposit = + object.deposit !== undefined && object.deposit !== null + ? Coin.fromPartial(object.deposit) + : undefined; + message.depositor = object.depositor ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateDeployment.$type, MsgCreateDeployment); + +function createBaseMsgCreateDeploymentResponse(): MsgCreateDeploymentResponse { + return { $type: 'akash.deployment.v1beta2.MsgCreateDeploymentResponse' }; +} + +export const MsgCreateDeploymentResponse = { + $type: 'akash.deployment.v1beta2.MsgCreateDeploymentResponse' as const, + + encode( + _: MsgCreateDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateDeploymentResponse { + return { $type: MsgCreateDeploymentResponse.$type }; + }, + + toJSON(_: MsgCreateDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateDeploymentResponse { + return MsgCreateDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateDeploymentResponse { + const message = createBaseMsgCreateDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateDeploymentResponse.$type, + MsgCreateDeploymentResponse, +); + +function createBaseMsgDepositDeployment(): MsgDepositDeployment { + return { + $type: 'akash.deployment.v1beta2.MsgDepositDeployment', + id: undefined, + amount: undefined, + depositor: '', + }; +} + +export const MsgDepositDeployment = { + $type: 'akash.deployment.v1beta2.MsgDepositDeployment' as const, + + encode( + message: MsgDepositDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.depositor !== '') { + writer.uint32(26).string(message.depositor); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDepositDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.amount = Coin.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.depositor = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDepositDeployment { + return { + $type: MsgDepositDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + depositor: isSet(object.depositor) + ? globalThis.String(object.depositor) + : '', + }; + }, + + toJSON(message: MsgDepositDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.amount !== undefined) { + obj.amount = Coin.toJSON(message.amount); + } + if (message.depositor !== '') { + obj.depositor = message.depositor; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDepositDeployment { + return MsgDepositDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDepositDeployment { + const message = createBaseMsgDepositDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined; + message.depositor = object.depositor ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MsgDepositDeployment.$type, MsgDepositDeployment); + +function createBaseMsgDepositDeploymentResponse(): MsgDepositDeploymentResponse { + return { $type: 'akash.deployment.v1beta2.MsgDepositDeploymentResponse' }; +} + +export const MsgDepositDeploymentResponse = { + $type: 'akash.deployment.v1beta2.MsgDepositDeploymentResponse' as const, + + encode( + _: MsgDepositDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDepositDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDepositDeploymentResponse { + return { $type: MsgDepositDeploymentResponse.$type }; + }, + + toJSON(_: MsgDepositDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDepositDeploymentResponse { + return MsgDepositDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgDepositDeploymentResponse { + const message = createBaseMsgDepositDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDepositDeploymentResponse.$type, + MsgDepositDeploymentResponse, +); + +function createBaseMsgUpdateDeployment(): MsgUpdateDeployment { + return { + $type: 'akash.deployment.v1beta2.MsgUpdateDeployment', + id: undefined, + version: new Uint8Array(0), + }; +} + +export const MsgUpdateDeployment = { + $type: 'akash.deployment.v1beta2.MsgUpdateDeployment' as const, + + encode( + message: MsgUpdateDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateDeployment { + return { + $type: MsgUpdateDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgUpdateDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateDeployment { + return MsgUpdateDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgUpdateDeployment { + const message = createBaseMsgUpdateDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.version = object.version ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(MsgUpdateDeployment.$type, MsgUpdateDeployment); + +function createBaseMsgUpdateDeploymentResponse(): MsgUpdateDeploymentResponse { + return { $type: 'akash.deployment.v1beta2.MsgUpdateDeploymentResponse' }; +} + +export const MsgUpdateDeploymentResponse = { + $type: 'akash.deployment.v1beta2.MsgUpdateDeploymentResponse' as const, + + encode( + _: MsgUpdateDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdateDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateDeploymentResponse { + return { $type: MsgUpdateDeploymentResponse.$type }; + }, + + toJSON(_: MsgUpdateDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateDeploymentResponse { + return MsgUpdateDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateDeploymentResponse { + const message = createBaseMsgUpdateDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgUpdateDeploymentResponse.$type, + MsgUpdateDeploymentResponse, +); + +function createBaseMsgCloseDeployment(): MsgCloseDeployment { + return { + $type: 'akash.deployment.v1beta2.MsgCloseDeployment', + id: undefined, + }; +} + +export const MsgCloseDeployment = { + $type: 'akash.deployment.v1beta2.MsgCloseDeployment' as const, + + encode( + message: MsgCloseDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseDeployment { + return { + $type: MsgCloseDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgCloseDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseDeployment { + return MsgCloseDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseDeployment { + const message = createBaseMsgCloseDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseDeployment.$type, MsgCloseDeployment); + +function createBaseMsgCloseDeploymentResponse(): MsgCloseDeploymentResponse { + return { $type: 'akash.deployment.v1beta2.MsgCloseDeploymentResponse' }; +} + +export const MsgCloseDeploymentResponse = { + $type: 'akash.deployment.v1beta2.MsgCloseDeploymentResponse' as const, + + encode( + _: MsgCloseDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseDeploymentResponse { + return { $type: MsgCloseDeploymentResponse.$type }; + }, + + toJSON(_: MsgCloseDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseDeploymentResponse { + return MsgCloseDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseDeploymentResponse { + const message = createBaseMsgCloseDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCloseDeploymentResponse.$type, + MsgCloseDeploymentResponse, +); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/genesis.ts b/ts/src/generated/akash/deployment/v1beta2/genesis.ts new file mode 100644 index 00000000..8e52c5b5 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/genesis.ts @@ -0,0 +1,259 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Deployment } from './deployment'; +import { Group } from './group'; +import { Params } from './params'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** GenesisDeployment defines the basic genesis state used by deployment module */ +export interface GenesisDeployment { + $type: 'akash.deployment.v1beta2.GenesisDeployment'; + deployment: Deployment | undefined; + groups: Group[]; +} + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.deployment.v1beta2.GenesisState'; + deployments: GenesisDeployment[]; + params: Params | undefined; +} + +function createBaseGenesisDeployment(): GenesisDeployment { + return { + $type: 'akash.deployment.v1beta2.GenesisDeployment', + deployment: undefined, + groups: [], + }; +} + +export const GenesisDeployment = { + $type: 'akash.deployment.v1beta2.GenesisDeployment' as const, + + encode( + message: GenesisDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deployment !== undefined) { + Deployment.encode(message.deployment, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployment = Deployment.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(Group.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisDeployment { + return { + $type: GenesisDeployment.$type, + deployment: isSet(object.deployment) + ? Deployment.fromJSON(object.deployment) + : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => Group.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisDeployment): unknown { + const obj: any = {}; + if (message.deployment !== undefined) { + obj.deployment = Deployment.toJSON(message.deployment); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => Group.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisDeployment { + return GenesisDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisDeployment { + const message = createBaseGenesisDeployment(); + message.deployment = + object.deployment !== undefined && object.deployment !== null + ? Deployment.fromPartial(object.deployment) + : undefined; + message.groups = object.groups?.map((e) => Group.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisDeployment.$type, GenesisDeployment); + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.deployment.v1beta2.GenesisState', + deployments: [], + params: undefined, + }; +} + +export const GenesisState = { + $type: 'akash.deployment.v1beta2.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.deployments) { + GenesisDeployment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployments.push( + GenesisDeployment.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + deployments: globalThis.Array.isArray(object?.deployments) + ? object.deployments.map((e: any) => GenesisDeployment.fromJSON(e)) + : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.deployments?.length) { + obj.deployments = message.deployments.map((e) => + GenesisDeployment.toJSON(e), + ); + } + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.deployments = + object.deployments?.map((e) => GenesisDeployment.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/group.ts b/ts/src/generated/akash/deployment/v1beta2/group.ts new file mode 100644 index 00000000..51868672 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/group.ts @@ -0,0 +1,242 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { GroupID } from './groupid'; +import { GroupSpec } from './groupspec'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** Group stores group id, state and specifications of group */ +export interface Group { + $type: 'akash.deployment.v1beta2.Group'; + groupId: GroupID | undefined; + state: Group_State; + groupSpec: GroupSpec | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of group */ +export enum Group_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - GroupOpen denotes state for group open */ + open = 1, + /** paused - GroupOrdered denotes state for group ordered */ + paused = 2, + /** insufficient_funds - GroupInsufficientFunds denotes state for group insufficient_funds */ + insufficient_funds = 3, + /** closed - GroupClosed denotes state for group closed */ + closed = 4, + UNRECOGNIZED = -1, +} + +export function group_StateFromJSON(object: any): Group_State { + switch (object) { + case 0: + case 'invalid': + return Group_State.invalid; + case 1: + case 'open': + return Group_State.open; + case 2: + case 'paused': + return Group_State.paused; + case 3: + case 'insufficient_funds': + return Group_State.insufficient_funds; + case 4: + case 'closed': + return Group_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Group_State.UNRECOGNIZED; + } +} + +export function group_StateToJSON(object: Group_State): string { + switch (object) { + case Group_State.invalid: + return 'invalid'; + case Group_State.open: + return 'open'; + case Group_State.paused: + return 'paused'; + case Group_State.insufficient_funds: + return 'insufficient_funds'; + case Group_State.closed: + return 'closed'; + case Group_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseGroup(): Group { + return { + $type: 'akash.deployment.v1beta2.Group', + groupId: undefined, + state: 0, + groupSpec: undefined, + createdAt: Long.ZERO, + }; +} + +export const Group = { + $type: 'akash.deployment.v1beta2.Group' as const, + + encode(message: Group, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.groupId !== undefined) { + GroupID.encode(message.groupId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.groupSpec !== undefined) { + GroupSpec.encode(message.groupSpec, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Group { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.groupId = GroupID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.groupSpec = GroupSpec.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Group { + return { + $type: Group.$type, + groupId: isSet(object.groupId) + ? GroupID.fromJSON(object.groupId) + : undefined, + state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + groupSpec: isSet(object.groupSpec) + ? GroupSpec.fromJSON(object.groupSpec) + : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Group): unknown { + const obj: any = {}; + if (message.groupId !== undefined) { + obj.groupId = GroupID.toJSON(message.groupId); + } + if (message.state !== 0) { + obj.state = group_StateToJSON(message.state); + } + if (message.groupSpec !== undefined) { + obj.groupSpec = GroupSpec.toJSON(message.groupSpec); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Group { + return Group.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Group { + const message = createBaseGroup(); + message.groupId = + object.groupId !== undefined && object.groupId !== null + ? GroupID.fromPartial(object.groupId) + : undefined; + message.state = object.state ?? 0; + message.groupSpec = + object.groupSpec !== undefined && object.groupSpec !== null + ? GroupSpec.fromPartial(object.groupSpec) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Group.$type, Group); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/groupid.ts b/ts/src/generated/akash/deployment/v1beta2/groupid.ts new file mode 100644 index 00000000..7d93a9fb --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/groupid.ts @@ -0,0 +1,157 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** GroupID stores owner, deployment sequence number and group sequence number */ +export interface GroupID { + $type: 'akash.deployment.v1beta2.GroupID'; + owner: string; + dseq: Long; + gseq: number; +} + +function createBaseGroupID(): GroupID { + return { + $type: 'akash.deployment.v1beta2.GroupID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + }; +} + +export const GroupID = { + $type: 'akash.deployment.v1beta2.GroupID' as const, + + encode( + message: GroupID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GroupID { + return { + $type: GroupID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + }; + }, + + toJSON(message: GroupID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + return obj; + }, + + create, I>>(base?: I): GroupID { + return GroupID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GroupID { + const message = createBaseGroupID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(GroupID.$type, GroupID); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/groupmsg.ts b/ts/src/generated/akash/deployment/v1beta2/groupmsg.ts new file mode 100644 index 00000000..24e88544 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/groupmsg.ts @@ -0,0 +1,476 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { GroupID } from './groupid'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** MsgCloseGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgCloseGroup { + $type: 'akash.deployment.v1beta2.MsgCloseGroup'; + id: GroupID | undefined; +} + +/** MsgCloseGroupResponse defines the Msg/CloseGroup response type. */ +export interface MsgCloseGroupResponse { + $type: 'akash.deployment.v1beta2.MsgCloseGroupResponse'; +} + +/** MsgPauseGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgPauseGroup { + $type: 'akash.deployment.v1beta2.MsgPauseGroup'; + id: GroupID | undefined; +} + +/** MsgPauseGroupResponse defines the Msg/PauseGroup response type. */ +export interface MsgPauseGroupResponse { + $type: 'akash.deployment.v1beta2.MsgPauseGroupResponse'; +} + +/** MsgStartGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgStartGroup { + $type: 'akash.deployment.v1beta2.MsgStartGroup'; + id: GroupID | undefined; +} + +/** MsgStartGroupResponse defines the Msg/StartGroup response type. */ +export interface MsgStartGroupResponse { + $type: 'akash.deployment.v1beta2.MsgStartGroupResponse'; +} + +function createBaseMsgCloseGroup(): MsgCloseGroup { + return { $type: 'akash.deployment.v1beta2.MsgCloseGroup', id: undefined }; +} + +export const MsgCloseGroup = { + $type: 'akash.deployment.v1beta2.MsgCloseGroup' as const, + + encode( + message: MsgCloseGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseGroup { + return { + $type: MsgCloseGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgCloseGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseGroup { + return MsgCloseGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseGroup { + const message = createBaseMsgCloseGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseGroup.$type, MsgCloseGroup); + +function createBaseMsgCloseGroupResponse(): MsgCloseGroupResponse { + return { $type: 'akash.deployment.v1beta2.MsgCloseGroupResponse' }; +} + +export const MsgCloseGroupResponse = { + $type: 'akash.deployment.v1beta2.MsgCloseGroupResponse' as const, + + encode( + _: MsgCloseGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseGroupResponse { + return { $type: MsgCloseGroupResponse.$type }; + }, + + toJSON(_: MsgCloseGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseGroupResponse { + return MsgCloseGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseGroupResponse { + const message = createBaseMsgCloseGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseGroupResponse.$type, MsgCloseGroupResponse); + +function createBaseMsgPauseGroup(): MsgPauseGroup { + return { $type: 'akash.deployment.v1beta2.MsgPauseGroup', id: undefined }; +} + +export const MsgPauseGroup = { + $type: 'akash.deployment.v1beta2.MsgPauseGroup' as const, + + encode( + message: MsgPauseGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPauseGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgPauseGroup { + return { + $type: MsgPauseGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgPauseGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseGroup { + return MsgPauseGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgPauseGroup { + const message = createBaseMsgPauseGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgPauseGroup.$type, MsgPauseGroup); + +function createBaseMsgPauseGroupResponse(): MsgPauseGroupResponse { + return { $type: 'akash.deployment.v1beta2.MsgPauseGroupResponse' }; +} + +export const MsgPauseGroupResponse = { + $type: 'akash.deployment.v1beta2.MsgPauseGroupResponse' as const, + + encode( + _: MsgPauseGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgPauseGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgPauseGroupResponse { + return { $type: MsgPauseGroupResponse.$type }; + }, + + toJSON(_: MsgPauseGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseGroupResponse { + return MsgPauseGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgPauseGroupResponse { + const message = createBaseMsgPauseGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgPauseGroupResponse.$type, MsgPauseGroupResponse); + +function createBaseMsgStartGroup(): MsgStartGroup { + return { $type: 'akash.deployment.v1beta2.MsgStartGroup', id: undefined }; +} + +export const MsgStartGroup = { + $type: 'akash.deployment.v1beta2.MsgStartGroup' as const, + + encode( + message: MsgStartGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStartGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStartGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgStartGroup { + return { + $type: MsgStartGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgStartGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgStartGroup { + return MsgStartGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgStartGroup { + const message = createBaseMsgStartGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgStartGroup.$type, MsgStartGroup); + +function createBaseMsgStartGroupResponse(): MsgStartGroupResponse { + return { $type: 'akash.deployment.v1beta2.MsgStartGroupResponse' }; +} + +export const MsgStartGroupResponse = { + $type: 'akash.deployment.v1beta2.MsgStartGroupResponse' as const, + + encode( + _: MsgStartGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgStartGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStartGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgStartGroupResponse { + return { $type: MsgStartGroupResponse.$type }; + }, + + toJSON(_: MsgStartGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgStartGroupResponse { + return MsgStartGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgStartGroupResponse { + const message = createBaseMsgStartGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgStartGroupResponse.$type, MsgStartGroupResponse); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/groupspec.ts b/ts/src/generated/akash/deployment/v1beta2/groupspec.ts new file mode 100644 index 00000000..d9d49b1e --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/groupspec.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { PlacementRequirements } from '../../base/v1beta2/attribute'; +import { Resource } from './resource'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** GroupSpec stores group specifications */ +export interface GroupSpec { + $type: 'akash.deployment.v1beta2.GroupSpec'; + name: string; + requirements: PlacementRequirements | undefined; + resources: Resource[]; +} + +function createBaseGroupSpec(): GroupSpec { + return { + $type: 'akash.deployment.v1beta2.GroupSpec', + name: '', + requirements: undefined, + resources: [], + }; +} + +export const GroupSpec = { + $type: 'akash.deployment.v1beta2.GroupSpec' as const, + + encode( + message: GroupSpec, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.requirements !== undefined) { + PlacementRequirements.encode( + message.requirements, + writer.uint32(18).fork(), + ).ldelim(); + } + for (const v of message.resources) { + Resource.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupSpec { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.requirements = PlacementRequirements.decode( + reader, + reader.uint32(), + ); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.resources.push(Resource.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GroupSpec { + return { + $type: GroupSpec.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + requirements: isSet(object.requirements) + ? PlacementRequirements.fromJSON(object.requirements) + : undefined, + resources: globalThis.Array.isArray(object?.resources) + ? object.resources.map((e: any) => Resource.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GroupSpec): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.requirements !== undefined) { + obj.requirements = PlacementRequirements.toJSON(message.requirements); + } + if (message.resources?.length) { + obj.resources = message.resources.map((e) => Resource.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): GroupSpec { + return GroupSpec.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GroupSpec { + const message = createBaseGroupSpec(); + message.name = object.name ?? ''; + message.requirements = + object.requirements !== undefined && object.requirements !== null + ? PlacementRequirements.fromPartial(object.requirements) + : undefined; + message.resources = + object.resources?.map((e) => Resource.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GroupSpec.$type, GroupSpec); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/params.ts b/ts/src/generated/akash/deployment/v1beta2/params.ts new file mode 100644 index 00000000..999e9128 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/params.ts @@ -0,0 +1,130 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** Params defines the parameters for the x/deployment package */ +export interface Params { + $type: 'akash.deployment.v1beta2.Params'; + deploymentMinDeposit: Coin | undefined; +} + +function createBaseParams(): Params { + return { + $type: 'akash.deployment.v1beta2.Params', + deploymentMinDeposit: undefined, + }; +} + +export const Params = { + $type: 'akash.deployment.v1beta2.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deploymentMinDeposit !== undefined) { + Coin.encode( + message.deploymentMinDeposit, + writer.uint32(10).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deploymentMinDeposit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + deploymentMinDeposit: isSet(object.deploymentMinDeposit) + ? Coin.fromJSON(object.deploymentMinDeposit) + : undefined, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.deploymentMinDeposit !== undefined) { + obj.deploymentMinDeposit = Coin.toJSON(message.deploymentMinDeposit); + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.deploymentMinDeposit = + object.deploymentMinDeposit !== undefined && + object.deploymentMinDeposit !== null + ? Coin.fromPartial(object.deploymentMinDeposit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/query.ts b/ts/src/generated/akash/deployment/v1beta2/query.ts new file mode 100644 index 00000000..dd08bfaa --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/query.ts @@ -0,0 +1,729 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account } from '../../escrow/v1beta2/types'; +import { Deployment, DeploymentFilters, DeploymentID } from './deployment'; +import { Group } from './group'; +import { GroupID } from './groupid'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** QueryDeploymentsRequest is request type for the Query/Deployments RPC method */ +export interface QueryDeploymentsRequest { + $type: 'akash.deployment.v1beta2.QueryDeploymentsRequest'; + filters: DeploymentFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryDeploymentsResponse is response type for the Query/Deployments RPC method */ +export interface QueryDeploymentsResponse { + $type: 'akash.deployment.v1beta2.QueryDeploymentsResponse'; + deployments: QueryDeploymentResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryDeploymentRequest is request type for the Query/Deployment RPC method */ +export interface QueryDeploymentRequest { + $type: 'akash.deployment.v1beta2.QueryDeploymentRequest'; + id: DeploymentID | undefined; +} + +/** QueryDeploymentResponse is response type for the Query/Deployment RPC method */ +export interface QueryDeploymentResponse { + $type: 'akash.deployment.v1beta2.QueryDeploymentResponse'; + deployment: Deployment | undefined; + groups: Group[]; + escrowAccount: Account | undefined; +} + +/** QueryGroupRequest is request type for the Query/Group RPC method */ +export interface QueryGroupRequest { + $type: 'akash.deployment.v1beta2.QueryGroupRequest'; + id: GroupID | undefined; +} + +/** QueryGroupResponse is response type for the Query/Group RPC method */ +export interface QueryGroupResponse { + $type: 'akash.deployment.v1beta2.QueryGroupResponse'; + group: Group | undefined; +} + +function createBaseQueryDeploymentsRequest(): QueryDeploymentsRequest { + return { + $type: 'akash.deployment.v1beta2.QueryDeploymentsRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryDeploymentsRequest = { + $type: 'akash.deployment.v1beta2.QueryDeploymentsRequest' as const, + + encode( + message: QueryDeploymentsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + DeploymentFilters.encode( + message.filters, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = DeploymentFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentsRequest { + return { + $type: QueryDeploymentsRequest.$type, + filters: isSet(object.filters) + ? DeploymentFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentsRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = DeploymentFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentsRequest { + return QueryDeploymentsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentsRequest { + const message = createBaseQueryDeploymentsRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? DeploymentFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentsRequest.$type, QueryDeploymentsRequest); + +function createBaseQueryDeploymentsResponse(): QueryDeploymentsResponse { + return { + $type: 'akash.deployment.v1beta2.QueryDeploymentsResponse', + deployments: [], + pagination: undefined, + }; +} + +export const QueryDeploymentsResponse = { + $type: 'akash.deployment.v1beta2.QueryDeploymentsResponse' as const, + + encode( + message: QueryDeploymentsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.deployments) { + QueryDeploymentResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployments.push( + QueryDeploymentResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentsResponse { + return { + $type: QueryDeploymentsResponse.$type, + deployments: globalThis.Array.isArray(object?.deployments) + ? object.deployments.map((e: any) => + QueryDeploymentResponse.fromJSON(e), + ) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentsResponse): unknown { + const obj: any = {}; + if (message.deployments?.length) { + obj.deployments = message.deployments.map((e) => + QueryDeploymentResponse.toJSON(e), + ); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentsResponse { + return QueryDeploymentsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentsResponse { + const message = createBaseQueryDeploymentsResponse(); + message.deployments = + object.deployments?.map((e) => QueryDeploymentResponse.fromPartial(e)) || + []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryDeploymentsResponse.$type, + QueryDeploymentsResponse, +); + +function createBaseQueryDeploymentRequest(): QueryDeploymentRequest { + return { + $type: 'akash.deployment.v1beta2.QueryDeploymentRequest', + id: undefined, + }; +} + +export const QueryDeploymentRequest = { + $type: 'akash.deployment.v1beta2.QueryDeploymentRequest' as const, + + encode( + message: QueryDeploymentRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentRequest { + return { + $type: QueryDeploymentRequest.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryDeploymentRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentRequest { + return QueryDeploymentRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentRequest { + const message = createBaseQueryDeploymentRequest(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentRequest.$type, QueryDeploymentRequest); + +function createBaseQueryDeploymentResponse(): QueryDeploymentResponse { + return { + $type: 'akash.deployment.v1beta2.QueryDeploymentResponse', + deployment: undefined, + groups: [], + escrowAccount: undefined, + }; +} + +export const QueryDeploymentResponse = { + $type: 'akash.deployment.v1beta2.QueryDeploymentResponse' as const, + + encode( + message: QueryDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deployment !== undefined) { + Deployment.encode(message.deployment, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.escrowAccount !== undefined) { + Account.encode(message.escrowAccount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployment = Deployment.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(Group.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.escrowAccount = Account.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentResponse { + return { + $type: QueryDeploymentResponse.$type, + deployment: isSet(object.deployment) + ? Deployment.fromJSON(object.deployment) + : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => Group.fromJSON(e)) + : [], + escrowAccount: isSet(object.escrowAccount) + ? Account.fromJSON(object.escrowAccount) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentResponse): unknown { + const obj: any = {}; + if (message.deployment !== undefined) { + obj.deployment = Deployment.toJSON(message.deployment); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => Group.toJSON(e)); + } + if (message.escrowAccount !== undefined) { + obj.escrowAccount = Account.toJSON(message.escrowAccount); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentResponse { + return QueryDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentResponse { + const message = createBaseQueryDeploymentResponse(); + message.deployment = + object.deployment !== undefined && object.deployment !== null + ? Deployment.fromPartial(object.deployment) + : undefined; + message.groups = object.groups?.map((e) => Group.fromPartial(e)) || []; + message.escrowAccount = + object.escrowAccount !== undefined && object.escrowAccount !== null + ? Account.fromPartial(object.escrowAccount) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentResponse.$type, QueryDeploymentResponse); + +function createBaseQueryGroupRequest(): QueryGroupRequest { + return { $type: 'akash.deployment.v1beta2.QueryGroupRequest', id: undefined }; +} + +export const QueryGroupRequest = { + $type: 'akash.deployment.v1beta2.QueryGroupRequest' as const, + + encode( + message: QueryGroupRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryGroupRequest { + return { + $type: QueryGroupRequest.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryGroupRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryGroupRequest { + return QueryGroupRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryGroupRequest { + const message = createBaseQueryGroupRequest(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryGroupRequest.$type, QueryGroupRequest); + +function createBaseQueryGroupResponse(): QueryGroupResponse { + return { + $type: 'akash.deployment.v1beta2.QueryGroupResponse', + group: undefined, + }; +} + +export const QueryGroupResponse = { + $type: 'akash.deployment.v1beta2.QueryGroupResponse' as const, + + encode( + message: QueryGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.group !== undefined) { + Group.encode(message.group, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.group = Group.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryGroupResponse { + return { + $type: QueryGroupResponse.$type, + group: isSet(object.group) ? Group.fromJSON(object.group) : undefined, + }; + }, + + toJSON(message: QueryGroupResponse): unknown { + const obj: any = {}; + if (message.group !== undefined) { + obj.group = Group.toJSON(message.group); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryGroupResponse { + return QueryGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryGroupResponse { + const message = createBaseQueryGroupResponse(); + message.group = + object.group !== undefined && object.group !== null + ? Group.fromPartial(object.group) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryGroupResponse.$type, QueryGroupResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Deployments queries deployments */ + Deployments( + request: QueryDeploymentsRequest, + ): Promise; + /** Deployment queries deployment details */ + Deployment(request: QueryDeploymentRequest): Promise; + /** Group queries group details */ + Group(request: QueryGroupRequest): Promise; +} + +export const QueryServiceName = 'akash.deployment.v1beta2.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Deployments = this.Deployments.bind(this); + this.Deployment = this.Deployment.bind(this); + this.Group = this.Group.bind(this); + } + Deployments( + request: QueryDeploymentsRequest, + ): Promise { + const data = QueryDeploymentsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Deployments', data); + return promise.then((data) => + QueryDeploymentsResponse.decode(_m0.Reader.create(data)), + ); + } + + Deployment( + request: QueryDeploymentRequest, + ): Promise { + const data = QueryDeploymentRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Deployment', data); + return promise.then((data) => + QueryDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + Group(request: QueryGroupRequest): Promise { + const data = QueryGroupRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Group', data); + return promise.then((data) => + QueryGroupResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/resource.ts b/ts/src/generated/akash/deployment/v1beta2/resource.ts new file mode 100644 index 00000000..06dc3d08 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/resource.ts @@ -0,0 +1,167 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ResourceUnits } from '../../base/v1beta2/resourceunits'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** Resource stores unit, total count and price of resource */ +export interface Resource { + $type: 'akash.deployment.v1beta2.Resource'; + resources: ResourceUnits | undefined; + count: number; + price: DecCoin | undefined; +} + +function createBaseResource(): Resource { + return { + $type: 'akash.deployment.v1beta2.Resource', + resources: undefined, + count: 0, + price: undefined, + }; +} + +export const Resource = { + $type: 'akash.deployment.v1beta2.Resource' as const, + + encode( + message: Resource, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.resources !== undefined) { + ResourceUnits.encode( + message.resources, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.count !== 0) { + writer.uint32(16).uint32(message.count); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Resource { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResource(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resources = ResourceUnits.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.count = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Resource { + return { + $type: Resource.$type, + resources: isSet(object.resources) + ? ResourceUnits.fromJSON(object.resources) + : undefined, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + }; + }, + + toJSON(message: Resource): unknown { + const obj: any = {}; + if (message.resources !== undefined) { + obj.resources = ResourceUnits.toJSON(message.resources); + } + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + return obj; + }, + + create, I>>(base?: I): Resource { + return Resource.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Resource { + const message = createBaseResource(); + message.resources = + object.resources !== undefined && object.resources !== null + ? ResourceUnits.fromPartial(object.resources) + : undefined; + message.count = object.count ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Resource.$type, Resource); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta2/service.ts b/ts/src/generated/akash/deployment/v1beta2/service.ts new file mode 100644 index 00000000..854e8595 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta2/service.ts @@ -0,0 +1,136 @@ +/* eslint-disable */ +import _m0 from 'protobufjs/minimal'; +import { + MsgCloseDeployment, + MsgCloseDeploymentResponse, + MsgCreateDeployment, + MsgCreateDeploymentResponse, + MsgDepositDeployment, + MsgDepositDeploymentResponse, + MsgUpdateDeployment, + MsgUpdateDeploymentResponse, +} from './deploymentmsg'; +import { + MsgCloseGroup, + MsgCloseGroupResponse, + MsgPauseGroup, + MsgPauseGroupResponse, + MsgStartGroup, + MsgStartGroupResponse, +} from './groupmsg'; + +export const protobufPackage = 'akash.deployment.v1beta2'; + +/** Msg defines the deployment Msg service. */ +export interface Msg { + /** CreateDeployment defines a method to create new deployment given proper inputs. */ + CreateDeployment( + request: MsgCreateDeployment, + ): Promise; + /** DepositDeployment deposits more funds into the deployment account */ + DepositDeployment( + request: MsgDepositDeployment, + ): Promise; + /** UpdateDeployment defines a method to update a deployment given proper inputs. */ + UpdateDeployment( + request: MsgUpdateDeployment, + ): Promise; + /** CloseDeployment defines a method to close a deployment given proper inputs. */ + CloseDeployment( + request: MsgCloseDeployment, + ): Promise; + /** CloseGroup defines a method to close a group of a deployment given proper inputs. */ + CloseGroup(request: MsgCloseGroup): Promise; + /** PauseGroup defines a method to close a group of a deployment given proper inputs. */ + PauseGroup(request: MsgPauseGroup): Promise; + /** StartGroup defines a method to close a group of a deployment given proper inputs. */ + StartGroup(request: MsgStartGroup): Promise; +} + +export const MsgServiceName = 'akash.deployment.v1beta2.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateDeployment = this.CreateDeployment.bind(this); + this.DepositDeployment = this.DepositDeployment.bind(this); + this.UpdateDeployment = this.UpdateDeployment.bind(this); + this.CloseDeployment = this.CloseDeployment.bind(this); + this.CloseGroup = this.CloseGroup.bind(this); + this.PauseGroup = this.PauseGroup.bind(this); + this.StartGroup = this.StartGroup.bind(this); + } + CreateDeployment( + request: MsgCreateDeployment, + ): Promise { + const data = MsgCreateDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateDeployment', data); + return promise.then((data) => + MsgCreateDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + DepositDeployment( + request: MsgDepositDeployment, + ): Promise { + const data = MsgDepositDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'DepositDeployment', data); + return promise.then((data) => + MsgDepositDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + UpdateDeployment( + request: MsgUpdateDeployment, + ): Promise { + const data = MsgUpdateDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'UpdateDeployment', data); + return promise.then((data) => + MsgUpdateDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseDeployment( + request: MsgCloseDeployment, + ): Promise { + const data = MsgCloseDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseDeployment', data); + return promise.then((data) => + MsgCloseDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseGroup(request: MsgCloseGroup): Promise { + const data = MsgCloseGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseGroup', data); + return promise.then((data) => + MsgCloseGroupResponse.decode(_m0.Reader.create(data)), + ); + } + + PauseGroup(request: MsgPauseGroup): Promise { + const data = MsgPauseGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'PauseGroup', data); + return promise.then((data) => + MsgPauseGroupResponse.decode(_m0.Reader.create(data)), + ); + } + + StartGroup(request: MsgStartGroup): Promise { + const data = MsgStartGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'StartGroup', data); + return promise.then((data) => + MsgStartGroupResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/authz.ts b/ts/src/generated/akash/deployment/v1beta3/authz.ts new file mode 100644 index 00000000..fb401a29 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/authz.ts @@ -0,0 +1,143 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** + * DepositDeploymentAuthorization allows the grantee to deposit up to spend_limit coins from + * the granter's account for a deployment. + */ +export interface DepositDeploymentAuthorization { + $type: 'akash.deployment.v1beta3.DepositDeploymentAuthorization'; + /** + * SpendLimit is the amount the grantee is authorized to spend from the granter's account for + * the purpose of deployment. + */ + spendLimit: Coin | undefined; +} + +function createBaseDepositDeploymentAuthorization(): DepositDeploymentAuthorization { + return { + $type: 'akash.deployment.v1beta3.DepositDeploymentAuthorization', + spendLimit: undefined, + }; +} + +export const DepositDeploymentAuthorization = { + $type: 'akash.deployment.v1beta3.DepositDeploymentAuthorization' as const, + + encode( + message: DepositDeploymentAuthorization, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.spendLimit !== undefined) { + Coin.encode(message.spendLimit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): DepositDeploymentAuthorization { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositDeploymentAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.spendLimit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DepositDeploymentAuthorization { + return { + $type: DepositDeploymentAuthorization.$type, + spendLimit: isSet(object.spendLimit) + ? Coin.fromJSON(object.spendLimit) + : undefined, + }; + }, + + toJSON(message: DepositDeploymentAuthorization): unknown { + const obj: any = {}; + if (message.spendLimit !== undefined) { + obj.spendLimit = Coin.toJSON(message.spendLimit); + } + return obj; + }, + + create, I>>( + base?: I, + ): DepositDeploymentAuthorization { + return DepositDeploymentAuthorization.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DepositDeploymentAuthorization { + const message = createBaseDepositDeploymentAuthorization(); + message.spendLimit = + object.spendLimit !== undefined && object.spendLimit !== null + ? Coin.fromPartial(object.spendLimit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + DepositDeploymentAuthorization.$type, + DepositDeploymentAuthorization, +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/deployment.ts b/ts/src/generated/akash/deployment/v1beta3/deployment.ts new file mode 100644 index 00000000..2778ef37 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/deployment.ts @@ -0,0 +1,475 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** DeploymentID stores owner and sequence number */ +export interface DeploymentID { + $type: 'akash.deployment.v1beta3.DeploymentID'; + owner: string; + dseq: Long; +} + +/** Deployment stores deploymentID, state and version details */ +export interface Deployment { + $type: 'akash.deployment.v1beta3.Deployment'; + deploymentId: DeploymentID | undefined; + state: Deployment_State; + version: Uint8Array; + createdAt: Long; +} + +/** State is an enum which refers to state of deployment */ +export enum Deployment_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** active - DeploymentActive denotes state for deployment active */ + active = 1, + /** closed - DeploymentClosed denotes state for deployment closed */ + closed = 2, + UNRECOGNIZED = -1, +} + +export function deployment_StateFromJSON(object: any): Deployment_State { + switch (object) { + case 0: + case 'invalid': + return Deployment_State.invalid; + case 1: + case 'active': + return Deployment_State.active; + case 2: + case 'closed': + return Deployment_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Deployment_State.UNRECOGNIZED; + } +} + +export function deployment_StateToJSON(object: Deployment_State): string { + switch (object) { + case Deployment_State.invalid: + return 'invalid'; + case Deployment_State.active: + return 'active'; + case Deployment_State.closed: + return 'closed'; + case Deployment_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** DeploymentFilters defines filters used to filter deployments */ +export interface DeploymentFilters { + $type: 'akash.deployment.v1beta3.DeploymentFilters'; + owner: string; + dseq: Long; + state: string; +} + +function createBaseDeploymentID(): DeploymentID { + return { + $type: 'akash.deployment.v1beta3.DeploymentID', + owner: '', + dseq: Long.UZERO, + }; +} + +export const DeploymentID = { + $type: 'akash.deployment.v1beta3.DeploymentID' as const, + + encode( + message: DeploymentID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeploymentID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeploymentID { + return { + $type: DeploymentID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + }; + }, + + toJSON(message: DeploymentID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>( + base?: I, + ): DeploymentID { + return DeploymentID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DeploymentID { + const message = createBaseDeploymentID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + return message; + }, +}; + +messageTypeRegistry.set(DeploymentID.$type, DeploymentID); + +function createBaseDeployment(): Deployment { + return { + $type: 'akash.deployment.v1beta3.Deployment', + deploymentId: undefined, + state: 0, + version: new Uint8Array(0), + createdAt: Long.ZERO, + }; +} + +export const Deployment = { + $type: 'akash.deployment.v1beta3.Deployment' as const, + + encode( + message: Deployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deploymentId !== undefined) { + DeploymentID.encode( + message.deploymentId, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Deployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deploymentId = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Deployment { + return { + $type: Deployment.$type, + deploymentId: isSet(object.deploymentId) + ? DeploymentID.fromJSON(object.deploymentId) + : undefined, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Deployment): unknown { + const obj: any = {}; + if (message.deploymentId !== undefined) { + obj.deploymentId = DeploymentID.toJSON(message.deploymentId); + } + if (message.state !== 0) { + obj.state = deployment_StateToJSON(message.state); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Deployment { + return Deployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Deployment { + const message = createBaseDeployment(); + message.deploymentId = + object.deploymentId !== undefined && object.deploymentId !== null + ? DeploymentID.fromPartial(object.deploymentId) + : undefined; + message.state = object.state ?? 0; + message.version = object.version ?? new Uint8Array(0); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Deployment.$type, Deployment); + +function createBaseDeploymentFilters(): DeploymentFilters { + return { + $type: 'akash.deployment.v1beta3.DeploymentFilters', + owner: '', + dseq: Long.UZERO, + state: '', + }; +} + +export const DeploymentFilters = { + $type: 'akash.deployment.v1beta3.DeploymentFilters' as const, + + encode( + message: DeploymentFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.state !== '') { + writer.uint32(26).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeploymentFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeploymentFilters { + return { + $type: DeploymentFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: DeploymentFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): DeploymentFilters { + return DeploymentFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DeploymentFilters { + const message = createBaseDeploymentFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(DeploymentFilters.$type, DeploymentFilters); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts b/ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts new file mode 100644 index 00000000..1775cbe9 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts @@ -0,0 +1,813 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { DeploymentID } from './deployment'; +import { GroupSpec } from './groupspec'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** MsgCreateDeployment defines an SDK message for creating deployment */ +export interface MsgCreateDeployment { + $type: 'akash.deployment.v1beta3.MsgCreateDeployment'; + id: DeploymentID | undefined; + groups: GroupSpec[]; + version: Uint8Array; + deposit: Coin | undefined; + /** Depositor pays for the deposit */ + depositor: string; +} + +/** MsgCreateDeploymentResponse defines the Msg/CreateDeployment response type. */ +export interface MsgCreateDeploymentResponse { + $type: 'akash.deployment.v1beta3.MsgCreateDeploymentResponse'; +} + +/** MsgDepositDeployment deposits more funds into the deposit account */ +export interface MsgDepositDeployment { + $type: 'akash.deployment.v1beta3.MsgDepositDeployment'; + id: DeploymentID | undefined; + amount: Coin | undefined; + /** Depositor pays for the deposit */ + depositor: string; +} + +/** MsgCreateDeploymentResponse defines the Msg/CreateDeployment response type. */ +export interface MsgDepositDeploymentResponse { + $type: 'akash.deployment.v1beta3.MsgDepositDeploymentResponse'; +} + +/** MsgUpdateDeployment defines an SDK message for updating deployment */ +export interface MsgUpdateDeployment { + $type: 'akash.deployment.v1beta3.MsgUpdateDeployment'; + id: DeploymentID | undefined; + version: Uint8Array; +} + +/** MsgUpdateDeploymentResponse defines the Msg/UpdateDeployment response type. */ +export interface MsgUpdateDeploymentResponse { + $type: 'akash.deployment.v1beta3.MsgUpdateDeploymentResponse'; +} + +/** MsgCloseDeployment defines an SDK message for closing deployment */ +export interface MsgCloseDeployment { + $type: 'akash.deployment.v1beta3.MsgCloseDeployment'; + id: DeploymentID | undefined; +} + +/** MsgCloseDeploymentResponse defines the Msg/CloseDeployment response type. */ +export interface MsgCloseDeploymentResponse { + $type: 'akash.deployment.v1beta3.MsgCloseDeploymentResponse'; +} + +function createBaseMsgCreateDeployment(): MsgCreateDeployment { + return { + $type: 'akash.deployment.v1beta3.MsgCreateDeployment', + id: undefined, + groups: [], + version: new Uint8Array(0), + deposit: undefined, + depositor: '', + }; +} + +export const MsgCreateDeployment = { + $type: 'akash.deployment.v1beta3.MsgCreateDeployment' as const, + + encode( + message: MsgCreateDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + GroupSpec.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(34).fork()).ldelim(); + } + if (message.depositor !== '') { + writer.uint32(42).string(message.depositor); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(GroupSpec.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.deposit = Coin.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.depositor = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateDeployment { + return { + $type: MsgCreateDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) + : [], + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + deposit: isSet(object.deposit) + ? Coin.fromJSON(object.deposit) + : undefined, + depositor: isSet(object.depositor) + ? globalThis.String(object.depositor) + : '', + }; + }, + + toJSON(message: MsgCreateDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => GroupSpec.toJSON(e)); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + if (message.deposit !== undefined) { + obj.deposit = Coin.toJSON(message.deposit); + } + if (message.depositor !== '') { + obj.depositor = message.depositor; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateDeployment { + return MsgCreateDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateDeployment { + const message = createBaseMsgCreateDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.groups = object.groups?.map((e) => GroupSpec.fromPartial(e)) || []; + message.version = object.version ?? new Uint8Array(0); + message.deposit = + object.deposit !== undefined && object.deposit !== null + ? Coin.fromPartial(object.deposit) + : undefined; + message.depositor = object.depositor ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateDeployment.$type, MsgCreateDeployment); + +function createBaseMsgCreateDeploymentResponse(): MsgCreateDeploymentResponse { + return { $type: 'akash.deployment.v1beta3.MsgCreateDeploymentResponse' }; +} + +export const MsgCreateDeploymentResponse = { + $type: 'akash.deployment.v1beta3.MsgCreateDeploymentResponse' as const, + + encode( + _: MsgCreateDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateDeploymentResponse { + return { $type: MsgCreateDeploymentResponse.$type }; + }, + + toJSON(_: MsgCreateDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateDeploymentResponse { + return MsgCreateDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateDeploymentResponse { + const message = createBaseMsgCreateDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateDeploymentResponse.$type, + MsgCreateDeploymentResponse, +); + +function createBaseMsgDepositDeployment(): MsgDepositDeployment { + return { + $type: 'akash.deployment.v1beta3.MsgDepositDeployment', + id: undefined, + amount: undefined, + depositor: '', + }; +} + +export const MsgDepositDeployment = { + $type: 'akash.deployment.v1beta3.MsgDepositDeployment' as const, + + encode( + message: MsgDepositDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.depositor !== '') { + writer.uint32(26).string(message.depositor); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDepositDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.amount = Coin.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.depositor = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDepositDeployment { + return { + $type: MsgDepositDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + depositor: isSet(object.depositor) + ? globalThis.String(object.depositor) + : '', + }; + }, + + toJSON(message: MsgDepositDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.amount !== undefined) { + obj.amount = Coin.toJSON(message.amount); + } + if (message.depositor !== '') { + obj.depositor = message.depositor; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDepositDeployment { + return MsgDepositDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDepositDeployment { + const message = createBaseMsgDepositDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined; + message.depositor = object.depositor ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MsgDepositDeployment.$type, MsgDepositDeployment); + +function createBaseMsgDepositDeploymentResponse(): MsgDepositDeploymentResponse { + return { $type: 'akash.deployment.v1beta3.MsgDepositDeploymentResponse' }; +} + +export const MsgDepositDeploymentResponse = { + $type: 'akash.deployment.v1beta3.MsgDepositDeploymentResponse' as const, + + encode( + _: MsgDepositDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDepositDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDepositDeploymentResponse { + return { $type: MsgDepositDeploymentResponse.$type }; + }, + + toJSON(_: MsgDepositDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDepositDeploymentResponse { + return MsgDepositDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgDepositDeploymentResponse { + const message = createBaseMsgDepositDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDepositDeploymentResponse.$type, + MsgDepositDeploymentResponse, +); + +function createBaseMsgUpdateDeployment(): MsgUpdateDeployment { + return { + $type: 'akash.deployment.v1beta3.MsgUpdateDeployment', + id: undefined, + version: new Uint8Array(0), + }; +} + +export const MsgUpdateDeployment = { + $type: 'akash.deployment.v1beta3.MsgUpdateDeployment' as const, + + encode( + message: MsgUpdateDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.version.length !== 0) { + writer.uint32(26).bytes(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.version = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateDeployment { + return { + $type: MsgUpdateDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + version: isSet(object.version) + ? bytesFromBase64(object.version) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgUpdateDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + if (message.version.length !== 0) { + obj.version = base64FromBytes(message.version); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateDeployment { + return MsgUpdateDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgUpdateDeployment { + const message = createBaseMsgUpdateDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + message.version = object.version ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(MsgUpdateDeployment.$type, MsgUpdateDeployment); + +function createBaseMsgUpdateDeploymentResponse(): MsgUpdateDeploymentResponse { + return { $type: 'akash.deployment.v1beta3.MsgUpdateDeploymentResponse' }; +} + +export const MsgUpdateDeploymentResponse = { + $type: 'akash.deployment.v1beta3.MsgUpdateDeploymentResponse' as const, + + encode( + _: MsgUpdateDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdateDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateDeploymentResponse { + return { $type: MsgUpdateDeploymentResponse.$type }; + }, + + toJSON(_: MsgUpdateDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateDeploymentResponse { + return MsgUpdateDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateDeploymentResponse { + const message = createBaseMsgUpdateDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgUpdateDeploymentResponse.$type, + MsgUpdateDeploymentResponse, +); + +function createBaseMsgCloseDeployment(): MsgCloseDeployment { + return { + $type: 'akash.deployment.v1beta3.MsgCloseDeployment', + id: undefined, + }; +} + +export const MsgCloseDeployment = { + $type: 'akash.deployment.v1beta3.MsgCloseDeployment' as const, + + encode( + message: MsgCloseDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseDeployment { + return { + $type: MsgCloseDeployment.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgCloseDeployment): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseDeployment { + return MsgCloseDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseDeployment { + const message = createBaseMsgCloseDeployment(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseDeployment.$type, MsgCloseDeployment); + +function createBaseMsgCloseDeploymentResponse(): MsgCloseDeploymentResponse { + return { $type: 'akash.deployment.v1beta3.MsgCloseDeploymentResponse' }; +} + +export const MsgCloseDeploymentResponse = { + $type: 'akash.deployment.v1beta3.MsgCloseDeploymentResponse' as const, + + encode( + _: MsgCloseDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseDeploymentResponse { + return { $type: MsgCloseDeploymentResponse.$type }; + }, + + toJSON(_: MsgCloseDeploymentResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseDeploymentResponse { + return MsgCloseDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseDeploymentResponse { + const message = createBaseMsgCloseDeploymentResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCloseDeploymentResponse.$type, + MsgCloseDeploymentResponse, +); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/genesis.ts b/ts/src/generated/akash/deployment/v1beta3/genesis.ts new file mode 100644 index 00000000..925add51 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/genesis.ts @@ -0,0 +1,259 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Deployment } from './deployment'; +import { Group } from './group'; +import { Params } from './params'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** GenesisDeployment defines the basic genesis state used by deployment module */ +export interface GenesisDeployment { + $type: 'akash.deployment.v1beta3.GenesisDeployment'; + deployment: Deployment | undefined; + groups: Group[]; +} + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.deployment.v1beta3.GenesisState'; + deployments: GenesisDeployment[]; + params: Params | undefined; +} + +function createBaseGenesisDeployment(): GenesisDeployment { + return { + $type: 'akash.deployment.v1beta3.GenesisDeployment', + deployment: undefined, + groups: [], + }; +} + +export const GenesisDeployment = { + $type: 'akash.deployment.v1beta3.GenesisDeployment' as const, + + encode( + message: GenesisDeployment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deployment !== undefined) { + Deployment.encode(message.deployment, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisDeployment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisDeployment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployment = Deployment.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(Group.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisDeployment { + return { + $type: GenesisDeployment.$type, + deployment: isSet(object.deployment) + ? Deployment.fromJSON(object.deployment) + : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => Group.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisDeployment): unknown { + const obj: any = {}; + if (message.deployment !== undefined) { + obj.deployment = Deployment.toJSON(message.deployment); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => Group.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisDeployment { + return GenesisDeployment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisDeployment { + const message = createBaseGenesisDeployment(); + message.deployment = + object.deployment !== undefined && object.deployment !== null + ? Deployment.fromPartial(object.deployment) + : undefined; + message.groups = object.groups?.map((e) => Group.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisDeployment.$type, GenesisDeployment); + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.deployment.v1beta3.GenesisState', + deployments: [], + params: undefined, + }; +} + +export const GenesisState = { + $type: 'akash.deployment.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.deployments) { + GenesisDeployment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployments.push( + GenesisDeployment.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + deployments: globalThis.Array.isArray(object?.deployments) + ? object.deployments.map((e: any) => GenesisDeployment.fromJSON(e)) + : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.deployments?.length) { + obj.deployments = message.deployments.map((e) => + GenesisDeployment.toJSON(e), + ); + } + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.deployments = + object.deployments?.map((e) => GenesisDeployment.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/group.ts b/ts/src/generated/akash/deployment/v1beta3/group.ts new file mode 100644 index 00000000..d744379f --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/group.ts @@ -0,0 +1,242 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { GroupID } from './groupid'; +import { GroupSpec } from './groupspec'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** Group stores group id, state and specifications of group */ +export interface Group { + $type: 'akash.deployment.v1beta3.Group'; + groupId: GroupID | undefined; + state: Group_State; + groupSpec: GroupSpec | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of group */ +export enum Group_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - GroupOpen denotes state for group open */ + open = 1, + /** paused - GroupOrdered denotes state for group ordered */ + paused = 2, + /** insufficient_funds - GroupInsufficientFunds denotes state for group insufficient_funds */ + insufficient_funds = 3, + /** closed - GroupClosed denotes state for group closed */ + closed = 4, + UNRECOGNIZED = -1, +} + +export function group_StateFromJSON(object: any): Group_State { + switch (object) { + case 0: + case 'invalid': + return Group_State.invalid; + case 1: + case 'open': + return Group_State.open; + case 2: + case 'paused': + return Group_State.paused; + case 3: + case 'insufficient_funds': + return Group_State.insufficient_funds; + case 4: + case 'closed': + return Group_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Group_State.UNRECOGNIZED; + } +} + +export function group_StateToJSON(object: Group_State): string { + switch (object) { + case Group_State.invalid: + return 'invalid'; + case Group_State.open: + return 'open'; + case Group_State.paused: + return 'paused'; + case Group_State.insufficient_funds: + return 'insufficient_funds'; + case Group_State.closed: + return 'closed'; + case Group_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseGroup(): Group { + return { + $type: 'akash.deployment.v1beta3.Group', + groupId: undefined, + state: 0, + groupSpec: undefined, + createdAt: Long.ZERO, + }; +} + +export const Group = { + $type: 'akash.deployment.v1beta3.Group' as const, + + encode(message: Group, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.groupId !== undefined) { + GroupID.encode(message.groupId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.groupSpec !== undefined) { + GroupSpec.encode(message.groupSpec, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Group { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.groupId = GroupID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.groupSpec = GroupSpec.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Group { + return { + $type: Group.$type, + groupId: isSet(object.groupId) + ? GroupID.fromJSON(object.groupId) + : undefined, + state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + groupSpec: isSet(object.groupSpec) + ? GroupSpec.fromJSON(object.groupSpec) + : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Group): unknown { + const obj: any = {}; + if (message.groupId !== undefined) { + obj.groupId = GroupID.toJSON(message.groupId); + } + if (message.state !== 0) { + obj.state = group_StateToJSON(message.state); + } + if (message.groupSpec !== undefined) { + obj.groupSpec = GroupSpec.toJSON(message.groupSpec); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Group { + return Group.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Group { + const message = createBaseGroup(); + message.groupId = + object.groupId !== undefined && object.groupId !== null + ? GroupID.fromPartial(object.groupId) + : undefined; + message.state = object.state ?? 0; + message.groupSpec = + object.groupSpec !== undefined && object.groupSpec !== null + ? GroupSpec.fromPartial(object.groupSpec) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Group.$type, Group); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/groupid.ts b/ts/src/generated/akash/deployment/v1beta3/groupid.ts new file mode 100644 index 00000000..5cf0baf4 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/groupid.ts @@ -0,0 +1,157 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** GroupID stores owner, deployment sequence number and group sequence number */ +export interface GroupID { + $type: 'akash.deployment.v1beta3.GroupID'; + owner: string; + dseq: Long; + gseq: number; +} + +function createBaseGroupID(): GroupID { + return { + $type: 'akash.deployment.v1beta3.GroupID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + }; +} + +export const GroupID = { + $type: 'akash.deployment.v1beta3.GroupID' as const, + + encode( + message: GroupID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GroupID { + return { + $type: GroupID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + }; + }, + + toJSON(message: GroupID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + return obj; + }, + + create, I>>(base?: I): GroupID { + return GroupID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GroupID { + const message = createBaseGroupID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(GroupID.$type, GroupID); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/groupmsg.ts b/ts/src/generated/akash/deployment/v1beta3/groupmsg.ts new file mode 100644 index 00000000..4cd8f18e --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/groupmsg.ts @@ -0,0 +1,476 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { GroupID } from './groupid'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** MsgCloseGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgCloseGroup { + $type: 'akash.deployment.v1beta3.MsgCloseGroup'; + id: GroupID | undefined; +} + +/** MsgCloseGroupResponse defines the Msg/CloseGroup response type. */ +export interface MsgCloseGroupResponse { + $type: 'akash.deployment.v1beta3.MsgCloseGroupResponse'; +} + +/** MsgPauseGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgPauseGroup { + $type: 'akash.deployment.v1beta3.MsgPauseGroup'; + id: GroupID | undefined; +} + +/** MsgPauseGroupResponse defines the Msg/PauseGroup response type. */ +export interface MsgPauseGroupResponse { + $type: 'akash.deployment.v1beta3.MsgPauseGroupResponse'; +} + +/** MsgStartGroup defines SDK message to close a single Group within a Deployment. */ +export interface MsgStartGroup { + $type: 'akash.deployment.v1beta3.MsgStartGroup'; + id: GroupID | undefined; +} + +/** MsgStartGroupResponse defines the Msg/StartGroup response type. */ +export interface MsgStartGroupResponse { + $type: 'akash.deployment.v1beta3.MsgStartGroupResponse'; +} + +function createBaseMsgCloseGroup(): MsgCloseGroup { + return { $type: 'akash.deployment.v1beta3.MsgCloseGroup', id: undefined }; +} + +export const MsgCloseGroup = { + $type: 'akash.deployment.v1beta3.MsgCloseGroup' as const, + + encode( + message: MsgCloseGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseGroup { + return { + $type: MsgCloseGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgCloseGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseGroup { + return MsgCloseGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseGroup { + const message = createBaseMsgCloseGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseGroup.$type, MsgCloseGroup); + +function createBaseMsgCloseGroupResponse(): MsgCloseGroupResponse { + return { $type: 'akash.deployment.v1beta3.MsgCloseGroupResponse' }; +} + +export const MsgCloseGroupResponse = { + $type: 'akash.deployment.v1beta3.MsgCloseGroupResponse' as const, + + encode( + _: MsgCloseGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseGroupResponse { + return { $type: MsgCloseGroupResponse.$type }; + }, + + toJSON(_: MsgCloseGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseGroupResponse { + return MsgCloseGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseGroupResponse { + const message = createBaseMsgCloseGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseGroupResponse.$type, MsgCloseGroupResponse); + +function createBaseMsgPauseGroup(): MsgPauseGroup { + return { $type: 'akash.deployment.v1beta3.MsgPauseGroup', id: undefined }; +} + +export const MsgPauseGroup = { + $type: 'akash.deployment.v1beta3.MsgPauseGroup' as const, + + encode( + message: MsgPauseGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPauseGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgPauseGroup { + return { + $type: MsgPauseGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgPauseGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseGroup { + return MsgPauseGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgPauseGroup { + const message = createBaseMsgPauseGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgPauseGroup.$type, MsgPauseGroup); + +function createBaseMsgPauseGroupResponse(): MsgPauseGroupResponse { + return { $type: 'akash.deployment.v1beta3.MsgPauseGroupResponse' }; +} + +export const MsgPauseGroupResponse = { + $type: 'akash.deployment.v1beta3.MsgPauseGroupResponse' as const, + + encode( + _: MsgPauseGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgPauseGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgPauseGroupResponse { + return { $type: MsgPauseGroupResponse.$type }; + }, + + toJSON(_: MsgPauseGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseGroupResponse { + return MsgPauseGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgPauseGroupResponse { + const message = createBaseMsgPauseGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgPauseGroupResponse.$type, MsgPauseGroupResponse); + +function createBaseMsgStartGroup(): MsgStartGroup { + return { $type: 'akash.deployment.v1beta3.MsgStartGroup', id: undefined }; +} + +export const MsgStartGroup = { + $type: 'akash.deployment.v1beta3.MsgStartGroup' as const, + + encode( + message: MsgStartGroup, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStartGroup { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStartGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgStartGroup { + return { + $type: MsgStartGroup.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: MsgStartGroup): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgStartGroup { + return MsgStartGroup.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgStartGroup { + const message = createBaseMsgStartGroup(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgStartGroup.$type, MsgStartGroup); + +function createBaseMsgStartGroupResponse(): MsgStartGroupResponse { + return { $type: 'akash.deployment.v1beta3.MsgStartGroupResponse' }; +} + +export const MsgStartGroupResponse = { + $type: 'akash.deployment.v1beta3.MsgStartGroupResponse' as const, + + encode( + _: MsgStartGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgStartGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStartGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgStartGroupResponse { + return { $type: MsgStartGroupResponse.$type }; + }, + + toJSON(_: MsgStartGroupResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgStartGroupResponse { + return MsgStartGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgStartGroupResponse { + const message = createBaseMsgStartGroupResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgStartGroupResponse.$type, MsgStartGroupResponse); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/groupspec.ts b/ts/src/generated/akash/deployment/v1beta3/groupspec.ts new file mode 100644 index 00000000..43747a0c --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/groupspec.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { PlacementRequirements } from '../../base/v1beta3/attribute'; +import { ResourceUnit } from './resourceunit'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** GroupSpec stores group specifications */ +export interface GroupSpec { + $type: 'akash.deployment.v1beta3.GroupSpec'; + name: string; + requirements: PlacementRequirements | undefined; + resources: ResourceUnit[]; +} + +function createBaseGroupSpec(): GroupSpec { + return { + $type: 'akash.deployment.v1beta3.GroupSpec', + name: '', + requirements: undefined, + resources: [], + }; +} + +export const GroupSpec = { + $type: 'akash.deployment.v1beta3.GroupSpec' as const, + + encode( + message: GroupSpec, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.requirements !== undefined) { + PlacementRequirements.encode( + message.requirements, + writer.uint32(18).fork(), + ).ldelim(); + } + for (const v of message.resources) { + ResourceUnit.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupSpec { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.requirements = PlacementRequirements.decode( + reader, + reader.uint32(), + ); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.resources.push(ResourceUnit.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GroupSpec { + return { + $type: GroupSpec.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + requirements: isSet(object.requirements) + ? PlacementRequirements.fromJSON(object.requirements) + : undefined, + resources: globalThis.Array.isArray(object?.resources) + ? object.resources.map((e: any) => ResourceUnit.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GroupSpec): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.requirements !== undefined) { + obj.requirements = PlacementRequirements.toJSON(message.requirements); + } + if (message.resources?.length) { + obj.resources = message.resources.map((e) => ResourceUnit.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): GroupSpec { + return GroupSpec.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GroupSpec { + const message = createBaseGroupSpec(); + message.name = object.name ?? ''; + message.requirements = + object.requirements !== undefined && object.requirements !== null + ? PlacementRequirements.fromPartial(object.requirements) + : undefined; + message.resources = + object.resources?.map((e) => ResourceUnit.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GroupSpec.$type, GroupSpec); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/params.ts b/ts/src/generated/akash/deployment/v1beta3/params.ts new file mode 100644 index 00000000..91e888d0 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/params.ts @@ -0,0 +1,117 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** Params defines the parameters for the x/deployment package */ +export interface Params { + $type: 'akash.deployment.v1beta3.Params'; + minDeposits: Coin[]; +} + +function createBaseParams(): Params { + return { $type: 'akash.deployment.v1beta3.Params', minDeposits: [] }; +} + +export const Params = { + $type: 'akash.deployment.v1beta3.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.minDeposits) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.minDeposits.push(Coin.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + minDeposits: globalThis.Array.isArray(object?.minDeposits) + ? object.minDeposits.map((e: any) => Coin.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.minDeposits?.length) { + obj.minDeposits = message.minDeposits.map((e) => Coin.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.minDeposits = + object.minDeposits?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/deployment/v1beta3/query.ts b/ts/src/generated/akash/deployment/v1beta3/query.ts new file mode 100644 index 00000000..44bbc6e7 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/query.ts @@ -0,0 +1,729 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account } from '../../escrow/v1beta3/types'; +import { Deployment, DeploymentFilters, DeploymentID } from './deployment'; +import { Group } from './group'; +import { GroupID } from './groupid'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** QueryDeploymentsRequest is request type for the Query/Deployments RPC method */ +export interface QueryDeploymentsRequest { + $type: 'akash.deployment.v1beta3.QueryDeploymentsRequest'; + filters: DeploymentFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryDeploymentsResponse is response type for the Query/Deployments RPC method */ +export interface QueryDeploymentsResponse { + $type: 'akash.deployment.v1beta3.QueryDeploymentsResponse'; + deployments: QueryDeploymentResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryDeploymentRequest is request type for the Query/Deployment RPC method */ +export interface QueryDeploymentRequest { + $type: 'akash.deployment.v1beta3.QueryDeploymentRequest'; + id: DeploymentID | undefined; +} + +/** QueryDeploymentResponse is response type for the Query/Deployment RPC method */ +export interface QueryDeploymentResponse { + $type: 'akash.deployment.v1beta3.QueryDeploymentResponse'; + deployment: Deployment | undefined; + groups: Group[]; + escrowAccount: Account | undefined; +} + +/** QueryGroupRequest is request type for the Query/Group RPC method */ +export interface QueryGroupRequest { + $type: 'akash.deployment.v1beta3.QueryGroupRequest'; + id: GroupID | undefined; +} + +/** QueryGroupResponse is response type for the Query/Group RPC method */ +export interface QueryGroupResponse { + $type: 'akash.deployment.v1beta3.QueryGroupResponse'; + group: Group | undefined; +} + +function createBaseQueryDeploymentsRequest(): QueryDeploymentsRequest { + return { + $type: 'akash.deployment.v1beta3.QueryDeploymentsRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryDeploymentsRequest = { + $type: 'akash.deployment.v1beta3.QueryDeploymentsRequest' as const, + + encode( + message: QueryDeploymentsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + DeploymentFilters.encode( + message.filters, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = DeploymentFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentsRequest { + return { + $type: QueryDeploymentsRequest.$type, + filters: isSet(object.filters) + ? DeploymentFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentsRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = DeploymentFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentsRequest { + return QueryDeploymentsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentsRequest { + const message = createBaseQueryDeploymentsRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? DeploymentFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentsRequest.$type, QueryDeploymentsRequest); + +function createBaseQueryDeploymentsResponse(): QueryDeploymentsResponse { + return { + $type: 'akash.deployment.v1beta3.QueryDeploymentsResponse', + deployments: [], + pagination: undefined, + }; +} + +export const QueryDeploymentsResponse = { + $type: 'akash.deployment.v1beta3.QueryDeploymentsResponse' as const, + + encode( + message: QueryDeploymentsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.deployments) { + QueryDeploymentResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployments.push( + QueryDeploymentResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentsResponse { + return { + $type: QueryDeploymentsResponse.$type, + deployments: globalThis.Array.isArray(object?.deployments) + ? object.deployments.map((e: any) => + QueryDeploymentResponse.fromJSON(e), + ) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentsResponse): unknown { + const obj: any = {}; + if (message.deployments?.length) { + obj.deployments = message.deployments.map((e) => + QueryDeploymentResponse.toJSON(e), + ); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentsResponse { + return QueryDeploymentsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentsResponse { + const message = createBaseQueryDeploymentsResponse(); + message.deployments = + object.deployments?.map((e) => QueryDeploymentResponse.fromPartial(e)) || + []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + QueryDeploymentsResponse.$type, + QueryDeploymentsResponse, +); + +function createBaseQueryDeploymentRequest(): QueryDeploymentRequest { + return { + $type: 'akash.deployment.v1beta3.QueryDeploymentRequest', + id: undefined, + }; +} + +export const QueryDeploymentRequest = { + $type: 'akash.deployment.v1beta3.QueryDeploymentRequest' as const, + + encode( + message: QueryDeploymentRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + DeploymentID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = DeploymentID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentRequest { + return { + $type: QueryDeploymentRequest.$type, + id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryDeploymentRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = DeploymentID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentRequest { + return QueryDeploymentRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentRequest { + const message = createBaseQueryDeploymentRequest(); + message.id = + object.id !== undefined && object.id !== null + ? DeploymentID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentRequest.$type, QueryDeploymentRequest); + +function createBaseQueryDeploymentResponse(): QueryDeploymentResponse { + return { + $type: 'akash.deployment.v1beta3.QueryDeploymentResponse', + deployment: undefined, + groups: [], + escrowAccount: undefined, + }; +} + +export const QueryDeploymentResponse = { + $type: 'akash.deployment.v1beta3.QueryDeploymentResponse' as const, + + encode( + message: QueryDeploymentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deployment !== undefined) { + Deployment.encode(message.deployment, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.escrowAccount !== undefined) { + Account.encode(message.escrowAccount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDeploymentResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDeploymentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.deployment = Deployment.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.groups.push(Group.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.escrowAccount = Account.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDeploymentResponse { + return { + $type: QueryDeploymentResponse.$type, + deployment: isSet(object.deployment) + ? Deployment.fromJSON(object.deployment) + : undefined, + groups: globalThis.Array.isArray(object?.groups) + ? object.groups.map((e: any) => Group.fromJSON(e)) + : [], + escrowAccount: isSet(object.escrowAccount) + ? Account.fromJSON(object.escrowAccount) + : undefined, + }; + }, + + toJSON(message: QueryDeploymentResponse): unknown { + const obj: any = {}; + if (message.deployment !== undefined) { + obj.deployment = Deployment.toJSON(message.deployment); + } + if (message.groups?.length) { + obj.groups = message.groups.map((e) => Group.toJSON(e)); + } + if (message.escrowAccount !== undefined) { + obj.escrowAccount = Account.toJSON(message.escrowAccount); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryDeploymentResponse { + return QueryDeploymentResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryDeploymentResponse { + const message = createBaseQueryDeploymentResponse(); + message.deployment = + object.deployment !== undefined && object.deployment !== null + ? Deployment.fromPartial(object.deployment) + : undefined; + message.groups = object.groups?.map((e) => Group.fromPartial(e)) || []; + message.escrowAccount = + object.escrowAccount !== undefined && object.escrowAccount !== null + ? Account.fromPartial(object.escrowAccount) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryDeploymentResponse.$type, QueryDeploymentResponse); + +function createBaseQueryGroupRequest(): QueryGroupRequest { + return { $type: 'akash.deployment.v1beta3.QueryGroupRequest', id: undefined }; +} + +export const QueryGroupRequest = { + $type: 'akash.deployment.v1beta3.QueryGroupRequest' as const, + + encode( + message: QueryGroupRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + GroupID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = GroupID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryGroupRequest { + return { + $type: QueryGroupRequest.$type, + id: isSet(object.id) ? GroupID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryGroupRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = GroupID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryGroupRequest { + return QueryGroupRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryGroupRequest { + const message = createBaseQueryGroupRequest(); + message.id = + object.id !== undefined && object.id !== null + ? GroupID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryGroupRequest.$type, QueryGroupRequest); + +function createBaseQueryGroupResponse(): QueryGroupResponse { + return { + $type: 'akash.deployment.v1beta3.QueryGroupResponse', + group: undefined, + }; +} + +export const QueryGroupResponse = { + $type: 'akash.deployment.v1beta3.QueryGroupResponse' as const, + + encode( + message: QueryGroupResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.group !== undefined) { + Group.encode(message.group, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.group = Group.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryGroupResponse { + return { + $type: QueryGroupResponse.$type, + group: isSet(object.group) ? Group.fromJSON(object.group) : undefined, + }; + }, + + toJSON(message: QueryGroupResponse): unknown { + const obj: any = {}; + if (message.group !== undefined) { + obj.group = Group.toJSON(message.group); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryGroupResponse { + return QueryGroupResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryGroupResponse { + const message = createBaseQueryGroupResponse(); + message.group = + object.group !== undefined && object.group !== null + ? Group.fromPartial(object.group) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryGroupResponse.$type, QueryGroupResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Deployments queries deployments */ + Deployments( + request: QueryDeploymentsRequest, + ): Promise; + /** Deployment queries deployment details */ + Deployment(request: QueryDeploymentRequest): Promise; + /** Group queries group details */ + Group(request: QueryGroupRequest): Promise; +} + +export const QueryServiceName = 'akash.deployment.v1beta3.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Deployments = this.Deployments.bind(this); + this.Deployment = this.Deployment.bind(this); + this.Group = this.Group.bind(this); + } + Deployments( + request: QueryDeploymentsRequest, + ): Promise { + const data = QueryDeploymentsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Deployments', data); + return promise.then((data) => + QueryDeploymentsResponse.decode(_m0.Reader.create(data)), + ); + } + + Deployment( + request: QueryDeploymentRequest, + ): Promise { + const data = QueryDeploymentRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Deployment', data); + return promise.then((data) => + QueryDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + Group(request: QueryGroupRequest): Promise { + const data = QueryGroupRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Group', data); + return promise.then((data) => + QueryGroupResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/resourceunit.ts b/ts/src/generated/akash/deployment/v1beta3/resourceunit.ts new file mode 100644 index 00000000..6bab1922 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/resourceunit.ts @@ -0,0 +1,168 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Resources } from '../../base/v1beta3/resources'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** ResourceUnit extends Resources and adds Count along with the Price */ +export interface ResourceUnit { + $type: 'akash.deployment.v1beta3.ResourceUnit'; + resource: Resources | undefined; + count: number; + price: DecCoin | undefined; +} + +function createBaseResourceUnit(): ResourceUnit { + return { + $type: 'akash.deployment.v1beta3.ResourceUnit', + resource: undefined, + count: 0, + price: undefined, + }; +} + +export const ResourceUnit = { + $type: 'akash.deployment.v1beta3.ResourceUnit' as const, + + encode( + message: ResourceUnit, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.resource !== undefined) { + Resources.encode(message.resource, writer.uint32(10).fork()).ldelim(); + } + if (message.count !== 0) { + writer.uint32(16).uint32(message.count); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceUnit { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceUnit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resource = Resources.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.count = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourceUnit { + return { + $type: ResourceUnit.$type, + resource: isSet(object.resource) + ? Resources.fromJSON(object.resource) + : undefined, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + }; + }, + + toJSON(message: ResourceUnit): unknown { + const obj: any = {}; + if (message.resource !== undefined) { + obj.resource = Resources.toJSON(message.resource); + } + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourceUnit { + return ResourceUnit.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourceUnit { + const message = createBaseResourceUnit(); + message.resource = + object.resource !== undefined && object.resource !== null + ? Resources.fromPartial(object.resource) + : undefined; + message.count = object.count ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ResourceUnit.$type, ResourceUnit); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/deployment/v1beta3/service.ts b/ts/src/generated/akash/deployment/v1beta3/service.ts new file mode 100644 index 00000000..2ceea5e0 --- /dev/null +++ b/ts/src/generated/akash/deployment/v1beta3/service.ts @@ -0,0 +1,136 @@ +/* eslint-disable */ +import _m0 from 'protobufjs/minimal'; +import { + MsgCloseDeployment, + MsgCloseDeploymentResponse, + MsgCreateDeployment, + MsgCreateDeploymentResponse, + MsgDepositDeployment, + MsgDepositDeploymentResponse, + MsgUpdateDeployment, + MsgUpdateDeploymentResponse, +} from './deploymentmsg'; +import { + MsgCloseGroup, + MsgCloseGroupResponse, + MsgPauseGroup, + MsgPauseGroupResponse, + MsgStartGroup, + MsgStartGroupResponse, +} from './groupmsg'; + +export const protobufPackage = 'akash.deployment.v1beta3'; + +/** Msg defines the deployment Msg service. */ +export interface Msg { + /** CreateDeployment defines a method to create new deployment given proper inputs. */ + CreateDeployment( + request: MsgCreateDeployment, + ): Promise; + /** DepositDeployment deposits more funds into the deployment account */ + DepositDeployment( + request: MsgDepositDeployment, + ): Promise; + /** UpdateDeployment defines a method to update a deployment given proper inputs. */ + UpdateDeployment( + request: MsgUpdateDeployment, + ): Promise; + /** CloseDeployment defines a method to close a deployment given proper inputs. */ + CloseDeployment( + request: MsgCloseDeployment, + ): Promise; + /** CloseGroup defines a method to close a group of a deployment given proper inputs. */ + CloseGroup(request: MsgCloseGroup): Promise; + /** PauseGroup defines a method to close a group of a deployment given proper inputs. */ + PauseGroup(request: MsgPauseGroup): Promise; + /** StartGroup defines a method to close a group of a deployment given proper inputs. */ + StartGroup(request: MsgStartGroup): Promise; +} + +export const MsgServiceName = 'akash.deployment.v1beta3.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateDeployment = this.CreateDeployment.bind(this); + this.DepositDeployment = this.DepositDeployment.bind(this); + this.UpdateDeployment = this.UpdateDeployment.bind(this); + this.CloseDeployment = this.CloseDeployment.bind(this); + this.CloseGroup = this.CloseGroup.bind(this); + this.PauseGroup = this.PauseGroup.bind(this); + this.StartGroup = this.StartGroup.bind(this); + } + CreateDeployment( + request: MsgCreateDeployment, + ): Promise { + const data = MsgCreateDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateDeployment', data); + return promise.then((data) => + MsgCreateDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + DepositDeployment( + request: MsgDepositDeployment, + ): Promise { + const data = MsgDepositDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'DepositDeployment', data); + return promise.then((data) => + MsgDepositDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + UpdateDeployment( + request: MsgUpdateDeployment, + ): Promise { + const data = MsgUpdateDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'UpdateDeployment', data); + return promise.then((data) => + MsgUpdateDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseDeployment( + request: MsgCloseDeployment, + ): Promise { + const data = MsgCloseDeployment.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseDeployment', data); + return promise.then((data) => + MsgCloseDeploymentResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseGroup(request: MsgCloseGroup): Promise { + const data = MsgCloseGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseGroup', data); + return promise.then((data) => + MsgCloseGroupResponse.decode(_m0.Reader.create(data)), + ); + } + + PauseGroup(request: MsgPauseGroup): Promise { + const data = MsgPauseGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'PauseGroup', data); + return promise.then((data) => + MsgPauseGroupResponse.decode(_m0.Reader.create(data)), + ); + } + + StartGroup(request: MsgStartGroup): Promise { + const data = MsgStartGroup.encode(request).finish(); + const promise = this.rpc.request(this.service, 'StartGroup', data); + return promise.then((data) => + MsgStartGroupResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} diff --git a/ts/src/generated/akash/discovery/v1/akash.ts b/ts/src/generated/akash/discovery/v1/akash.ts new file mode 100644 index 00000000..325aba5c --- /dev/null +++ b/ts/src/generated/akash/discovery/v1/akash.ts @@ -0,0 +1,120 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ClientInfo } from './client_info'; + +export const protobufPackage = 'akash.discovery.v1'; + +/** Akash akash specific RPC parameters */ +export interface Akash { + $type: 'akash.discovery.v1.Akash'; + clientInfo: ClientInfo | undefined; +} + +function createBaseAkash(): Akash { + return { $type: 'akash.discovery.v1.Akash', clientInfo: undefined }; +} + +export const Akash = { + $type: 'akash.discovery.v1.Akash' as const, + + encode(message: Akash, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientInfo !== undefined) { + ClientInfo.encode(message.clientInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Akash { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAkash(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.clientInfo = ClientInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Akash { + return { + $type: Akash.$type, + clientInfo: isSet(object.clientInfo) + ? ClientInfo.fromJSON(object.clientInfo) + : undefined, + }; + }, + + toJSON(message: Akash): unknown { + const obj: any = {}; + if (message.clientInfo !== undefined) { + obj.clientInfo = ClientInfo.toJSON(message.clientInfo); + } + return obj; + }, + + create, I>>(base?: I): Akash { + return Akash.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Akash { + const message = createBaseAkash(); + message.clientInfo = + object.clientInfo !== undefined && object.clientInfo !== null + ? ClientInfo.fromPartial(object.clientInfo) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Akash.$type, Akash); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/discovery/v1/client_info.ts b/ts/src/generated/akash/discovery/v1/client_info.ts new file mode 100644 index 00000000..f7be020e --- /dev/null +++ b/ts/src/generated/akash/discovery/v1/client_info.ts @@ -0,0 +1,121 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.discovery.v1'; + +/** ClientInfo akash specific client info */ +export interface ClientInfo { + $type: 'akash.discovery.v1.ClientInfo'; + apiVersion: string; +} + +function createBaseClientInfo(): ClientInfo { + return { $type: 'akash.discovery.v1.ClientInfo', apiVersion: '' }; +} + +export const ClientInfo = { + $type: 'akash.discovery.v1.ClientInfo' as const, + + encode( + message: ClientInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.apiVersion !== '') { + writer.uint32(10).string(message.apiVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.apiVersion = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ClientInfo { + return { + $type: ClientInfo.$type, + apiVersion: isSet(object.apiVersion) + ? globalThis.String(object.apiVersion) + : '', + }; + }, + + toJSON(message: ClientInfo): unknown { + const obj: any = {}; + if (message.apiVersion !== '') { + obj.apiVersion = message.apiVersion; + } + return obj; + }, + + create, I>>(base?: I): ClientInfo { + return ClientInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ClientInfo { + const message = createBaseClientInfo(); + message.apiVersion = object.apiVersion ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(ClientInfo.$type, ClientInfo); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/escrow/v1beta1/genesis.ts b/ts/src/generated/akash/escrow/v1beta1/genesis.ts new file mode 100644 index 00000000..8628a1b7 --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta1/genesis.ts @@ -0,0 +1,144 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, Payment } from './types'; + +export const protobufPackage = 'akash.escrow.v1beta1'; + +/** GenesisState defines the basic genesis state used by escrow module */ +export interface GenesisState { + $type: 'akash.escrow.v1beta1.GenesisState'; + accounts: Account[]; + payments: Payment[]; +} + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.escrow.v1beta1.GenesisState', + accounts: [], + payments: [], + }; +} + +export const GenesisState = { + $type: 'akash.escrow.v1beta1.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.accounts) { + Account.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.payments) { + Payment.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accounts.push(Account.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.payments.push(Payment.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + accounts: globalThis.Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Account.fromJSON(e)) + : [], + payments: globalThis.Array.isArray(object?.payments) + ? object.payments.map((e: any) => Payment.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.accounts?.length) { + obj.accounts = message.accounts.map((e) => Account.toJSON(e)); + } + if (message.payments?.length) { + obj.payments = message.payments.map((e) => Payment.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.accounts = + object.accounts?.map((e) => Account.fromPartial(e)) || []; + message.payments = + object.payments?.map((e) => Payment.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/escrow/v1beta1/query.ts b/ts/src/generated/akash/escrow/v1beta1/query.ts new file mode 100644 index 00000000..030e7695 --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta1/query.ts @@ -0,0 +1,654 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, Payment } from './types'; + +export const protobufPackage = 'akash.escrow.v1beta1'; + +/** QueryAccountRequest is request type for the Query/Account RPC method */ +export interface QueryAccountsRequest { + $type: 'akash.escrow.v1beta1.QueryAccountsRequest'; + scope: string; + xid: string; + owner: string; + state: string; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryAccountsResponse { + $type: 'akash.escrow.v1beta1.QueryAccountsResponse'; + accounts: Account[]; + pagination: PageResponse | undefined; +} + +/** QueryPaymentRequest is request type for the Query/Payment RPC method */ +export interface QueryPaymentsRequest { + $type: 'akash.escrow.v1beta1.QueryPaymentsRequest'; + scope: string; + xid: string; + id: string; + owner: string; + state: string; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryPaymentsResponse { + $type: 'akash.escrow.v1beta1.QueryPaymentsResponse'; + payments: Payment[]; + pagination: PageResponse | undefined; +} + +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { + $type: 'akash.escrow.v1beta1.QueryAccountsRequest', + scope: '', + xid: '', + owner: '', + state: '', + pagination: undefined, + }; +} + +export const QueryAccountsRequest = { + $type: 'akash.escrow.v1beta1.QueryAccountsRequest' as const, + + encode( + message: QueryAccountsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + if (message.owner !== '') { + writer.uint32(26).string(message.owner); + } + if (message.state !== '') { + writer.uint32(34).string(message.state); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAccountsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.owner = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.state = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAccountsRequest { + return { + $type: QueryAccountsRequest.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAccountsRequest): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== '') { + obj.state = message.state; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAccountsRequest { + return QueryAccountsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryAccountsRequest.$type, QueryAccountsRequest); + +function createBaseQueryAccountsResponse(): QueryAccountsResponse { + return { + $type: 'akash.escrow.v1beta1.QueryAccountsResponse', + accounts: [], + pagination: undefined, + }; +} + +export const QueryAccountsResponse = { + $type: 'akash.escrow.v1beta1.QueryAccountsResponse' as const, + + encode( + message: QueryAccountsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.accounts) { + Account.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAccountsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accounts.push(Account.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAccountsResponse { + return { + $type: QueryAccountsResponse.$type, + accounts: globalThis.Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Account.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts?.length) { + obj.accounts = message.accounts.map((e) => Account.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAccountsResponse { + return QueryAccountsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = + object.accounts?.map((e) => Account.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryAccountsResponse.$type, QueryAccountsResponse); + +function createBaseQueryPaymentsRequest(): QueryPaymentsRequest { + return { + $type: 'akash.escrow.v1beta1.QueryPaymentsRequest', + scope: '', + xid: '', + id: '', + owner: '', + state: '', + pagination: undefined, + }; +} + +export const QueryPaymentsRequest = { + $type: 'akash.escrow.v1beta1.QueryPaymentsRequest' as const, + + encode( + message: QueryPaymentsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + if (message.id !== '') { + writer.uint32(26).string(message.id); + } + if (message.owner !== '') { + writer.uint32(34).string(message.owner); + } + if (message.state !== '') { + writer.uint32(42).string(message.state); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryPaymentsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPaymentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.id = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.owner = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.state = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryPaymentsRequest { + return { + $type: QueryPaymentsRequest.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + id: isSet(object.id) ? globalThis.String(object.id) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryPaymentsRequest): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + if (message.id !== '') { + obj.id = message.id; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== '') { + obj.state = message.state; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryPaymentsRequest { + return QueryPaymentsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryPaymentsRequest { + const message = createBaseQueryPaymentsRequest(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + message.id = object.id ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryPaymentsRequest.$type, QueryPaymentsRequest); + +function createBaseQueryPaymentsResponse(): QueryPaymentsResponse { + return { + $type: 'akash.escrow.v1beta1.QueryPaymentsResponse', + payments: [], + pagination: undefined, + }; +} + +export const QueryPaymentsResponse = { + $type: 'akash.escrow.v1beta1.QueryPaymentsResponse' as const, + + encode( + message: QueryPaymentsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.payments) { + Payment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryPaymentsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPaymentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.payments.push(Payment.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryPaymentsResponse { + return { + $type: QueryPaymentsResponse.$type, + payments: globalThis.Array.isArray(object?.payments) + ? object.payments.map((e: any) => Payment.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryPaymentsResponse): unknown { + const obj: any = {}; + if (message.payments?.length) { + obj.payments = message.payments.map((e) => Payment.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryPaymentsResponse { + return QueryPaymentsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryPaymentsResponse { + const message = createBaseQueryPaymentsResponse(); + message.payments = + object.payments?.map((e) => Payment.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryPaymentsResponse.$type, QueryPaymentsResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + * Accounts queries all accounts + */ + Accounts(request: QueryAccountsRequest): Promise; + /** + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + * Payments queries all payments + */ + Payments(request: QueryPaymentsRequest): Promise; +} + +export const QueryServiceName = 'akash.escrow.v1beta1.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Accounts = this.Accounts.bind(this); + this.Payments = this.Payments.bind(this); + } + Accounts(request: QueryAccountsRequest): Promise { + const data = QueryAccountsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Accounts', data); + return promise.then((data) => + QueryAccountsResponse.decode(_m0.Reader.create(data)), + ); + } + + Payments(request: QueryPaymentsRequest): Promise { + const data = QueryPaymentsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Payments', data); + return promise.then((data) => + QueryPaymentsResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/escrow/v1beta1/types.ts b/ts/src/generated/akash/escrow/v1beta1/types.ts new file mode 100644 index 00000000..00cc2862 --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta1/types.ts @@ -0,0 +1,621 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.escrow.v1beta1'; + +/** AccountID is the account identifier */ +export interface AccountID { + $type: 'akash.escrow.v1beta1.AccountID'; + scope: string; + xid: string; +} + +/** Account stores state for an escrow account */ +export interface Account { + $type: 'akash.escrow.v1beta1.Account'; + /** unique identifier for this escrow account */ + id: AccountID | undefined; + /** bech32 encoded account address of the owner of this escrow account */ + owner: string; + /** current state of this escrow account */ + state: Account_State; + /** unspent coins received from the owner's wallet */ + balance: Coin | undefined; + /** total coins spent by this account */ + transferred: Coin | undefined; + /** block height at which this account was last settled */ + settledAt: Long; +} + +/** State stores state for an escrow account */ +export enum Account_State { + /** invalid - AccountStateInvalid is an invalid state */ + invalid = 0, + /** open - AccountOpen is the state when an account is open */ + open = 1, + /** closed - AccountClosed is the state when an account is closed */ + closed = 2, + /** overdrawn - AccountOverdrawn is the state when an account is overdrawn */ + overdrawn = 3, + UNRECOGNIZED = -1, +} + +export function account_StateFromJSON(object: any): Account_State { + switch (object) { + case 0: + case 'invalid': + return Account_State.invalid; + case 1: + case 'open': + return Account_State.open; + case 2: + case 'closed': + return Account_State.closed; + case 3: + case 'overdrawn': + return Account_State.overdrawn; + case -1: + case 'UNRECOGNIZED': + default: + return Account_State.UNRECOGNIZED; + } +} + +export function account_StateToJSON(object: Account_State): string { + switch (object) { + case Account_State.invalid: + return 'invalid'; + case Account_State.open: + return 'open'; + case Account_State.closed: + return 'closed'; + case Account_State.overdrawn: + return 'overdrawn'; + case Account_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** Payment stores state for a payment */ +export interface Payment { + $type: 'akash.escrow.v1beta1.Payment'; + accountId: AccountID | undefined; + paymentId: string; + owner: string; + state: Payment_State; + rate: Coin | undefined; + balance: Coin | undefined; + withdrawn: Coin | undefined; +} + +/** Payment State */ +export enum Payment_State { + /** invalid - PaymentStateInvalid is the state when the payment is invalid */ + invalid = 0, + /** open - PaymentStateOpen is the state when the payment is open */ + open = 1, + /** closed - PaymentStateClosed is the state when the payment is closed */ + closed = 2, + /** overdrawn - PaymentStateOverdrawn is the state when the payment is overdrawn */ + overdrawn = 3, + UNRECOGNIZED = -1, +} + +export function payment_StateFromJSON(object: any): Payment_State { + switch (object) { + case 0: + case 'invalid': + return Payment_State.invalid; + case 1: + case 'open': + return Payment_State.open; + case 2: + case 'closed': + return Payment_State.closed; + case 3: + case 'overdrawn': + return Payment_State.overdrawn; + case -1: + case 'UNRECOGNIZED': + default: + return Payment_State.UNRECOGNIZED; + } +} + +export function payment_StateToJSON(object: Payment_State): string { + switch (object) { + case Payment_State.invalid: + return 'invalid'; + case Payment_State.open: + return 'open'; + case Payment_State.closed: + return 'closed'; + case Payment_State.overdrawn: + return 'overdrawn'; + case Payment_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseAccountID(): AccountID { + return { $type: 'akash.escrow.v1beta1.AccountID', scope: '', xid: '' }; +} + +export const AccountID = { + $type: 'akash.escrow.v1beta1.AccountID' as const, + + encode( + message: AccountID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccountID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountID { + return { + $type: AccountID.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + }; + }, + + toJSON(message: AccountID): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + return obj; + }, + + create, I>>(base?: I): AccountID { + return AccountID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AccountID { + const message = createBaseAccountID(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(AccountID.$type, AccountID); + +function createBaseAccount(): Account { + return { + $type: 'akash.escrow.v1beta1.Account', + id: undefined, + owner: '', + state: 0, + balance: undefined, + transferred: undefined, + settledAt: Long.ZERO, + }; +} + +export const Account = { + $type: 'akash.escrow.v1beta1.Account' as const, + + encode( + message: Account, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + AccountID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(34).fork()).ldelim(); + } + if (message.transferred !== undefined) { + Coin.encode(message.transferred, writer.uint32(42).fork()).ldelim(); + } + if (!message.settledAt.equals(Long.ZERO)) { + writer.uint32(48).int64(message.settledAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Account { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = AccountID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owner = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.state = reader.int32() as any; + continue; + case 4: + if (tag !== 34) { + break; + } + + message.balance = Coin.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.transferred = Coin.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.settledAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Account { + return { + $type: Account.$type, + id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + balance: isSet(object.balance) + ? Coin.fromJSON(object.balance) + : undefined, + transferred: isSet(object.transferred) + ? Coin.fromJSON(object.transferred) + : undefined, + settledAt: isSet(object.settledAt) + ? Long.fromValue(object.settledAt) + : Long.ZERO, + }; + }, + + toJSON(message: Account): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = AccountID.toJSON(message.id); + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== 0) { + obj.state = account_StateToJSON(message.state); + } + if (message.balance !== undefined) { + obj.balance = Coin.toJSON(message.balance); + } + if (message.transferred !== undefined) { + obj.transferred = Coin.toJSON(message.transferred); + } + if (!message.settledAt.equals(Long.ZERO)) { + obj.settledAt = (message.settledAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Account { + return Account.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Account { + const message = createBaseAccount(); + message.id = + object.id !== undefined && object.id !== null + ? AccountID.fromPartial(object.id) + : undefined; + message.owner = object.owner ?? ''; + message.state = object.state ?? 0; + message.balance = + object.balance !== undefined && object.balance !== null + ? Coin.fromPartial(object.balance) + : undefined; + message.transferred = + object.transferred !== undefined && object.transferred !== null + ? Coin.fromPartial(object.transferred) + : undefined; + message.settledAt = + object.settledAt !== undefined && object.settledAt !== null + ? Long.fromValue(object.settledAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Account.$type, Account); + +function createBasePayment(): Payment { + return { + $type: 'akash.escrow.v1beta1.Payment', + accountId: undefined, + paymentId: '', + owner: '', + state: 0, + rate: undefined, + balance: undefined, + withdrawn: undefined, + }; +} + +export const Payment = { + $type: 'akash.escrow.v1beta1.Payment' as const, + + encode( + message: Payment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.accountId !== undefined) { + AccountID.encode(message.accountId, writer.uint32(10).fork()).ldelim(); + } + if (message.paymentId !== '') { + writer.uint32(18).string(message.paymentId); + } + if (message.owner !== '') { + writer.uint32(26).string(message.owner); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.rate !== undefined) { + Coin.encode(message.rate, writer.uint32(42).fork()).ldelim(); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(50).fork()).ldelim(); + } + if (message.withdrawn !== undefined) { + Coin.encode(message.withdrawn, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Payment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePayment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accountId = AccountID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.paymentId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.owner = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.state = reader.int32() as any; + continue; + case 5: + if (tag !== 42) { + break; + } + + message.rate = Coin.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.balance = Coin.decode(reader, reader.uint32()); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.withdrawn = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Payment { + return { + $type: Payment.$type, + accountId: isSet(object.accountId) + ? AccountID.fromJSON(object.accountId) + : undefined, + paymentId: isSet(object.paymentId) + ? globalThis.String(object.paymentId) + : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + rate: isSet(object.rate) ? Coin.fromJSON(object.rate) : undefined, + balance: isSet(object.balance) + ? Coin.fromJSON(object.balance) + : undefined, + withdrawn: isSet(object.withdrawn) + ? Coin.fromJSON(object.withdrawn) + : undefined, + }; + }, + + toJSON(message: Payment): unknown { + const obj: any = {}; + if (message.accountId !== undefined) { + obj.accountId = AccountID.toJSON(message.accountId); + } + if (message.paymentId !== '') { + obj.paymentId = message.paymentId; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== 0) { + obj.state = payment_StateToJSON(message.state); + } + if (message.rate !== undefined) { + obj.rate = Coin.toJSON(message.rate); + } + if (message.balance !== undefined) { + obj.balance = Coin.toJSON(message.balance); + } + if (message.withdrawn !== undefined) { + obj.withdrawn = Coin.toJSON(message.withdrawn); + } + return obj; + }, + + create, I>>(base?: I): Payment { + return Payment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Payment { + const message = createBasePayment(); + message.accountId = + object.accountId !== undefined && object.accountId !== null + ? AccountID.fromPartial(object.accountId) + : undefined; + message.paymentId = object.paymentId ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? 0; + message.rate = + object.rate !== undefined && object.rate !== null + ? Coin.fromPartial(object.rate) + : undefined; + message.balance = + object.balance !== undefined && object.balance !== null + ? Coin.fromPartial(object.balance) + : undefined; + message.withdrawn = + object.withdrawn !== undefined && object.withdrawn !== null + ? Coin.fromPartial(object.withdrawn) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Payment.$type, Payment); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/escrow/v1beta2/genesis.ts b/ts/src/generated/akash/escrow/v1beta2/genesis.ts new file mode 100644 index 00000000..99ee67f3 --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta2/genesis.ts @@ -0,0 +1,146 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, FractionalPayment } from './types'; + +export const protobufPackage = 'akash.escrow.v1beta2'; + +/** GenesisState defines the basic genesis state used by escrow module */ +export interface GenesisState { + $type: 'akash.escrow.v1beta2.GenesisState'; + accounts: Account[]; + payments: FractionalPayment[]; +} + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.escrow.v1beta2.GenesisState', + accounts: [], + payments: [], + }; +} + +export const GenesisState = { + $type: 'akash.escrow.v1beta2.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.accounts) { + Account.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.payments) { + FractionalPayment.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accounts.push(Account.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.payments.push( + FractionalPayment.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + accounts: globalThis.Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Account.fromJSON(e)) + : [], + payments: globalThis.Array.isArray(object?.payments) + ? object.payments.map((e: any) => FractionalPayment.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.accounts?.length) { + obj.accounts = message.accounts.map((e) => Account.toJSON(e)); + } + if (message.payments?.length) { + obj.payments = message.payments.map((e) => FractionalPayment.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.accounts = + object.accounts?.map((e) => Account.fromPartial(e)) || []; + message.payments = + object.payments?.map((e) => FractionalPayment.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/escrow/v1beta2/query.ts b/ts/src/generated/akash/escrow/v1beta2/query.ts new file mode 100644 index 00000000..dba8c198 --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta2/query.ts @@ -0,0 +1,656 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, FractionalPayment } from './types'; + +export const protobufPackage = 'akash.escrow.v1beta2'; + +/** QueryAccountRequest is request type for the Query/Account RPC method */ +export interface QueryAccountsRequest { + $type: 'akash.escrow.v1beta2.QueryAccountsRequest'; + scope: string; + xid: string; + owner: string; + state: string; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryAccountsResponse { + $type: 'akash.escrow.v1beta2.QueryAccountsResponse'; + accounts: Account[]; + pagination: PageResponse | undefined; +} + +/** QueryPaymentRequest is request type for the Query/Payment RPC method */ +export interface QueryPaymentsRequest { + $type: 'akash.escrow.v1beta2.QueryPaymentsRequest'; + scope: string; + xid: string; + id: string; + owner: string; + state: string; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryPaymentsResponse { + $type: 'akash.escrow.v1beta2.QueryPaymentsResponse'; + payments: FractionalPayment[]; + pagination: PageResponse | undefined; +} + +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { + $type: 'akash.escrow.v1beta2.QueryAccountsRequest', + scope: '', + xid: '', + owner: '', + state: '', + pagination: undefined, + }; +} + +export const QueryAccountsRequest = { + $type: 'akash.escrow.v1beta2.QueryAccountsRequest' as const, + + encode( + message: QueryAccountsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + if (message.owner !== '') { + writer.uint32(26).string(message.owner); + } + if (message.state !== '') { + writer.uint32(34).string(message.state); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAccountsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.owner = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.state = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAccountsRequest { + return { + $type: QueryAccountsRequest.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAccountsRequest): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== '') { + obj.state = message.state; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAccountsRequest { + return QueryAccountsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryAccountsRequest.$type, QueryAccountsRequest); + +function createBaseQueryAccountsResponse(): QueryAccountsResponse { + return { + $type: 'akash.escrow.v1beta2.QueryAccountsResponse', + accounts: [], + pagination: undefined, + }; +} + +export const QueryAccountsResponse = { + $type: 'akash.escrow.v1beta2.QueryAccountsResponse' as const, + + encode( + message: QueryAccountsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.accounts) { + Account.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAccountsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accounts.push(Account.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAccountsResponse { + return { + $type: QueryAccountsResponse.$type, + accounts: globalThis.Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Account.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts?.length) { + obj.accounts = message.accounts.map((e) => Account.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAccountsResponse { + return QueryAccountsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = + object.accounts?.map((e) => Account.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryAccountsResponse.$type, QueryAccountsResponse); + +function createBaseQueryPaymentsRequest(): QueryPaymentsRequest { + return { + $type: 'akash.escrow.v1beta2.QueryPaymentsRequest', + scope: '', + xid: '', + id: '', + owner: '', + state: '', + pagination: undefined, + }; +} + +export const QueryPaymentsRequest = { + $type: 'akash.escrow.v1beta2.QueryPaymentsRequest' as const, + + encode( + message: QueryPaymentsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + if (message.id !== '') { + writer.uint32(26).string(message.id); + } + if (message.owner !== '') { + writer.uint32(34).string(message.owner); + } + if (message.state !== '') { + writer.uint32(42).string(message.state); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryPaymentsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPaymentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.id = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.owner = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.state = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryPaymentsRequest { + return { + $type: QueryPaymentsRequest.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + id: isSet(object.id) ? globalThis.String(object.id) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryPaymentsRequest): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + if (message.id !== '') { + obj.id = message.id; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== '') { + obj.state = message.state; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryPaymentsRequest { + return QueryPaymentsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryPaymentsRequest { + const message = createBaseQueryPaymentsRequest(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + message.id = object.id ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryPaymentsRequest.$type, QueryPaymentsRequest); + +function createBaseQueryPaymentsResponse(): QueryPaymentsResponse { + return { + $type: 'akash.escrow.v1beta2.QueryPaymentsResponse', + payments: [], + pagination: undefined, + }; +} + +export const QueryPaymentsResponse = { + $type: 'akash.escrow.v1beta2.QueryPaymentsResponse' as const, + + encode( + message: QueryPaymentsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.payments) { + FractionalPayment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryPaymentsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPaymentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.payments.push( + FractionalPayment.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryPaymentsResponse { + return { + $type: QueryPaymentsResponse.$type, + payments: globalThis.Array.isArray(object?.payments) + ? object.payments.map((e: any) => FractionalPayment.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryPaymentsResponse): unknown { + const obj: any = {}; + if (message.payments?.length) { + obj.payments = message.payments.map((e) => FractionalPayment.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryPaymentsResponse { + return QueryPaymentsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryPaymentsResponse { + const message = createBaseQueryPaymentsResponse(); + message.payments = + object.payments?.map((e) => FractionalPayment.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryPaymentsResponse.$type, QueryPaymentsResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + * Accounts queries all accounts + */ + Accounts(request: QueryAccountsRequest): Promise; + /** + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + * Payments queries all payments + */ + Payments(request: QueryPaymentsRequest): Promise; +} + +export const QueryServiceName = 'akash.escrow.v1beta2.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Accounts = this.Accounts.bind(this); + this.Payments = this.Payments.bind(this); + } + Accounts(request: QueryAccountsRequest): Promise { + const data = QueryAccountsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Accounts', data); + return promise.then((data) => + QueryAccountsResponse.decode(_m0.Reader.create(data)), + ); + } + + Payments(request: QueryPaymentsRequest): Promise { + const data = QueryPaymentsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Payments', data); + return promise.then((data) => + QueryPaymentsResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/escrow/v1beta2/types.ts b/ts/src/generated/akash/escrow/v1beta2/types.ts new file mode 100644 index 00000000..22c8a32e --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta2/types.ts @@ -0,0 +1,679 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin, DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.escrow.v1beta2'; + +/** AccountID is the account identifier */ +export interface AccountID { + $type: 'akash.escrow.v1beta2.AccountID'; + scope: string; + xid: string; +} + +/** Account stores state for an escrow account */ +export interface Account { + $type: 'akash.escrow.v1beta2.Account'; + /** unique identifier for this escrow account */ + id: AccountID | undefined; + /** bech32 encoded account address of the owner of this escrow account */ + owner: string; + /** current state of this escrow account */ + state: Account_State; + /** unspent coins received from the owner's wallet */ + balance: DecCoin | undefined; + /** total coins spent by this account */ + transferred: DecCoin | undefined; + /** block height at which this account was last settled */ + settledAt: Long; + /** + * bech32 encoded account address of the depositor. + * If depositor is same as the owner, then any incoming coins are added to the Balance. + * If depositor isn't same as the owner, then any incoming coins are added to the Funds. + */ + depositor: string; + /** + * Funds are unspent coins received from the (non-Owner) Depositor's wallet. + * If there are any funds, they should be spent before spending the Balance. + */ + funds: DecCoin | undefined; +} + +/** State stores state for an escrow account */ +export enum Account_State { + /** invalid - AccountStateInvalid is an invalid state */ + invalid = 0, + /** open - AccountOpen is the state when an account is open */ + open = 1, + /** closed - AccountClosed is the state when an account is closed */ + closed = 2, + /** overdrawn - AccountOverdrawn is the state when an account is overdrawn */ + overdrawn = 3, + UNRECOGNIZED = -1, +} + +export function account_StateFromJSON(object: any): Account_State { + switch (object) { + case 0: + case 'invalid': + return Account_State.invalid; + case 1: + case 'open': + return Account_State.open; + case 2: + case 'closed': + return Account_State.closed; + case 3: + case 'overdrawn': + return Account_State.overdrawn; + case -1: + case 'UNRECOGNIZED': + default: + return Account_State.UNRECOGNIZED; + } +} + +export function account_StateToJSON(object: Account_State): string { + switch (object) { + case Account_State.invalid: + return 'invalid'; + case Account_State.open: + return 'open'; + case Account_State.closed: + return 'closed'; + case Account_State.overdrawn: + return 'overdrawn'; + case Account_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** Payment stores state for a payment */ +export interface FractionalPayment { + $type: 'akash.escrow.v1beta2.FractionalPayment'; + accountId: AccountID | undefined; + paymentId: string; + owner: string; + state: FractionalPayment_State; + rate: DecCoin | undefined; + balance: DecCoin | undefined; + withdrawn: Coin | undefined; +} + +/** Payment State */ +export enum FractionalPayment_State { + /** invalid - PaymentStateInvalid is the state when the payment is invalid */ + invalid = 0, + /** open - PaymentStateOpen is the state when the payment is open */ + open = 1, + /** closed - PaymentStateClosed is the state when the payment is closed */ + closed = 2, + /** overdrawn - PaymentStateOverdrawn is the state when the payment is overdrawn */ + overdrawn = 3, + UNRECOGNIZED = -1, +} + +export function fractionalPayment_StateFromJSON( + object: any, +): FractionalPayment_State { + switch (object) { + case 0: + case 'invalid': + return FractionalPayment_State.invalid; + case 1: + case 'open': + return FractionalPayment_State.open; + case 2: + case 'closed': + return FractionalPayment_State.closed; + case 3: + case 'overdrawn': + return FractionalPayment_State.overdrawn; + case -1: + case 'UNRECOGNIZED': + default: + return FractionalPayment_State.UNRECOGNIZED; + } +} + +export function fractionalPayment_StateToJSON( + object: FractionalPayment_State, +): string { + switch (object) { + case FractionalPayment_State.invalid: + return 'invalid'; + case FractionalPayment_State.open: + return 'open'; + case FractionalPayment_State.closed: + return 'closed'; + case FractionalPayment_State.overdrawn: + return 'overdrawn'; + case FractionalPayment_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseAccountID(): AccountID { + return { $type: 'akash.escrow.v1beta2.AccountID', scope: '', xid: '' }; +} + +export const AccountID = { + $type: 'akash.escrow.v1beta2.AccountID' as const, + + encode( + message: AccountID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccountID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountID { + return { + $type: AccountID.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + }; + }, + + toJSON(message: AccountID): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + return obj; + }, + + create, I>>(base?: I): AccountID { + return AccountID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AccountID { + const message = createBaseAccountID(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(AccountID.$type, AccountID); + +function createBaseAccount(): Account { + return { + $type: 'akash.escrow.v1beta2.Account', + id: undefined, + owner: '', + state: 0, + balance: undefined, + transferred: undefined, + settledAt: Long.ZERO, + depositor: '', + funds: undefined, + }; +} + +export const Account = { + $type: 'akash.escrow.v1beta2.Account' as const, + + encode( + message: Account, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + AccountID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.balance !== undefined) { + DecCoin.encode(message.balance, writer.uint32(34).fork()).ldelim(); + } + if (message.transferred !== undefined) { + DecCoin.encode(message.transferred, writer.uint32(42).fork()).ldelim(); + } + if (!message.settledAt.equals(Long.ZERO)) { + writer.uint32(48).int64(message.settledAt); + } + if (message.depositor !== '') { + writer.uint32(58).string(message.depositor); + } + if (message.funds !== undefined) { + DecCoin.encode(message.funds, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Account { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = AccountID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owner = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.state = reader.int32() as any; + continue; + case 4: + if (tag !== 34) { + break; + } + + message.balance = DecCoin.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.transferred = DecCoin.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.settledAt = reader.int64() as Long; + continue; + case 7: + if (tag !== 58) { + break; + } + + message.depositor = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.funds = DecCoin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Account { + return { + $type: Account.$type, + id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + balance: isSet(object.balance) + ? DecCoin.fromJSON(object.balance) + : undefined, + transferred: isSet(object.transferred) + ? DecCoin.fromJSON(object.transferred) + : undefined, + settledAt: isSet(object.settledAt) + ? Long.fromValue(object.settledAt) + : Long.ZERO, + depositor: isSet(object.depositor) + ? globalThis.String(object.depositor) + : '', + funds: isSet(object.funds) ? DecCoin.fromJSON(object.funds) : undefined, + }; + }, + + toJSON(message: Account): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = AccountID.toJSON(message.id); + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== 0) { + obj.state = account_StateToJSON(message.state); + } + if (message.balance !== undefined) { + obj.balance = DecCoin.toJSON(message.balance); + } + if (message.transferred !== undefined) { + obj.transferred = DecCoin.toJSON(message.transferred); + } + if (!message.settledAt.equals(Long.ZERO)) { + obj.settledAt = (message.settledAt || Long.ZERO).toString(); + } + if (message.depositor !== '') { + obj.depositor = message.depositor; + } + if (message.funds !== undefined) { + obj.funds = DecCoin.toJSON(message.funds); + } + return obj; + }, + + create, I>>(base?: I): Account { + return Account.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Account { + const message = createBaseAccount(); + message.id = + object.id !== undefined && object.id !== null + ? AccountID.fromPartial(object.id) + : undefined; + message.owner = object.owner ?? ''; + message.state = object.state ?? 0; + message.balance = + object.balance !== undefined && object.balance !== null + ? DecCoin.fromPartial(object.balance) + : undefined; + message.transferred = + object.transferred !== undefined && object.transferred !== null + ? DecCoin.fromPartial(object.transferred) + : undefined; + message.settledAt = + object.settledAt !== undefined && object.settledAt !== null + ? Long.fromValue(object.settledAt) + : Long.ZERO; + message.depositor = object.depositor ?? ''; + message.funds = + object.funds !== undefined && object.funds !== null + ? DecCoin.fromPartial(object.funds) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Account.$type, Account); + +function createBaseFractionalPayment(): FractionalPayment { + return { + $type: 'akash.escrow.v1beta2.FractionalPayment', + accountId: undefined, + paymentId: '', + owner: '', + state: 0, + rate: undefined, + balance: undefined, + withdrawn: undefined, + }; +} + +export const FractionalPayment = { + $type: 'akash.escrow.v1beta2.FractionalPayment' as const, + + encode( + message: FractionalPayment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.accountId !== undefined) { + AccountID.encode(message.accountId, writer.uint32(10).fork()).ldelim(); + } + if (message.paymentId !== '') { + writer.uint32(18).string(message.paymentId); + } + if (message.owner !== '') { + writer.uint32(26).string(message.owner); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.rate !== undefined) { + DecCoin.encode(message.rate, writer.uint32(42).fork()).ldelim(); + } + if (message.balance !== undefined) { + DecCoin.encode(message.balance, writer.uint32(50).fork()).ldelim(); + } + if (message.withdrawn !== undefined) { + Coin.encode(message.withdrawn, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FractionalPayment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFractionalPayment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accountId = AccountID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.paymentId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.owner = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.state = reader.int32() as any; + continue; + case 5: + if (tag !== 42) { + break; + } + + message.rate = DecCoin.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.balance = DecCoin.decode(reader, reader.uint32()); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.withdrawn = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FractionalPayment { + return { + $type: FractionalPayment.$type, + accountId: isSet(object.accountId) + ? AccountID.fromJSON(object.accountId) + : undefined, + paymentId: isSet(object.paymentId) + ? globalThis.String(object.paymentId) + : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) + ? fractionalPayment_StateFromJSON(object.state) + : 0, + rate: isSet(object.rate) ? DecCoin.fromJSON(object.rate) : undefined, + balance: isSet(object.balance) + ? DecCoin.fromJSON(object.balance) + : undefined, + withdrawn: isSet(object.withdrawn) + ? Coin.fromJSON(object.withdrawn) + : undefined, + }; + }, + + toJSON(message: FractionalPayment): unknown { + const obj: any = {}; + if (message.accountId !== undefined) { + obj.accountId = AccountID.toJSON(message.accountId); + } + if (message.paymentId !== '') { + obj.paymentId = message.paymentId; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== 0) { + obj.state = fractionalPayment_StateToJSON(message.state); + } + if (message.rate !== undefined) { + obj.rate = DecCoin.toJSON(message.rate); + } + if (message.balance !== undefined) { + obj.balance = DecCoin.toJSON(message.balance); + } + if (message.withdrawn !== undefined) { + obj.withdrawn = Coin.toJSON(message.withdrawn); + } + return obj; + }, + + create, I>>( + base?: I, + ): FractionalPayment { + return FractionalPayment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FractionalPayment { + const message = createBaseFractionalPayment(); + message.accountId = + object.accountId !== undefined && object.accountId !== null + ? AccountID.fromPartial(object.accountId) + : undefined; + message.paymentId = object.paymentId ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? 0; + message.rate = + object.rate !== undefined && object.rate !== null + ? DecCoin.fromPartial(object.rate) + : undefined; + message.balance = + object.balance !== undefined && object.balance !== null + ? DecCoin.fromPartial(object.balance) + : undefined; + message.withdrawn = + object.withdrawn !== undefined && object.withdrawn !== null + ? Coin.fromPartial(object.withdrawn) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(FractionalPayment.$type, FractionalPayment); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/escrow/v1beta3/genesis.ts b/ts/src/generated/akash/escrow/v1beta3/genesis.ts new file mode 100644 index 00000000..140fc9ca --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta3/genesis.ts @@ -0,0 +1,146 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, FractionalPayment } from './types'; + +export const protobufPackage = 'akash.escrow.v1beta3'; + +/** GenesisState defines the basic genesis state used by escrow module */ +export interface GenesisState { + $type: 'akash.escrow.v1beta3.GenesisState'; + accounts: Account[]; + payments: FractionalPayment[]; +} + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.escrow.v1beta3.GenesisState', + accounts: [], + payments: [], + }; +} + +export const GenesisState = { + $type: 'akash.escrow.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.accounts) { + Account.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.payments) { + FractionalPayment.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accounts.push(Account.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.payments.push( + FractionalPayment.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + accounts: globalThis.Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Account.fromJSON(e)) + : [], + payments: globalThis.Array.isArray(object?.payments) + ? object.payments.map((e: any) => FractionalPayment.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.accounts?.length) { + obj.accounts = message.accounts.map((e) => Account.toJSON(e)); + } + if (message.payments?.length) { + obj.payments = message.payments.map((e) => FractionalPayment.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.accounts = + object.accounts?.map((e) => Account.fromPartial(e)) || []; + message.payments = + object.payments?.map((e) => FractionalPayment.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/escrow/v1beta3/query.ts b/ts/src/generated/akash/escrow/v1beta3/query.ts new file mode 100644 index 00000000..b423a71a --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta3/query.ts @@ -0,0 +1,656 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, FractionalPayment } from './types'; + +export const protobufPackage = 'akash.escrow.v1beta3'; + +/** QueryAccountRequest is request type for the Query/Account RPC method */ +export interface QueryAccountsRequest { + $type: 'akash.escrow.v1beta3.QueryAccountsRequest'; + scope: string; + xid: string; + owner: string; + state: string; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryAccountsResponse { + $type: 'akash.escrow.v1beta3.QueryAccountsResponse'; + accounts: Account[]; + pagination: PageResponse | undefined; +} + +/** QueryPaymentRequest is request type for the Query/Payment RPC method */ +export interface QueryPaymentsRequest { + $type: 'akash.escrow.v1beta3.QueryPaymentsRequest'; + scope: string; + xid: string; + id: string; + owner: string; + state: string; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryPaymentsResponse { + $type: 'akash.escrow.v1beta3.QueryPaymentsResponse'; + payments: FractionalPayment[]; + pagination: PageResponse | undefined; +} + +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { + $type: 'akash.escrow.v1beta3.QueryAccountsRequest', + scope: '', + xid: '', + owner: '', + state: '', + pagination: undefined, + }; +} + +export const QueryAccountsRequest = { + $type: 'akash.escrow.v1beta3.QueryAccountsRequest' as const, + + encode( + message: QueryAccountsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + if (message.owner !== '') { + writer.uint32(26).string(message.owner); + } + if (message.state !== '') { + writer.uint32(34).string(message.state); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAccountsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.owner = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.state = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAccountsRequest { + return { + $type: QueryAccountsRequest.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAccountsRequest): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== '') { + obj.state = message.state; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAccountsRequest { + return QueryAccountsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryAccountsRequest.$type, QueryAccountsRequest); + +function createBaseQueryAccountsResponse(): QueryAccountsResponse { + return { + $type: 'akash.escrow.v1beta3.QueryAccountsResponse', + accounts: [], + pagination: undefined, + }; +} + +export const QueryAccountsResponse = { + $type: 'akash.escrow.v1beta3.QueryAccountsResponse' as const, + + encode( + message: QueryAccountsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.accounts) { + Account.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAccountsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accounts.push(Account.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryAccountsResponse { + return { + $type: QueryAccountsResponse.$type, + accounts: globalThis.Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Account.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts?.length) { + obj.accounts = message.accounts.map((e) => Account.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryAccountsResponse { + return QueryAccountsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = + object.accounts?.map((e) => Account.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryAccountsResponse.$type, QueryAccountsResponse); + +function createBaseQueryPaymentsRequest(): QueryPaymentsRequest { + return { + $type: 'akash.escrow.v1beta3.QueryPaymentsRequest', + scope: '', + xid: '', + id: '', + owner: '', + state: '', + pagination: undefined, + }; +} + +export const QueryPaymentsRequest = { + $type: 'akash.escrow.v1beta3.QueryPaymentsRequest' as const, + + encode( + message: QueryPaymentsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + if (message.id !== '') { + writer.uint32(26).string(message.id); + } + if (message.owner !== '') { + writer.uint32(34).string(message.owner); + } + if (message.state !== '') { + writer.uint32(42).string(message.state); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryPaymentsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPaymentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.id = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.owner = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.state = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryPaymentsRequest { + return { + $type: QueryPaymentsRequest.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + id: isSet(object.id) ? globalThis.String(object.id) : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryPaymentsRequest): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + if (message.id !== '') { + obj.id = message.id; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== '') { + obj.state = message.state; + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryPaymentsRequest { + return QueryPaymentsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryPaymentsRequest { + const message = createBaseQueryPaymentsRequest(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + message.id = object.id ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? ''; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryPaymentsRequest.$type, QueryPaymentsRequest); + +function createBaseQueryPaymentsResponse(): QueryPaymentsResponse { + return { + $type: 'akash.escrow.v1beta3.QueryPaymentsResponse', + payments: [], + pagination: undefined, + }; +} + +export const QueryPaymentsResponse = { + $type: 'akash.escrow.v1beta3.QueryPaymentsResponse' as const, + + encode( + message: QueryPaymentsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.payments) { + FractionalPayment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryPaymentsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPaymentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.payments.push( + FractionalPayment.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryPaymentsResponse { + return { + $type: QueryPaymentsResponse.$type, + payments: globalThis.Array.isArray(object?.payments) + ? object.payments.map((e: any) => FractionalPayment.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryPaymentsResponse): unknown { + const obj: any = {}; + if (message.payments?.length) { + obj.payments = message.payments.map((e) => FractionalPayment.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryPaymentsResponse { + return QueryPaymentsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryPaymentsResponse { + const message = createBaseQueryPaymentsResponse(); + message.payments = + object.payments?.map((e) => FractionalPayment.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryPaymentsResponse.$type, QueryPaymentsResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + * Accounts queries all accounts + */ + Accounts(request: QueryAccountsRequest): Promise; + /** + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + * Payments queries all payments + */ + Payments(request: QueryPaymentsRequest): Promise; +} + +export const QueryServiceName = 'akash.escrow.v1beta3.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Accounts = this.Accounts.bind(this); + this.Payments = this.Payments.bind(this); + } + Accounts(request: QueryAccountsRequest): Promise { + const data = QueryAccountsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Accounts', data); + return promise.then((data) => + QueryAccountsResponse.decode(_m0.Reader.create(data)), + ); + } + + Payments(request: QueryPaymentsRequest): Promise { + const data = QueryPaymentsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Payments', data); + return promise.then((data) => + QueryPaymentsResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/escrow/v1beta3/types.ts b/ts/src/generated/akash/escrow/v1beta3/types.ts new file mode 100644 index 00000000..bf31521a --- /dev/null +++ b/ts/src/generated/akash/escrow/v1beta3/types.ts @@ -0,0 +1,679 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin, DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.escrow.v1beta3'; + +/** AccountID is the account identifier */ +export interface AccountID { + $type: 'akash.escrow.v1beta3.AccountID'; + scope: string; + xid: string; +} + +/** Account stores state for an escrow account */ +export interface Account { + $type: 'akash.escrow.v1beta3.Account'; + /** unique identifier for this escrow account */ + id: AccountID | undefined; + /** bech32 encoded account address of the owner of this escrow account */ + owner: string; + /** current state of this escrow account */ + state: Account_State; + /** unspent coins received from the owner's wallet */ + balance: DecCoin | undefined; + /** total coins spent by this account */ + transferred: DecCoin | undefined; + /** block height at which this account was last settled */ + settledAt: Long; + /** + * bech32 encoded account address of the depositor. + * If depositor is same as the owner, then any incoming coins are added to the Balance. + * If depositor isn't same as the owner, then any incoming coins are added to the Funds. + */ + depositor: string; + /** + * Funds are unspent coins received from the (non-Owner) Depositor's wallet. + * If there are any funds, they should be spent before spending the Balance. + */ + funds: DecCoin | undefined; +} + +/** State stores state for an escrow account */ +export enum Account_State { + /** invalid - AccountStateInvalid is an invalid state */ + invalid = 0, + /** open - AccountOpen is the state when an account is open */ + open = 1, + /** closed - AccountClosed is the state when an account is closed */ + closed = 2, + /** overdrawn - AccountOverdrawn is the state when an account is overdrawn */ + overdrawn = 3, + UNRECOGNIZED = -1, +} + +export function account_StateFromJSON(object: any): Account_State { + switch (object) { + case 0: + case 'invalid': + return Account_State.invalid; + case 1: + case 'open': + return Account_State.open; + case 2: + case 'closed': + return Account_State.closed; + case 3: + case 'overdrawn': + return Account_State.overdrawn; + case -1: + case 'UNRECOGNIZED': + default: + return Account_State.UNRECOGNIZED; + } +} + +export function account_StateToJSON(object: Account_State): string { + switch (object) { + case Account_State.invalid: + return 'invalid'; + case Account_State.open: + return 'open'; + case Account_State.closed: + return 'closed'; + case Account_State.overdrawn: + return 'overdrawn'; + case Account_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** Payment stores state for a payment */ +export interface FractionalPayment { + $type: 'akash.escrow.v1beta3.FractionalPayment'; + accountId: AccountID | undefined; + paymentId: string; + owner: string; + state: FractionalPayment_State; + rate: DecCoin | undefined; + balance: DecCoin | undefined; + withdrawn: Coin | undefined; +} + +/** Payment State */ +export enum FractionalPayment_State { + /** invalid - PaymentStateInvalid is the state when the payment is invalid */ + invalid = 0, + /** open - PaymentStateOpen is the state when the payment is open */ + open = 1, + /** closed - PaymentStateClosed is the state when the payment is closed */ + closed = 2, + /** overdrawn - PaymentStateOverdrawn is the state when the payment is overdrawn */ + overdrawn = 3, + UNRECOGNIZED = -1, +} + +export function fractionalPayment_StateFromJSON( + object: any, +): FractionalPayment_State { + switch (object) { + case 0: + case 'invalid': + return FractionalPayment_State.invalid; + case 1: + case 'open': + return FractionalPayment_State.open; + case 2: + case 'closed': + return FractionalPayment_State.closed; + case 3: + case 'overdrawn': + return FractionalPayment_State.overdrawn; + case -1: + case 'UNRECOGNIZED': + default: + return FractionalPayment_State.UNRECOGNIZED; + } +} + +export function fractionalPayment_StateToJSON( + object: FractionalPayment_State, +): string { + switch (object) { + case FractionalPayment_State.invalid: + return 'invalid'; + case FractionalPayment_State.open: + return 'open'; + case FractionalPayment_State.closed: + return 'closed'; + case FractionalPayment_State.overdrawn: + return 'overdrawn'; + case FractionalPayment_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +function createBaseAccountID(): AccountID { + return { $type: 'akash.escrow.v1beta3.AccountID', scope: '', xid: '' }; +} + +export const AccountID = { + $type: 'akash.escrow.v1beta3.AccountID' as const, + + encode( + message: AccountID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.scope !== '') { + writer.uint32(10).string(message.scope); + } + if (message.xid !== '') { + writer.uint32(18).string(message.xid); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccountID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.scope = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.xid = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountID { + return { + $type: AccountID.$type, + scope: isSet(object.scope) ? globalThis.String(object.scope) : '', + xid: isSet(object.xid) ? globalThis.String(object.xid) : '', + }; + }, + + toJSON(message: AccountID): unknown { + const obj: any = {}; + if (message.scope !== '') { + obj.scope = message.scope; + } + if (message.xid !== '') { + obj.xid = message.xid; + } + return obj; + }, + + create, I>>(base?: I): AccountID { + return AccountID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): AccountID { + const message = createBaseAccountID(); + message.scope = object.scope ?? ''; + message.xid = object.xid ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(AccountID.$type, AccountID); + +function createBaseAccount(): Account { + return { + $type: 'akash.escrow.v1beta3.Account', + id: undefined, + owner: '', + state: 0, + balance: undefined, + transferred: undefined, + settledAt: Long.ZERO, + depositor: '', + funds: undefined, + }; +} + +export const Account = { + $type: 'akash.escrow.v1beta3.Account' as const, + + encode( + message: Account, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + AccountID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.balance !== undefined) { + DecCoin.encode(message.balance, writer.uint32(34).fork()).ldelim(); + } + if (message.transferred !== undefined) { + DecCoin.encode(message.transferred, writer.uint32(42).fork()).ldelim(); + } + if (!message.settledAt.equals(Long.ZERO)) { + writer.uint32(48).int64(message.settledAt); + } + if (message.depositor !== '') { + writer.uint32(58).string(message.depositor); + } + if (message.funds !== undefined) { + DecCoin.encode(message.funds, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Account { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = AccountID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.owner = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.state = reader.int32() as any; + continue; + case 4: + if (tag !== 34) { + break; + } + + message.balance = DecCoin.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.transferred = DecCoin.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.settledAt = reader.int64() as Long; + continue; + case 7: + if (tag !== 58) { + break; + } + + message.depositor = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.funds = DecCoin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Account { + return { + $type: Account.$type, + id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + balance: isSet(object.balance) + ? DecCoin.fromJSON(object.balance) + : undefined, + transferred: isSet(object.transferred) + ? DecCoin.fromJSON(object.transferred) + : undefined, + settledAt: isSet(object.settledAt) + ? Long.fromValue(object.settledAt) + : Long.ZERO, + depositor: isSet(object.depositor) + ? globalThis.String(object.depositor) + : '', + funds: isSet(object.funds) ? DecCoin.fromJSON(object.funds) : undefined, + }; + }, + + toJSON(message: Account): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = AccountID.toJSON(message.id); + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== 0) { + obj.state = account_StateToJSON(message.state); + } + if (message.balance !== undefined) { + obj.balance = DecCoin.toJSON(message.balance); + } + if (message.transferred !== undefined) { + obj.transferred = DecCoin.toJSON(message.transferred); + } + if (!message.settledAt.equals(Long.ZERO)) { + obj.settledAt = (message.settledAt || Long.ZERO).toString(); + } + if (message.depositor !== '') { + obj.depositor = message.depositor; + } + if (message.funds !== undefined) { + obj.funds = DecCoin.toJSON(message.funds); + } + return obj; + }, + + create, I>>(base?: I): Account { + return Account.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Account { + const message = createBaseAccount(); + message.id = + object.id !== undefined && object.id !== null + ? AccountID.fromPartial(object.id) + : undefined; + message.owner = object.owner ?? ''; + message.state = object.state ?? 0; + message.balance = + object.balance !== undefined && object.balance !== null + ? DecCoin.fromPartial(object.balance) + : undefined; + message.transferred = + object.transferred !== undefined && object.transferred !== null + ? DecCoin.fromPartial(object.transferred) + : undefined; + message.settledAt = + object.settledAt !== undefined && object.settledAt !== null + ? Long.fromValue(object.settledAt) + : Long.ZERO; + message.depositor = object.depositor ?? ''; + message.funds = + object.funds !== undefined && object.funds !== null + ? DecCoin.fromPartial(object.funds) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Account.$type, Account); + +function createBaseFractionalPayment(): FractionalPayment { + return { + $type: 'akash.escrow.v1beta3.FractionalPayment', + accountId: undefined, + paymentId: '', + owner: '', + state: 0, + rate: undefined, + balance: undefined, + withdrawn: undefined, + }; +} + +export const FractionalPayment = { + $type: 'akash.escrow.v1beta3.FractionalPayment' as const, + + encode( + message: FractionalPayment, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.accountId !== undefined) { + AccountID.encode(message.accountId, writer.uint32(10).fork()).ldelim(); + } + if (message.paymentId !== '') { + writer.uint32(18).string(message.paymentId); + } + if (message.owner !== '') { + writer.uint32(26).string(message.owner); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.rate !== undefined) { + DecCoin.encode(message.rate, writer.uint32(42).fork()).ldelim(); + } + if (message.balance !== undefined) { + DecCoin.encode(message.balance, writer.uint32(50).fork()).ldelim(); + } + if (message.withdrawn !== undefined) { + Coin.encode(message.withdrawn, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FractionalPayment { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFractionalPayment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accountId = AccountID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.paymentId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.owner = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.state = reader.int32() as any; + continue; + case 5: + if (tag !== 42) { + break; + } + + message.rate = DecCoin.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.balance = DecCoin.decode(reader, reader.uint32()); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.withdrawn = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FractionalPayment { + return { + $type: FractionalPayment.$type, + accountId: isSet(object.accountId) + ? AccountID.fromJSON(object.accountId) + : undefined, + paymentId: isSet(object.paymentId) + ? globalThis.String(object.paymentId) + : '', + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + state: isSet(object.state) + ? fractionalPayment_StateFromJSON(object.state) + : 0, + rate: isSet(object.rate) ? DecCoin.fromJSON(object.rate) : undefined, + balance: isSet(object.balance) + ? DecCoin.fromJSON(object.balance) + : undefined, + withdrawn: isSet(object.withdrawn) + ? Coin.fromJSON(object.withdrawn) + : undefined, + }; + }, + + toJSON(message: FractionalPayment): unknown { + const obj: any = {}; + if (message.accountId !== undefined) { + obj.accountId = AccountID.toJSON(message.accountId); + } + if (message.paymentId !== '') { + obj.paymentId = message.paymentId; + } + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.state !== 0) { + obj.state = fractionalPayment_StateToJSON(message.state); + } + if (message.rate !== undefined) { + obj.rate = DecCoin.toJSON(message.rate); + } + if (message.balance !== undefined) { + obj.balance = DecCoin.toJSON(message.balance); + } + if (message.withdrawn !== undefined) { + obj.withdrawn = Coin.toJSON(message.withdrawn); + } + return obj; + }, + + create, I>>( + base?: I, + ): FractionalPayment { + return FractionalPayment.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FractionalPayment { + const message = createBaseFractionalPayment(); + message.accountId = + object.accountId !== undefined && object.accountId !== null + ? AccountID.fromPartial(object.accountId) + : undefined; + message.paymentId = object.paymentId ?? ''; + message.owner = object.owner ?? ''; + message.state = object.state ?? 0; + message.rate = + object.rate !== undefined && object.rate !== null + ? DecCoin.fromPartial(object.rate) + : undefined; + message.balance = + object.balance !== undefined && object.balance !== null + ? DecCoin.fromPartial(object.balance) + : undefined; + message.withdrawn = + object.withdrawn !== undefined && object.withdrawn !== null + ? Coin.fromPartial(object.withdrawn) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(FractionalPayment.$type, FractionalPayment); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/gov/v1beta3/genesis.ts b/ts/src/generated/akash/gov/v1beta3/genesis.ts new file mode 100644 index 00000000..a95db386 --- /dev/null +++ b/ts/src/generated/akash/gov/v1beta3/genesis.ts @@ -0,0 +1,130 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { DepositParams } from './params'; + +export const protobufPackage = 'akash.gov.v1beta3'; + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.gov.v1beta3.GenesisState'; + depositParams: DepositParams | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.gov.v1beta3.GenesisState', depositParams: undefined }; +} + +export const GenesisState = { + $type: 'akash.gov.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.depositParams !== undefined) { + DepositParams.encode( + message.depositParams, + writer.uint32(10).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.depositParams = DepositParams.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + depositParams: isSet(object.depositParams) + ? DepositParams.fromJSON(object.depositParams) + : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.depositParams !== undefined) { + obj.depositParams = DepositParams.toJSON(message.depositParams); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.depositParams = + object.depositParams !== undefined && object.depositParams !== null + ? DepositParams.fromPartial(object.depositParams) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/gov/v1beta3/params.ts b/ts/src/generated/akash/gov/v1beta3/params.ts new file mode 100644 index 00000000..e1c7a60f --- /dev/null +++ b/ts/src/generated/akash/gov/v1beta3/params.ts @@ -0,0 +1,158 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.gov.v1beta3'; + +/** DepositParams defines the parameters for the x/gov module */ +export interface DepositParams { + $type: 'akash.gov.v1beta3.DepositParams'; + /** + * min_initial_deposit_rate minimum % of TotalDeposit + * author of the proposal must put in order for proposal tx to be committed + */ + minInitialDepositRate: Uint8Array; +} + +function createBaseDepositParams(): DepositParams { + return { + $type: 'akash.gov.v1beta3.DepositParams', + minInitialDepositRate: new Uint8Array(0), + }; +} + +export const DepositParams = { + $type: 'akash.gov.v1beta3.DepositParams' as const, + + encode( + message: DepositParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.minInitialDepositRate.length !== 0) { + writer.uint32(10).bytes(message.minInitialDepositRate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.minInitialDepositRate = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DepositParams { + return { + $type: DepositParams.$type, + minInitialDepositRate: isSet(object.minInitialDepositRate) + ? bytesFromBase64(object.minInitialDepositRate) + : new Uint8Array(0), + }; + }, + + toJSON(message: DepositParams): unknown { + const obj: any = {}; + if (message.minInitialDepositRate.length !== 0) { + obj.minInitialDepositRate = base64FromBytes( + message.minInitialDepositRate, + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): DepositParams { + return DepositParams.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DepositParams { + const message = createBaseDepositParams(); + message.minInitialDepositRate = + object.minInitialDepositRate ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(DepositParams.$type, DepositParams); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inflation/v1beta2/genesis.ts b/ts/src/generated/akash/inflation/v1beta2/genesis.ts new file mode 100644 index 00000000..8cb2f979 --- /dev/null +++ b/ts/src/generated/akash/inflation/v1beta2/genesis.ts @@ -0,0 +1,125 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Params } from './params'; + +export const protobufPackage = 'akash.inflation.v1beta2'; + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.inflation.v1beta2.GenesisState'; + params: Params | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.inflation.v1beta2.GenesisState', params: undefined }; +} + +export const GenesisState = { + $type: 'akash.inflation.v1beta2.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inflation/v1beta2/params.ts b/ts/src/generated/akash/inflation/v1beta2/params.ts new file mode 100644 index 00000000..fe4d995e --- /dev/null +++ b/ts/src/generated/akash/inflation/v1beta2/params.ts @@ -0,0 +1,169 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.inflation.v1beta2'; + +/** Params defines the parameters for the x/deployment package */ +export interface Params { + $type: 'akash.inflation.v1beta2.Params'; + /** InflationDecayFactor is the number of years it takes inflation to halve. */ + inflationDecayFactor: string; + /** + * InitialInflation is the rate at which inflation starts at genesis. + * It is a decimal value in the range [0.0, 100.0]. + */ + initialInflation: string; + /** + * Variance defines the fraction by which inflation can vary from ideal inflation in a block. + * It is a decimal value in the range [0.0, 1.0]. + */ + variance: string; +} + +function createBaseParams(): Params { + return { + $type: 'akash.inflation.v1beta2.Params', + inflationDecayFactor: '', + initialInflation: '', + variance: '', + }; +} + +export const Params = { + $type: 'akash.inflation.v1beta2.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.inflationDecayFactor !== '') { + writer.uint32(10).string(message.inflationDecayFactor); + } + if (message.initialInflation !== '') { + writer.uint32(18).string(message.initialInflation); + } + if (message.variance !== '') { + writer.uint32(26).string(message.variance); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.inflationDecayFactor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.initialInflation = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.variance = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + inflationDecayFactor: isSet(object.inflationDecayFactor) + ? globalThis.String(object.inflationDecayFactor) + : '', + initialInflation: isSet(object.initialInflation) + ? globalThis.String(object.initialInflation) + : '', + variance: isSet(object.variance) + ? globalThis.String(object.variance) + : '', + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.inflationDecayFactor !== '') { + obj.inflationDecayFactor = message.inflationDecayFactor; + } + if (message.initialInflation !== '') { + obj.initialInflation = message.initialInflation; + } + if (message.variance !== '') { + obj.variance = message.variance; + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.inflationDecayFactor = object.inflationDecayFactor ?? ''; + message.initialInflation = object.initialInflation ?? ''; + message.variance = object.variance ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inflation/v1beta3/genesis.ts b/ts/src/generated/akash/inflation/v1beta3/genesis.ts new file mode 100644 index 00000000..3d4af425 --- /dev/null +++ b/ts/src/generated/akash/inflation/v1beta3/genesis.ts @@ -0,0 +1,125 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Params } from './params'; + +export const protobufPackage = 'akash.inflation.v1beta3'; + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.inflation.v1beta3.GenesisState'; + params: Params | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.inflation.v1beta3.GenesisState', params: undefined }; +} + +export const GenesisState = { + $type: 'akash.inflation.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inflation/v1beta3/params.ts b/ts/src/generated/akash/inflation/v1beta3/params.ts new file mode 100644 index 00000000..b203eed4 --- /dev/null +++ b/ts/src/generated/akash/inflation/v1beta3/params.ts @@ -0,0 +1,169 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.inflation.v1beta3'; + +/** Params defines the parameters for the x/deployment package */ +export interface Params { + $type: 'akash.inflation.v1beta3.Params'; + /** InflationDecayFactor is the number of years it takes inflation to halve. */ + inflationDecayFactor: string; + /** + * InitialInflation is the rate at which inflation starts at genesis. + * It is a decimal value in the range [0.0, 100.0]. + */ + initialInflation: string; + /** + * Variance defines the fraction by which inflation can vary from ideal inflation in a block. + * It is a decimal value in the range [0.0, 1.0]. + */ + variance: string; +} + +function createBaseParams(): Params { + return { + $type: 'akash.inflation.v1beta3.Params', + inflationDecayFactor: '', + initialInflation: '', + variance: '', + }; +} + +export const Params = { + $type: 'akash.inflation.v1beta3.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.inflationDecayFactor !== '') { + writer.uint32(10).string(message.inflationDecayFactor); + } + if (message.initialInflation !== '') { + writer.uint32(18).string(message.initialInflation); + } + if (message.variance !== '') { + writer.uint32(26).string(message.variance); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.inflationDecayFactor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.initialInflation = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.variance = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + inflationDecayFactor: isSet(object.inflationDecayFactor) + ? globalThis.String(object.inflationDecayFactor) + : '', + initialInflation: isSet(object.initialInflation) + ? globalThis.String(object.initialInflation) + : '', + variance: isSet(object.variance) + ? globalThis.String(object.variance) + : '', + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.inflationDecayFactor !== '') { + obj.inflationDecayFactor = message.inflationDecayFactor; + } + if (message.initialInflation !== '') { + obj.initialInflation = message.initialInflation; + } + if (message.variance !== '') { + obj.variance = message.variance; + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.inflationDecayFactor = object.inflationDecayFactor ?? ''; + message.initialInflation = object.initialInflation ?? ''; + message.variance = object.variance ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inventory/v1/cluster.ts b/ts/src/generated/akash/inventory/v1/cluster.ts new file mode 100644 index 00000000..2dbf268c --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/cluster.ts @@ -0,0 +1,135 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Node } from './node'; +import { Storage } from './storage'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** Cluster reports inventory across entire cluster */ +export interface Cluster { + $type: 'akash.inventory.v1.Cluster'; + nodes: Node[]; + storage: Storage[]; +} + +function createBaseCluster(): Cluster { + return { $type: 'akash.inventory.v1.Cluster', nodes: [], storage: [] }; +} + +export const Cluster = { + $type: 'akash.inventory.v1.Cluster' as const, + + encode( + message: Cluster, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.nodes) { + Node.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.storage) { + Storage.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Cluster { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCluster(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.nodes.push(Node.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.storage.push(Storage.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Cluster { + return { + $type: Cluster.$type, + nodes: globalThis.Array.isArray(object?.nodes) + ? object.nodes.map((e: any) => Node.fromJSON(e)) + : [], + storage: globalThis.Array.isArray(object?.storage) + ? object.storage.map((e: any) => Storage.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Cluster): unknown { + const obj: any = {}; + if (message.nodes?.length) { + obj.nodes = message.nodes.map((e) => Node.toJSON(e)); + } + if (message.storage?.length) { + obj.storage = message.storage.map((e) => Storage.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Cluster { + return Cluster.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Cluster { + const message = createBaseCluster(); + message.nodes = object.nodes?.map((e) => Node.fromPartial(e)) || []; + message.storage = object.storage?.map((e) => Storage.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Cluster.$type, Cluster); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/inventory/v1/cpu.ts b/ts/src/generated/akash/inventory/v1/cpu.ts new file mode 100644 index 00000000..13b2f32d --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/cpu.ts @@ -0,0 +1,266 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ResourcePair } from './resourcepair'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** CPUInfo reports CPU details */ +export interface CPUInfo { + $type: 'akash.inventory.v1.CPUInfo'; + id: string; + vendor: string; + model: string; + vcores: number; +} + +/** CPU reports CPU inventory details */ +export interface CPU { + $type: 'akash.inventory.v1.CPU'; + quantity: ResourcePair | undefined; + info: CPUInfo[]; +} + +function createBaseCPUInfo(): CPUInfo { + return { + $type: 'akash.inventory.v1.CPUInfo', + id: '', + vendor: '', + model: '', + vcores: 0, + }; +} + +export const CPUInfo = { + $type: 'akash.inventory.v1.CPUInfo' as const, + + encode( + message: CPUInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== '') { + writer.uint32(10).string(message.id); + } + if (message.vendor !== '') { + writer.uint32(18).string(message.vendor); + } + if (message.model !== '') { + writer.uint32(26).string(message.model); + } + if (message.vcores !== 0) { + writer.uint32(32).uint32(message.vcores); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CPUInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCPUInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.vendor = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.model = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.vcores = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CPUInfo { + return { + $type: CPUInfo.$type, + id: isSet(object.id) ? globalThis.String(object.id) : '', + vendor: isSet(object.vendor) ? globalThis.String(object.vendor) : '', + model: isSet(object.model) ? globalThis.String(object.model) : '', + vcores: isSet(object.vcores) ? globalThis.Number(object.vcores) : 0, + }; + }, + + toJSON(message: CPUInfo): unknown { + const obj: any = {}; + if (message.id !== '') { + obj.id = message.id; + } + if (message.vendor !== '') { + obj.vendor = message.vendor; + } + if (message.model !== '') { + obj.model = message.model; + } + if (message.vcores !== 0) { + obj.vcores = Math.round(message.vcores); + } + return obj; + }, + + create, I>>(base?: I): CPUInfo { + return CPUInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CPUInfo { + const message = createBaseCPUInfo(); + message.id = object.id ?? ''; + message.vendor = object.vendor ?? ''; + message.model = object.model ?? ''; + message.vcores = object.vcores ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(CPUInfo.$type, CPUInfo); + +function createBaseCPU(): CPU { + return { $type: 'akash.inventory.v1.CPU', quantity: undefined, info: [] }; +} + +export const CPU = { + $type: 'akash.inventory.v1.CPU' as const, + + encode(message: CPU, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.quantity !== undefined) { + ResourcePair.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.info) { + CPUInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CPU { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCPU(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourcePair.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.info.push(CPUInfo.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CPU { + return { + $type: CPU.$type, + quantity: isSet(object.quantity) + ? ResourcePair.fromJSON(object.quantity) + : undefined, + info: globalThis.Array.isArray(object?.info) + ? object.info.map((e: any) => CPUInfo.fromJSON(e)) + : [], + }; + }, + + toJSON(message: CPU): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourcePair.toJSON(message.quantity); + } + if (message.info?.length) { + obj.info = message.info.map((e) => CPUInfo.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): CPU { + return CPU.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CPU { + const message = createBaseCPU(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourcePair.fromPartial(object.quantity) + : undefined; + message.info = object.info?.map((e) => CPUInfo.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CPU.$type, CPU); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inventory/v1/gpu.ts b/ts/src/generated/akash/inventory/v1/gpu.ts new file mode 100644 index 00000000..138f5d6e --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/gpu.ts @@ -0,0 +1,306 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ResourcePair } from './resourcepair'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** GPUInfo reports GPU details */ +export interface GPUInfo { + $type: 'akash.inventory.v1.GPUInfo'; + vendor: string; + vendorId: string; + name: string; + modelid: string; + interface: string; + memorySize: string; +} + +/** GPUInfo reports GPU inventory details */ +export interface GPU { + $type: 'akash.inventory.v1.GPU'; + quantity: ResourcePair | undefined; + info: GPUInfo[]; +} + +function createBaseGPUInfo(): GPUInfo { + return { + $type: 'akash.inventory.v1.GPUInfo', + vendor: '', + vendorId: '', + name: '', + modelid: '', + interface: '', + memorySize: '', + }; +} + +export const GPUInfo = { + $type: 'akash.inventory.v1.GPUInfo' as const, + + encode( + message: GPUInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.vendor !== '') { + writer.uint32(10).string(message.vendor); + } + if (message.vendorId !== '') { + writer.uint32(18).string(message.vendorId); + } + if (message.name !== '') { + writer.uint32(26).string(message.name); + } + if (message.modelid !== '') { + writer.uint32(34).string(message.modelid); + } + if (message.interface !== '') { + writer.uint32(42).string(message.interface); + } + if (message.memorySize !== '') { + writer.uint32(50).string(message.memorySize); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GPUInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGPUInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.vendor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.vendorId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.name = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.modelid = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.interface = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.memorySize = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GPUInfo { + return { + $type: GPUInfo.$type, + vendor: isSet(object.vendor) ? globalThis.String(object.vendor) : '', + vendorId: isSet(object.vendorId) + ? globalThis.String(object.vendorId) + : '', + name: isSet(object.name) ? globalThis.String(object.name) : '', + modelid: isSet(object.modelid) ? globalThis.String(object.modelid) : '', + interface: isSet(object.interface) + ? globalThis.String(object.interface) + : '', + memorySize: isSet(object.memorySize) + ? globalThis.String(object.memorySize) + : '', + }; + }, + + toJSON(message: GPUInfo): unknown { + const obj: any = {}; + if (message.vendor !== '') { + obj.vendor = message.vendor; + } + if (message.vendorId !== '') { + obj.vendorId = message.vendorId; + } + if (message.name !== '') { + obj.name = message.name; + } + if (message.modelid !== '') { + obj.modelid = message.modelid; + } + if (message.interface !== '') { + obj.interface = message.interface; + } + if (message.memorySize !== '') { + obj.memorySize = message.memorySize; + } + return obj; + }, + + create, I>>(base?: I): GPUInfo { + return GPUInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GPUInfo { + const message = createBaseGPUInfo(); + message.vendor = object.vendor ?? ''; + message.vendorId = object.vendorId ?? ''; + message.name = object.name ?? ''; + message.modelid = object.modelid ?? ''; + message.interface = object.interface ?? ''; + message.memorySize = object.memorySize ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(GPUInfo.$type, GPUInfo); + +function createBaseGPU(): GPU { + return { $type: 'akash.inventory.v1.GPU', quantity: undefined, info: [] }; +} + +export const GPU = { + $type: 'akash.inventory.v1.GPU' as const, + + encode(message: GPU, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.quantity !== undefined) { + ResourcePair.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.info) { + GPUInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GPU { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGPU(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourcePair.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.info.push(GPUInfo.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GPU { + return { + $type: GPU.$type, + quantity: isSet(object.quantity) + ? ResourcePair.fromJSON(object.quantity) + : undefined, + info: globalThis.Array.isArray(object?.info) + ? object.info.map((e: any) => GPUInfo.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GPU): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourcePair.toJSON(message.quantity); + } + if (message.info?.length) { + obj.info = message.info.map((e) => GPUInfo.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): GPU { + return GPU.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GPU { + const message = createBaseGPU(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourcePair.fromPartial(object.quantity) + : undefined; + message.info = object.info?.map((e) => GPUInfo.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GPU.$type, GPU); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inventory/v1/memory.ts b/ts/src/generated/akash/inventory/v1/memory.ts new file mode 100644 index 00000000..df268706 --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/memory.ts @@ -0,0 +1,273 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ResourcePair } from './resourcepair'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** MemoryInfo reports Memory details */ +export interface MemoryInfo { + $type: 'akash.inventory.v1.MemoryInfo'; + vendor: string; + type: string; + totalSize: string; + speed: string; +} + +/** Memory reports Memory inventory details */ +export interface Memory { + $type: 'akash.inventory.v1.Memory'; + quantity: ResourcePair | undefined; + info: MemoryInfo[]; +} + +function createBaseMemoryInfo(): MemoryInfo { + return { + $type: 'akash.inventory.v1.MemoryInfo', + vendor: '', + type: '', + totalSize: '', + speed: '', + }; +} + +export const MemoryInfo = { + $type: 'akash.inventory.v1.MemoryInfo' as const, + + encode( + message: MemoryInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.vendor !== '') { + writer.uint32(10).string(message.vendor); + } + if (message.type !== '') { + writer.uint32(18).string(message.type); + } + if (message.totalSize !== '') { + writer.uint32(26).string(message.totalSize); + } + if (message.speed !== '') { + writer.uint32(34).string(message.speed); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MemoryInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMemoryInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.vendor = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.type = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.totalSize = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.speed = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MemoryInfo { + return { + $type: MemoryInfo.$type, + vendor: isSet(object.vendor) ? globalThis.String(object.vendor) : '', + type: isSet(object.type) ? globalThis.String(object.type) : '', + totalSize: isSet(object.totalSize) + ? globalThis.String(object.totalSize) + : '', + speed: isSet(object.speed) ? globalThis.String(object.speed) : '', + }; + }, + + toJSON(message: MemoryInfo): unknown { + const obj: any = {}; + if (message.vendor !== '') { + obj.vendor = message.vendor; + } + if (message.type !== '') { + obj.type = message.type; + } + if (message.totalSize !== '') { + obj.totalSize = message.totalSize; + } + if (message.speed !== '') { + obj.speed = message.speed; + } + return obj; + }, + + create, I>>(base?: I): MemoryInfo { + return MemoryInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MemoryInfo { + const message = createBaseMemoryInfo(); + message.vendor = object.vendor ?? ''; + message.type = object.type ?? ''; + message.totalSize = object.totalSize ?? ''; + message.speed = object.speed ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MemoryInfo.$type, MemoryInfo); + +function createBaseMemory(): Memory { + return { $type: 'akash.inventory.v1.Memory', quantity: undefined, info: [] }; +} + +export const Memory = { + $type: 'akash.inventory.v1.Memory' as const, + + encode( + message: Memory, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.quantity !== undefined) { + ResourcePair.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.info) { + MemoryInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Memory { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMemory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourcePair.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.info.push(MemoryInfo.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Memory { + return { + $type: Memory.$type, + quantity: isSet(object.quantity) + ? ResourcePair.fromJSON(object.quantity) + : undefined, + info: globalThis.Array.isArray(object?.info) + ? object.info.map((e: any) => MemoryInfo.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Memory): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourcePair.toJSON(message.quantity); + } + if (message.info?.length) { + obj.info = message.info.map((e) => MemoryInfo.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Memory { + return Memory.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Memory { + const message = createBaseMemory(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourcePair.fromPartial(object.quantity) + : undefined; + message.info = object.info?.map((e) => MemoryInfo.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Memory.$type, Memory); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inventory/v1/node.ts b/ts/src/generated/akash/inventory/v1/node.ts new file mode 100644 index 00000000..baecfd84 --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/node.ts @@ -0,0 +1,251 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { NodeResources } from './resources'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** NodeCapabilities extended list of node capabilities */ +export interface NodeCapabilities { + $type: 'akash.inventory.v1.NodeCapabilities'; + storageClasses: string[]; +} + +/** Node reports node inventory details */ +export interface Node { + $type: 'akash.inventory.v1.Node'; + name: string; + resources: NodeResources | undefined; + capabilities: NodeCapabilities | undefined; +} + +function createBaseNodeCapabilities(): NodeCapabilities { + return { $type: 'akash.inventory.v1.NodeCapabilities', storageClasses: [] }; +} + +export const NodeCapabilities = { + $type: 'akash.inventory.v1.NodeCapabilities' as const, + + encode( + message: NodeCapabilities, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.storageClasses) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NodeCapabilities { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNodeCapabilities(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.storageClasses.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): NodeCapabilities { + return { + $type: NodeCapabilities.$type, + storageClasses: globalThis.Array.isArray(object?.storageClasses) + ? object.storageClasses.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: NodeCapabilities): unknown { + const obj: any = {}; + if (message.storageClasses?.length) { + obj.storageClasses = message.storageClasses; + } + return obj; + }, + + create, I>>( + base?: I, + ): NodeCapabilities { + return NodeCapabilities.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): NodeCapabilities { + const message = createBaseNodeCapabilities(); + message.storageClasses = object.storageClasses?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(NodeCapabilities.$type, NodeCapabilities); + +function createBaseNode(): Node { + return { + $type: 'akash.inventory.v1.Node', + name: '', + resources: undefined, + capabilities: undefined, + }; +} + +export const Node = { + $type: 'akash.inventory.v1.Node' as const, + + encode(message: Node, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.resources !== undefined) { + NodeResources.encode( + message.resources, + writer.uint32(18).fork(), + ).ldelim(); + } + if (message.capabilities !== undefined) { + NodeCapabilities.encode( + message.capabilities, + writer.uint32(26).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Node { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.resources = NodeResources.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.capabilities = NodeCapabilities.decode( + reader, + reader.uint32(), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Node { + return { + $type: Node.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + resources: isSet(object.resources) + ? NodeResources.fromJSON(object.resources) + : undefined, + capabilities: isSet(object.capabilities) + ? NodeCapabilities.fromJSON(object.capabilities) + : undefined, + }; + }, + + toJSON(message: Node): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.resources !== undefined) { + obj.resources = NodeResources.toJSON(message.resources); + } + if (message.capabilities !== undefined) { + obj.capabilities = NodeCapabilities.toJSON(message.capabilities); + } + return obj; + }, + + create, I>>(base?: I): Node { + return Node.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Node { + const message = createBaseNode(); + message.name = object.name ?? ''; + message.resources = + object.resources !== undefined && object.resources !== null + ? NodeResources.fromPartial(object.resources) + : undefined; + message.capabilities = + object.capabilities !== undefined && object.capabilities !== null + ? NodeCapabilities.fromPartial(object.capabilities) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Node.$type, Node); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inventory/v1/resourcepair.ts b/ts/src/generated/akash/inventory/v1/resourcepair.ts new file mode 100644 index 00000000..67349fa4 --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/resourcepair.ts @@ -0,0 +1,173 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Quantity } from '../../../k8s.io/apimachinery/pkg/api/resource/generated'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from '../../base/v1beta3/attribute'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** ResourcePair to extents resource.Quantity to provide total and available units of the resource */ +export interface ResourcePair { + $type: 'akash.inventory.v1.ResourcePair'; + allocatable: Quantity | undefined; + allocated: Quantity | undefined; + attributes: Attribute[]; +} + +function createBaseResourcePair(): ResourcePair { + return { + $type: 'akash.inventory.v1.ResourcePair', + allocatable: undefined, + allocated: undefined, + attributes: [], + }; +} + +export const ResourcePair = { + $type: 'akash.inventory.v1.ResourcePair' as const, + + encode( + message: ResourcePair, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.allocatable !== undefined) { + Quantity.encode(message.allocatable, writer.uint32(10).fork()).ldelim(); + } + if (message.allocated !== undefined) { + Quantity.encode(message.allocated, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourcePair { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourcePair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.allocatable = Quantity.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.allocated = Quantity.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourcePair { + return { + $type: ResourcePair.$type, + allocatable: isSet(object.allocatable) + ? Quantity.fromJSON(object.allocatable) + : undefined, + allocated: isSet(object.allocated) + ? Quantity.fromJSON(object.allocated) + : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ResourcePair): unknown { + const obj: any = {}; + if (message.allocatable !== undefined) { + obj.allocatable = Quantity.toJSON(message.allocatable); + } + if (message.allocated !== undefined) { + obj.allocated = Quantity.toJSON(message.allocated); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourcePair { + return ResourcePair.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourcePair { + const message = createBaseResourcePair(); + message.allocatable = + object.allocatable !== undefined && object.allocatable !== null + ? Quantity.fromPartial(object.allocatable) + : undefined; + message.allocated = + object.allocated !== undefined && object.allocated !== null + ? Quantity.fromPartial(object.allocated) + : undefined; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ResourcePair.$type, ResourcePair); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inventory/v1/resources.ts b/ts/src/generated/akash/inventory/v1/resources.ts new file mode 100644 index 00000000..2b9d88d8 --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/resources.ts @@ -0,0 +1,252 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { CPU } from './cpu'; +import { GPU } from './gpu'; +import { Memory } from './memory'; +import { ResourcePair } from './resourcepair'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** NodeResources reports node inventory details */ +export interface NodeResources { + $type: 'akash.inventory.v1.NodeResources'; + cpu: CPU | undefined; + memory: Memory | undefined; + gpu: GPU | undefined; + ephemeralStorage: ResourcePair | undefined; + volumesAttached: ResourcePair | undefined; + volumesMounted: ResourcePair | undefined; +} + +function createBaseNodeResources(): NodeResources { + return { + $type: 'akash.inventory.v1.NodeResources', + cpu: undefined, + memory: undefined, + gpu: undefined, + ephemeralStorage: undefined, + volumesAttached: undefined, + volumesMounted: undefined, + }; +} + +export const NodeResources = { + $type: 'akash.inventory.v1.NodeResources' as const, + + encode( + message: NodeResources, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.cpu !== undefined) { + CPU.encode(message.cpu, writer.uint32(10).fork()).ldelim(); + } + if (message.memory !== undefined) { + Memory.encode(message.memory, writer.uint32(18).fork()).ldelim(); + } + if (message.gpu !== undefined) { + GPU.encode(message.gpu, writer.uint32(26).fork()).ldelim(); + } + if (message.ephemeralStorage !== undefined) { + ResourcePair.encode( + message.ephemeralStorage, + writer.uint32(34).fork(), + ).ldelim(); + } + if (message.volumesAttached !== undefined) { + ResourcePair.encode( + message.volumesAttached, + writer.uint32(42).fork(), + ).ldelim(); + } + if (message.volumesMounted !== undefined) { + ResourcePair.encode( + message.volumesMounted, + writer.uint32(50).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NodeResources { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNodeResources(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.cpu = CPU.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.memory = Memory.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.gpu = GPU.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.ephemeralStorage = ResourcePair.decode( + reader, + reader.uint32(), + ); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.volumesAttached = ResourcePair.decode( + reader, + reader.uint32(), + ); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.volumesMounted = ResourcePair.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): NodeResources { + return { + $type: NodeResources.$type, + cpu: isSet(object.cpu) ? CPU.fromJSON(object.cpu) : undefined, + memory: isSet(object.memory) ? Memory.fromJSON(object.memory) : undefined, + gpu: isSet(object.gpu) ? GPU.fromJSON(object.gpu) : undefined, + ephemeralStorage: isSet(object.ephemeralStorage) + ? ResourcePair.fromJSON(object.ephemeralStorage) + : undefined, + volumesAttached: isSet(object.volumesAttached) + ? ResourcePair.fromJSON(object.volumesAttached) + : undefined, + volumesMounted: isSet(object.volumesMounted) + ? ResourcePair.fromJSON(object.volumesMounted) + : undefined, + }; + }, + + toJSON(message: NodeResources): unknown { + const obj: any = {}; + if (message.cpu !== undefined) { + obj.cpu = CPU.toJSON(message.cpu); + } + if (message.memory !== undefined) { + obj.memory = Memory.toJSON(message.memory); + } + if (message.gpu !== undefined) { + obj.gpu = GPU.toJSON(message.gpu); + } + if (message.ephemeralStorage !== undefined) { + obj.ephemeralStorage = ResourcePair.toJSON(message.ephemeralStorage); + } + if (message.volumesAttached !== undefined) { + obj.volumesAttached = ResourcePair.toJSON(message.volumesAttached); + } + if (message.volumesMounted !== undefined) { + obj.volumesMounted = ResourcePair.toJSON(message.volumesMounted); + } + return obj; + }, + + create, I>>( + base?: I, + ): NodeResources { + return NodeResources.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): NodeResources { + const message = createBaseNodeResources(); + message.cpu = + object.cpu !== undefined && object.cpu !== null + ? CPU.fromPartial(object.cpu) + : undefined; + message.memory = + object.memory !== undefined && object.memory !== null + ? Memory.fromPartial(object.memory) + : undefined; + message.gpu = + object.gpu !== undefined && object.gpu !== null + ? GPU.fromPartial(object.gpu) + : undefined; + message.ephemeralStorage = + object.ephemeralStorage !== undefined && object.ephemeralStorage !== null + ? ResourcePair.fromPartial(object.ephemeralStorage) + : undefined; + message.volumesAttached = + object.volumesAttached !== undefined && object.volumesAttached !== null + ? ResourcePair.fromPartial(object.volumesAttached) + : undefined; + message.volumesMounted = + object.volumesMounted !== undefined && object.volumesMounted !== null + ? ResourcePair.fromPartial(object.volumesMounted) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(NodeResources.$type, NodeResources); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/inventory/v1/service.ts b/ts/src/generated/akash/inventory/v1/service.ts new file mode 100644 index 00000000..ac2c0221 --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/service.ts @@ -0,0 +1,118 @@ +/* eslint-disable */ +import _m0 from 'protobufjs/minimal'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { Empty } from '../../../google/protobuf/empty'; +import { Cluster } from './cluster'; +import { Node } from './node'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** NodeRPC defines the RPC server of node */ +export interface NodeRPC { + /** + * QueryNode defines a method to query hardware state of the node + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + QueryNode(request: Empty): Promise; + /** + * StreamNode defines a method to stream hardware state of the node + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + StreamNode(request: Empty): Observable; +} + +export const NodeRPCServiceName = 'akash.inventory.v1.NodeRPC'; +export class NodeRPCClientImpl implements NodeRPC { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || NodeRPCServiceName; + this.rpc = rpc; + this.QueryNode = this.QueryNode.bind(this); + this.StreamNode = this.StreamNode.bind(this); + } + QueryNode(request: Empty): Promise { + const data = Empty.encode(request).finish(); + const promise = this.rpc.request(this.service, 'QueryNode', data); + return promise.then((data) => Node.decode(_m0.Reader.create(data))); + } + + StreamNode(request: Empty): Observable { + const data = Empty.encode(request).finish(); + const result = this.rpc.serverStreamingRequest( + this.service, + 'StreamNode', + data, + ); + return result.pipe(map((data) => Node.decode(_m0.Reader.create(data)))); + } +} + +/** ClusterRPC defines the RPC server of cluster */ +export interface ClusterRPC { + /** + * QueryCluster defines a method to query hardware state of the cluster + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + QueryCluster(request: Empty): Promise; + /** + * StreamCluster defines a method to stream hardware state of the cluster + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + StreamCluster(request: Empty): Observable; +} + +export const ClusterRPCServiceName = 'akash.inventory.v1.ClusterRPC'; +export class ClusterRPCClientImpl implements ClusterRPC { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || ClusterRPCServiceName; + this.rpc = rpc; + this.QueryCluster = this.QueryCluster.bind(this); + this.StreamCluster = this.StreamCluster.bind(this); + } + QueryCluster(request: Empty): Promise { + const data = Empty.encode(request).finish(); + const promise = this.rpc.request(this.service, 'QueryCluster', data); + return promise.then((data) => Cluster.decode(_m0.Reader.create(data))); + } + + StreamCluster(request: Empty): Observable { + const data = Empty.encode(request).finish(); + const result = this.rpc.serverStreamingRequest( + this.service, + 'StreamCluster', + data, + ); + return result.pipe(map((data) => Cluster.decode(_m0.Reader.create(data)))); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; + clientStreamingRequest( + service: string, + method: string, + data: Observable, + ): Promise; + serverStreamingRequest( + service: string, + method: string, + data: Uint8Array, + ): Observable; + bidirectionalStreamingRequest( + service: string, + method: string, + data: Observable, + ): Observable; +} diff --git a/ts/src/generated/akash/inventory/v1/storage.ts b/ts/src/generated/akash/inventory/v1/storage.ts new file mode 100644 index 00000000..b95761b7 --- /dev/null +++ b/ts/src/generated/akash/inventory/v1/storage.ts @@ -0,0 +1,238 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ResourcePair } from './resourcepair'; + +export const protobufPackage = 'akash.inventory.v1'; + +/** StorageInfo reports Storage details */ +export interface StorageInfo { + $type: 'akash.inventory.v1.StorageInfo'; + class: string; + iops: string; +} + +/** Storage reports Storage inventory details */ +export interface Storage { + $type: 'akash.inventory.v1.Storage'; + quantity: ResourcePair | undefined; + info: StorageInfo | undefined; +} + +function createBaseStorageInfo(): StorageInfo { + return { $type: 'akash.inventory.v1.StorageInfo', class: '', iops: '' }; +} + +export const StorageInfo = { + $type: 'akash.inventory.v1.StorageInfo' as const, + + encode( + message: StorageInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.class !== '') { + writer.uint32(10).string(message.class); + } + if (message.iops !== '') { + writer.uint32(18).string(message.iops); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StorageInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorageInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.class = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.iops = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): StorageInfo { + return { + $type: StorageInfo.$type, + class: isSet(object.class) ? globalThis.String(object.class) : '', + iops: isSet(object.iops) ? globalThis.String(object.iops) : '', + }; + }, + + toJSON(message: StorageInfo): unknown { + const obj: any = {}; + if (message.class !== '') { + obj.class = message.class; + } + if (message.iops !== '') { + obj.iops = message.iops; + } + return obj; + }, + + create, I>>(base?: I): StorageInfo { + return StorageInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): StorageInfo { + const message = createBaseStorageInfo(); + message.class = object.class ?? ''; + message.iops = object.iops ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(StorageInfo.$type, StorageInfo); + +function createBaseStorage(): Storage { + return { + $type: 'akash.inventory.v1.Storage', + quantity: undefined, + info: undefined, + }; +} + +export const Storage = { + $type: 'akash.inventory.v1.Storage' as const, + + encode( + message: Storage, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.quantity !== undefined) { + ResourcePair.encode(message.quantity, writer.uint32(10).fork()).ldelim(); + } + if (message.info !== undefined) { + StorageInfo.encode(message.info, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Storage { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.quantity = ResourcePair.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.info = StorageInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Storage { + return { + $type: Storage.$type, + quantity: isSet(object.quantity) + ? ResourcePair.fromJSON(object.quantity) + : undefined, + info: isSet(object.info) ? StorageInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: Storage): unknown { + const obj: any = {}; + if (message.quantity !== undefined) { + obj.quantity = ResourcePair.toJSON(message.quantity); + } + if (message.info !== undefined) { + obj.info = StorageInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>(base?: I): Storage { + return Storage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Storage { + const message = createBaseStorage(); + message.quantity = + object.quantity !== undefined && object.quantity !== null + ? ResourcePair.fromPartial(object.quantity) + : undefined; + message.info = + object.info !== undefined && object.info !== null + ? StorageInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Storage.$type, Storage); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta1/group.ts b/ts/src/generated/akash/manifest/v2beta1/group.ts new file mode 100644 index 00000000..0a2af840 --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta1/group.ts @@ -0,0 +1,134 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Service } from './service'; + +export const protobufPackage = 'akash.manifest.v2beta1'; + +/** Group store name and list of services */ +export interface Group { + $type: 'akash.manifest.v2beta1.Group'; + name: string; + services: Service[]; +} + +function createBaseGroup(): Group { + return { $type: 'akash.manifest.v2beta1.Group', name: '', services: [] }; +} + +export const Group = { + $type: 'akash.manifest.v2beta1.Group' as const, + + encode(message: Group, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.services) { + Service.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Group { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.services.push(Service.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Group { + return { + $type: Group.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + services: globalThis.Array.isArray(object?.services) + ? object.services.map((e: any) => Service.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Group): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.services?.length) { + obj.services = message.services.map((e) => Service.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Group { + return Group.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Group { + const message = createBaseGroup(); + message.name = object.name ?? ''; + message.services = + object.services?.map((e) => Service.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Group.$type, Group); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta1/httpoptions.ts b/ts/src/generated/akash/manifest/v2beta1/httpoptions.ts new file mode 100644 index 00000000..f7ef8863 --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta1/httpoptions.ts @@ -0,0 +1,227 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.manifest.v2beta1'; + +/** ServiceExposeHTTPOptions */ +export interface ServiceExposeHTTPOptions { + $type: 'akash.manifest.v2beta1.ServiceExposeHTTPOptions'; + maxBodySize: number; + readTimeout: number; + sendTimeout: number; + nextTries: number; + nextTimeout: number; + nextCases: string[]; +} + +function createBaseServiceExposeHTTPOptions(): ServiceExposeHTTPOptions { + return { + $type: 'akash.manifest.v2beta1.ServiceExposeHTTPOptions', + maxBodySize: 0, + readTimeout: 0, + sendTimeout: 0, + nextTries: 0, + nextTimeout: 0, + nextCases: [], + }; +} + +export const ServiceExposeHTTPOptions = { + $type: 'akash.manifest.v2beta1.ServiceExposeHTTPOptions' as const, + + encode( + message: ServiceExposeHTTPOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.maxBodySize !== 0) { + writer.uint32(8).uint32(message.maxBodySize); + } + if (message.readTimeout !== 0) { + writer.uint32(16).uint32(message.readTimeout); + } + if (message.sendTimeout !== 0) { + writer.uint32(24).uint32(message.sendTimeout); + } + if (message.nextTries !== 0) { + writer.uint32(32).uint32(message.nextTries); + } + if (message.nextTimeout !== 0) { + writer.uint32(40).uint32(message.nextTimeout); + } + for (const v of message.nextCases) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ServiceExposeHTTPOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceExposeHTTPOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.maxBodySize = reader.uint32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.readTimeout = reader.uint32(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.sendTimeout = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.nextTries = reader.uint32(); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.nextTimeout = reader.uint32(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.nextCases.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceExposeHTTPOptions { + return { + $type: ServiceExposeHTTPOptions.$type, + maxBodySize: isSet(object.maxBodySize) + ? globalThis.Number(object.maxBodySize) + : 0, + readTimeout: isSet(object.readTimeout) + ? globalThis.Number(object.readTimeout) + : 0, + sendTimeout: isSet(object.sendTimeout) + ? globalThis.Number(object.sendTimeout) + : 0, + nextTries: isSet(object.nextTries) + ? globalThis.Number(object.nextTries) + : 0, + nextTimeout: isSet(object.nextTimeout) + ? globalThis.Number(object.nextTimeout) + : 0, + nextCases: globalThis.Array.isArray(object?.nextCases) + ? object.nextCases.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: ServiceExposeHTTPOptions): unknown { + const obj: any = {}; + if (message.maxBodySize !== 0) { + obj.maxBodySize = Math.round(message.maxBodySize); + } + if (message.readTimeout !== 0) { + obj.readTimeout = Math.round(message.readTimeout); + } + if (message.sendTimeout !== 0) { + obj.sendTimeout = Math.round(message.sendTimeout); + } + if (message.nextTries !== 0) { + obj.nextTries = Math.round(message.nextTries); + } + if (message.nextTimeout !== 0) { + obj.nextTimeout = Math.round(message.nextTimeout); + } + if (message.nextCases?.length) { + obj.nextCases = message.nextCases; + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceExposeHTTPOptions { + return ServiceExposeHTTPOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceExposeHTTPOptions { + const message = createBaseServiceExposeHTTPOptions(); + message.maxBodySize = object.maxBodySize ?? 0; + message.readTimeout = object.readTimeout ?? 0; + message.sendTimeout = object.sendTimeout ?? 0; + message.nextTries = object.nextTries ?? 0; + message.nextTimeout = object.nextTimeout ?? 0; + message.nextCases = object.nextCases?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ServiceExposeHTTPOptions.$type, + ServiceExposeHTTPOptions, +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta1/service.ts b/ts/src/generated/akash/manifest/v2beta1/service.ts new file mode 100644 index 00000000..2fdbcb4e --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta1/service.ts @@ -0,0 +1,478 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ResourceUnits } from '../../base/v1beta2/resourceunits'; +import { ServiceExpose } from './serviceexpose'; + +export const protobufPackage = 'akash.manifest.v2beta1'; + +/** StorageParams */ +export interface StorageParams { + $type: 'akash.manifest.v2beta1.StorageParams'; + name: string; + mount: string; + readOnly: boolean; +} + +/** ServiceParams */ +export interface ServiceParams { + $type: 'akash.manifest.v2beta1.ServiceParams'; + storage: StorageParams[]; +} + +/** Service stores name, image, args, env, unit, count and expose list of service */ +export interface Service { + $type: 'akash.manifest.v2beta1.Service'; + name: string; + image: string; + command: string[]; + args: string[]; + env: string[]; + resources: ResourceUnits | undefined; + count: number; + expose: ServiceExpose[]; + params: ServiceParams | undefined; +} + +function createBaseStorageParams(): StorageParams { + return { + $type: 'akash.manifest.v2beta1.StorageParams', + name: '', + mount: '', + readOnly: false, + }; +} + +export const StorageParams = { + $type: 'akash.manifest.v2beta1.StorageParams' as const, + + encode( + message: StorageParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.mount !== '') { + writer.uint32(18).string(message.mount); + } + if (message.readOnly !== false) { + writer.uint32(24).bool(message.readOnly); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StorageParams { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorageParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.mount = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.readOnly = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): StorageParams { + return { + $type: StorageParams.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + mount: isSet(object.mount) ? globalThis.String(object.mount) : '', + readOnly: isSet(object.readOnly) + ? globalThis.Boolean(object.readOnly) + : false, + }; + }, + + toJSON(message: StorageParams): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.mount !== '') { + obj.mount = message.mount; + } + if (message.readOnly !== false) { + obj.readOnly = message.readOnly; + } + return obj; + }, + + create, I>>( + base?: I, + ): StorageParams { + return StorageParams.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): StorageParams { + const message = createBaseStorageParams(); + message.name = object.name ?? ''; + message.mount = object.mount ?? ''; + message.readOnly = object.readOnly ?? false; + return message; + }, +}; + +messageTypeRegistry.set(StorageParams.$type, StorageParams); + +function createBaseServiceParams(): ServiceParams { + return { $type: 'akash.manifest.v2beta1.ServiceParams', storage: [] }; +} + +export const ServiceParams = { + $type: 'akash.manifest.v2beta1.ServiceParams' as const, + + encode( + message: ServiceParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.storage) { + StorageParams.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceParams { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.storage.push(StorageParams.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceParams { + return { + $type: ServiceParams.$type, + storage: globalThis.Array.isArray(object?.storage) + ? object.storage.map((e: any) => StorageParams.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ServiceParams): unknown { + const obj: any = {}; + if (message.storage?.length) { + obj.storage = message.storage.map((e) => StorageParams.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceParams { + return ServiceParams.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceParams { + const message = createBaseServiceParams(); + message.storage = + object.storage?.map((e) => StorageParams.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceParams.$type, ServiceParams); + +function createBaseService(): Service { + return { + $type: 'akash.manifest.v2beta1.Service', + name: '', + image: '', + command: [], + args: [], + env: [], + resources: undefined, + count: 0, + expose: [], + params: undefined, + }; +} + +export const Service = { + $type: 'akash.manifest.v2beta1.Service' as const, + + encode( + message: Service, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.image !== '') { + writer.uint32(18).string(message.image); + } + for (const v of message.command) { + writer.uint32(26).string(v!); + } + for (const v of message.args) { + writer.uint32(34).string(v!); + } + for (const v of message.env) { + writer.uint32(42).string(v!); + } + if (message.resources !== undefined) { + ResourceUnits.encode( + message.resources, + writer.uint32(50).fork(), + ).ldelim(); + } + if (message.count !== 0) { + writer.uint32(56).uint32(message.count); + } + for (const v of message.expose) { + ServiceExpose.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.params !== undefined) { + ServiceParams.encode(message.params, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Service { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseService(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.image = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.command.push(reader.string()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.args.push(reader.string()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.env.push(reader.string()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.resources = ResourceUnits.decode(reader, reader.uint32()); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.count = reader.uint32(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.expose.push(ServiceExpose.decode(reader, reader.uint32())); + continue; + case 9: + if (tag !== 74) { + break; + } + + message.params = ServiceParams.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Service { + return { + $type: Service.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + image: isSet(object.image) ? globalThis.String(object.image) : '', + command: globalThis.Array.isArray(object?.command) + ? object.command.map((e: any) => globalThis.String(e)) + : [], + args: globalThis.Array.isArray(object?.args) + ? object.args.map((e: any) => globalThis.String(e)) + : [], + env: globalThis.Array.isArray(object?.env) + ? object.env.map((e: any) => globalThis.String(e)) + : [], + resources: isSet(object.resources) + ? ResourceUnits.fromJSON(object.resources) + : undefined, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + expose: globalThis.Array.isArray(object?.expose) + ? object.expose.map((e: any) => ServiceExpose.fromJSON(e)) + : [], + params: isSet(object.params) + ? ServiceParams.fromJSON(object.params) + : undefined, + }; + }, + + toJSON(message: Service): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.image !== '') { + obj.image = message.image; + } + if (message.command?.length) { + obj.command = message.command; + } + if (message.args?.length) { + obj.args = message.args; + } + if (message.env?.length) { + obj.env = message.env; + } + if (message.resources !== undefined) { + obj.resources = ResourceUnits.toJSON(message.resources); + } + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + if (message.expose?.length) { + obj.expose = message.expose.map((e) => ServiceExpose.toJSON(e)); + } + if (message.params !== undefined) { + obj.params = ServiceParams.toJSON(message.params); + } + return obj; + }, + + create, I>>(base?: I): Service { + return Service.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Service { + const message = createBaseService(); + message.name = object.name ?? ''; + message.image = object.image ?? ''; + message.command = object.command?.map((e) => e) || []; + message.args = object.args?.map((e) => e) || []; + message.env = object.env?.map((e) => e) || []; + message.resources = + object.resources !== undefined && object.resources !== null + ? ResourceUnits.fromPartial(object.resources) + : undefined; + message.count = object.count ?? 0; + message.expose = + object.expose?.map((e) => ServiceExpose.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? ServiceParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Service.$type, Service); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts b/ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts new file mode 100644 index 00000000..bcc1da52 --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts @@ -0,0 +1,282 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ServiceExposeHTTPOptions } from './httpoptions'; + +export const protobufPackage = 'akash.manifest.v2beta1'; + +/** ServiceExpose stores exposed ports and hosts details */ +export interface ServiceExpose { + $type: 'akash.manifest.v2beta1.ServiceExpose'; + /** port on the container */ + port: number; + /** port on the service definition */ + externalPort: number; + proto: string; + service: string; + global: boolean; + hosts: string[]; + httpOptions: ServiceExposeHTTPOptions | undefined; + /** The name of the IP address associated with this, if any */ + ip: string; + /** The sequence number of the associated endpoint in the on-chain data */ + endpointSequenceNumber: number; +} + +function createBaseServiceExpose(): ServiceExpose { + return { + $type: 'akash.manifest.v2beta1.ServiceExpose', + port: 0, + externalPort: 0, + proto: '', + service: '', + global: false, + hosts: [], + httpOptions: undefined, + ip: '', + endpointSequenceNumber: 0, + }; +} + +export const ServiceExpose = { + $type: 'akash.manifest.v2beta1.ServiceExpose' as const, + + encode( + message: ServiceExpose, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.port !== 0) { + writer.uint32(8).uint32(message.port); + } + if (message.externalPort !== 0) { + writer.uint32(16).uint32(message.externalPort); + } + if (message.proto !== '') { + writer.uint32(26).string(message.proto); + } + if (message.service !== '') { + writer.uint32(34).string(message.service); + } + if (message.global !== false) { + writer.uint32(40).bool(message.global); + } + for (const v of message.hosts) { + writer.uint32(50).string(v!); + } + if (message.httpOptions !== undefined) { + ServiceExposeHTTPOptions.encode( + message.httpOptions, + writer.uint32(58).fork(), + ).ldelim(); + } + if (message.ip !== '') { + writer.uint32(66).string(message.ip); + } + if (message.endpointSequenceNumber !== 0) { + writer.uint32(72).uint32(message.endpointSequenceNumber); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceExpose { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceExpose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.port = reader.uint32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.externalPort = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.proto = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.service = reader.string(); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.global = reader.bool(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.hosts.push(reader.string()); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.httpOptions = ServiceExposeHTTPOptions.decode( + reader, + reader.uint32(), + ); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.ip = reader.string(); + continue; + case 9: + if (tag !== 72) { + break; + } + + message.endpointSequenceNumber = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceExpose { + return { + $type: ServiceExpose.$type, + port: isSet(object.port) ? globalThis.Number(object.port) : 0, + externalPort: isSet(object.externalPort) + ? globalThis.Number(object.externalPort) + : 0, + proto: isSet(object.proto) ? globalThis.String(object.proto) : '', + service: isSet(object.service) ? globalThis.String(object.service) : '', + global: isSet(object.global) ? globalThis.Boolean(object.global) : false, + hosts: globalThis.Array.isArray(object?.hosts) + ? object.hosts.map((e: any) => globalThis.String(e)) + : [], + httpOptions: isSet(object.httpOptions) + ? ServiceExposeHTTPOptions.fromJSON(object.httpOptions) + : undefined, + ip: isSet(object.ip) ? globalThis.String(object.ip) : '', + endpointSequenceNumber: isSet(object.endpointSequenceNumber) + ? globalThis.Number(object.endpointSequenceNumber) + : 0, + }; + }, + + toJSON(message: ServiceExpose): unknown { + const obj: any = {}; + if (message.port !== 0) { + obj.port = Math.round(message.port); + } + if (message.externalPort !== 0) { + obj.externalPort = Math.round(message.externalPort); + } + if (message.proto !== '') { + obj.proto = message.proto; + } + if (message.service !== '') { + obj.service = message.service; + } + if (message.global !== false) { + obj.global = message.global; + } + if (message.hosts?.length) { + obj.hosts = message.hosts; + } + if (message.httpOptions !== undefined) { + obj.httpOptions = ServiceExposeHTTPOptions.toJSON(message.httpOptions); + } + if (message.ip !== '') { + obj.ip = message.ip; + } + if (message.endpointSequenceNumber !== 0) { + obj.endpointSequenceNumber = Math.round(message.endpointSequenceNumber); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceExpose { + return ServiceExpose.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceExpose { + const message = createBaseServiceExpose(); + message.port = object.port ?? 0; + message.externalPort = object.externalPort ?? 0; + message.proto = object.proto ?? ''; + message.service = object.service ?? ''; + message.global = object.global ?? false; + message.hosts = object.hosts?.map((e) => e) || []; + message.httpOptions = + object.httpOptions !== undefined && object.httpOptions !== null + ? ServiceExposeHTTPOptions.fromPartial(object.httpOptions) + : undefined; + message.ip = object.ip ?? ''; + message.endpointSequenceNumber = object.endpointSequenceNumber ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ServiceExpose.$type, ServiceExpose); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta2/group.ts b/ts/src/generated/akash/manifest/v2beta2/group.ts new file mode 100644 index 00000000..06d96a8b --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta2/group.ts @@ -0,0 +1,134 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Service } from './service'; + +export const protobufPackage = 'akash.manifest.v2beta2'; + +/** Group store name and list of services */ +export interface Group { + $type: 'akash.manifest.v2beta2.Group'; + name: string; + services: Service[]; +} + +function createBaseGroup(): Group { + return { $type: 'akash.manifest.v2beta2.Group', name: '', services: [] }; +} + +export const Group = { + $type: 'akash.manifest.v2beta2.Group' as const, + + encode(message: Group, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.services) { + Service.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Group { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.services.push(Service.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Group { + return { + $type: Group.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + services: globalThis.Array.isArray(object?.services) + ? object.services.map((e: any) => Service.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Group): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.services?.length) { + obj.services = message.services.map((e) => Service.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Group { + return Group.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Group { + const message = createBaseGroup(); + message.name = object.name ?? ''; + message.services = + object.services?.map((e) => Service.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Group.$type, Group); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta2/httpoptions.ts b/ts/src/generated/akash/manifest/v2beta2/httpoptions.ts new file mode 100644 index 00000000..da75f21b --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta2/httpoptions.ts @@ -0,0 +1,227 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.manifest.v2beta2'; + +/** ServiceExposeHTTPOptions */ +export interface ServiceExposeHTTPOptions { + $type: 'akash.manifest.v2beta2.ServiceExposeHTTPOptions'; + maxBodySize: number; + readTimeout: number; + sendTimeout: number; + nextTries: number; + nextTimeout: number; + nextCases: string[]; +} + +function createBaseServiceExposeHTTPOptions(): ServiceExposeHTTPOptions { + return { + $type: 'akash.manifest.v2beta2.ServiceExposeHTTPOptions', + maxBodySize: 0, + readTimeout: 0, + sendTimeout: 0, + nextTries: 0, + nextTimeout: 0, + nextCases: [], + }; +} + +export const ServiceExposeHTTPOptions = { + $type: 'akash.manifest.v2beta2.ServiceExposeHTTPOptions' as const, + + encode( + message: ServiceExposeHTTPOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.maxBodySize !== 0) { + writer.uint32(8).uint32(message.maxBodySize); + } + if (message.readTimeout !== 0) { + writer.uint32(16).uint32(message.readTimeout); + } + if (message.sendTimeout !== 0) { + writer.uint32(24).uint32(message.sendTimeout); + } + if (message.nextTries !== 0) { + writer.uint32(32).uint32(message.nextTries); + } + if (message.nextTimeout !== 0) { + writer.uint32(40).uint32(message.nextTimeout); + } + for (const v of message.nextCases) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ServiceExposeHTTPOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceExposeHTTPOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.maxBodySize = reader.uint32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.readTimeout = reader.uint32(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.sendTimeout = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.nextTries = reader.uint32(); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.nextTimeout = reader.uint32(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.nextCases.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceExposeHTTPOptions { + return { + $type: ServiceExposeHTTPOptions.$type, + maxBodySize: isSet(object.maxBodySize) + ? globalThis.Number(object.maxBodySize) + : 0, + readTimeout: isSet(object.readTimeout) + ? globalThis.Number(object.readTimeout) + : 0, + sendTimeout: isSet(object.sendTimeout) + ? globalThis.Number(object.sendTimeout) + : 0, + nextTries: isSet(object.nextTries) + ? globalThis.Number(object.nextTries) + : 0, + nextTimeout: isSet(object.nextTimeout) + ? globalThis.Number(object.nextTimeout) + : 0, + nextCases: globalThis.Array.isArray(object?.nextCases) + ? object.nextCases.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: ServiceExposeHTTPOptions): unknown { + const obj: any = {}; + if (message.maxBodySize !== 0) { + obj.maxBodySize = Math.round(message.maxBodySize); + } + if (message.readTimeout !== 0) { + obj.readTimeout = Math.round(message.readTimeout); + } + if (message.sendTimeout !== 0) { + obj.sendTimeout = Math.round(message.sendTimeout); + } + if (message.nextTries !== 0) { + obj.nextTries = Math.round(message.nextTries); + } + if (message.nextTimeout !== 0) { + obj.nextTimeout = Math.round(message.nextTimeout); + } + if (message.nextCases?.length) { + obj.nextCases = message.nextCases; + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceExposeHTTPOptions { + return ServiceExposeHTTPOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceExposeHTTPOptions { + const message = createBaseServiceExposeHTTPOptions(); + message.maxBodySize = object.maxBodySize ?? 0; + message.readTimeout = object.readTimeout ?? 0; + message.sendTimeout = object.sendTimeout ?? 0; + message.nextTries = object.nextTries ?? 0; + message.nextTimeout = object.nextTimeout ?? 0; + message.nextCases = object.nextCases?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ServiceExposeHTTPOptions.$type, + ServiceExposeHTTPOptions, +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta2/service.ts b/ts/src/generated/akash/manifest/v2beta2/service.ts new file mode 100644 index 00000000..84591dd8 --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta2/service.ts @@ -0,0 +1,475 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Resources } from '../../base/v1beta3/resources'; +import { ServiceExpose } from './serviceexpose'; + +export const protobufPackage = 'akash.manifest.v2beta2'; + +/** StorageParams */ +export interface StorageParams { + $type: 'akash.manifest.v2beta2.StorageParams'; + name: string; + mount: string; + readOnly: boolean; +} + +/** ServiceParams */ +export interface ServiceParams { + $type: 'akash.manifest.v2beta2.ServiceParams'; + storage: StorageParams[]; +} + +/** Service stores name, image, args, env, unit, count and expose list of service */ +export interface Service { + $type: 'akash.manifest.v2beta2.Service'; + name: string; + image: string; + command: string[]; + args: string[]; + env: string[]; + resources: Resources | undefined; + count: number; + expose: ServiceExpose[]; + params: ServiceParams | undefined; +} + +function createBaseStorageParams(): StorageParams { + return { + $type: 'akash.manifest.v2beta2.StorageParams', + name: '', + mount: '', + readOnly: false, + }; +} + +export const StorageParams = { + $type: 'akash.manifest.v2beta2.StorageParams' as const, + + encode( + message: StorageParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.mount !== '') { + writer.uint32(18).string(message.mount); + } + if (message.readOnly !== false) { + writer.uint32(24).bool(message.readOnly); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StorageParams { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorageParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.mount = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.readOnly = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): StorageParams { + return { + $type: StorageParams.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + mount: isSet(object.mount) ? globalThis.String(object.mount) : '', + readOnly: isSet(object.readOnly) + ? globalThis.Boolean(object.readOnly) + : false, + }; + }, + + toJSON(message: StorageParams): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.mount !== '') { + obj.mount = message.mount; + } + if (message.readOnly !== false) { + obj.readOnly = message.readOnly; + } + return obj; + }, + + create, I>>( + base?: I, + ): StorageParams { + return StorageParams.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): StorageParams { + const message = createBaseStorageParams(); + message.name = object.name ?? ''; + message.mount = object.mount ?? ''; + message.readOnly = object.readOnly ?? false; + return message; + }, +}; + +messageTypeRegistry.set(StorageParams.$type, StorageParams); + +function createBaseServiceParams(): ServiceParams { + return { $type: 'akash.manifest.v2beta2.ServiceParams', storage: [] }; +} + +export const ServiceParams = { + $type: 'akash.manifest.v2beta2.ServiceParams' as const, + + encode( + message: ServiceParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.storage) { + StorageParams.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceParams { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.storage.push(StorageParams.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceParams { + return { + $type: ServiceParams.$type, + storage: globalThis.Array.isArray(object?.storage) + ? object.storage.map((e: any) => StorageParams.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ServiceParams): unknown { + const obj: any = {}; + if (message.storage?.length) { + obj.storage = message.storage.map((e) => StorageParams.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceParams { + return ServiceParams.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceParams { + const message = createBaseServiceParams(); + message.storage = + object.storage?.map((e) => StorageParams.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceParams.$type, ServiceParams); + +function createBaseService(): Service { + return { + $type: 'akash.manifest.v2beta2.Service', + name: '', + image: '', + command: [], + args: [], + env: [], + resources: undefined, + count: 0, + expose: [], + params: undefined, + }; +} + +export const Service = { + $type: 'akash.manifest.v2beta2.Service' as const, + + encode( + message: Service, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.image !== '') { + writer.uint32(18).string(message.image); + } + for (const v of message.command) { + writer.uint32(26).string(v!); + } + for (const v of message.args) { + writer.uint32(34).string(v!); + } + for (const v of message.env) { + writer.uint32(42).string(v!); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(50).fork()).ldelim(); + } + if (message.count !== 0) { + writer.uint32(56).uint32(message.count); + } + for (const v of message.expose) { + ServiceExpose.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.params !== undefined) { + ServiceParams.encode(message.params, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Service { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseService(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.image = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.command.push(reader.string()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.args.push(reader.string()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.env.push(reader.string()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.resources = Resources.decode(reader, reader.uint32()); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.count = reader.uint32(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.expose.push(ServiceExpose.decode(reader, reader.uint32())); + continue; + case 9: + if (tag !== 74) { + break; + } + + message.params = ServiceParams.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Service { + return { + $type: Service.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + image: isSet(object.image) ? globalThis.String(object.image) : '', + command: globalThis.Array.isArray(object?.command) + ? object.command.map((e: any) => globalThis.String(e)) + : [], + args: globalThis.Array.isArray(object?.args) + ? object.args.map((e: any) => globalThis.String(e)) + : [], + env: globalThis.Array.isArray(object?.env) + ? object.env.map((e: any) => globalThis.String(e)) + : [], + resources: isSet(object.resources) + ? Resources.fromJSON(object.resources) + : undefined, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + expose: globalThis.Array.isArray(object?.expose) + ? object.expose.map((e: any) => ServiceExpose.fromJSON(e)) + : [], + params: isSet(object.params) + ? ServiceParams.fromJSON(object.params) + : undefined, + }; + }, + + toJSON(message: Service): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.image !== '') { + obj.image = message.image; + } + if (message.command?.length) { + obj.command = message.command; + } + if (message.args?.length) { + obj.args = message.args; + } + if (message.env?.length) { + obj.env = message.env; + } + if (message.resources !== undefined) { + obj.resources = Resources.toJSON(message.resources); + } + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + if (message.expose?.length) { + obj.expose = message.expose.map((e) => ServiceExpose.toJSON(e)); + } + if (message.params !== undefined) { + obj.params = ServiceParams.toJSON(message.params); + } + return obj; + }, + + create, I>>(base?: I): Service { + return Service.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Service { + const message = createBaseService(); + message.name = object.name ?? ''; + message.image = object.image ?? ''; + message.command = object.command?.map((e) => e) || []; + message.args = object.args?.map((e) => e) || []; + message.env = object.env?.map((e) => e) || []; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.count = object.count ?? 0; + message.expose = + object.expose?.map((e) => ServiceExpose.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? ServiceParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Service.$type, Service); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts b/ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts new file mode 100644 index 00000000..d3a1d345 --- /dev/null +++ b/ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts @@ -0,0 +1,282 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { ServiceExposeHTTPOptions } from './httpoptions'; + +export const protobufPackage = 'akash.manifest.v2beta2'; + +/** ServiceExpose stores exposed ports and hosts details */ +export interface ServiceExpose { + $type: 'akash.manifest.v2beta2.ServiceExpose'; + /** port on the container */ + port: number; + /** port on the service definition */ + externalPort: number; + proto: string; + service: string; + global: boolean; + hosts: string[]; + httpOptions: ServiceExposeHTTPOptions | undefined; + /** The name of the IP address associated with this, if any */ + ip: string; + /** The sequence number of the associated endpoint in the on-chain data */ + endpointSequenceNumber: number; +} + +function createBaseServiceExpose(): ServiceExpose { + return { + $type: 'akash.manifest.v2beta2.ServiceExpose', + port: 0, + externalPort: 0, + proto: '', + service: '', + global: false, + hosts: [], + httpOptions: undefined, + ip: '', + endpointSequenceNumber: 0, + }; +} + +export const ServiceExpose = { + $type: 'akash.manifest.v2beta2.ServiceExpose' as const, + + encode( + message: ServiceExpose, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.port !== 0) { + writer.uint32(8).uint32(message.port); + } + if (message.externalPort !== 0) { + writer.uint32(16).uint32(message.externalPort); + } + if (message.proto !== '') { + writer.uint32(26).string(message.proto); + } + if (message.service !== '') { + writer.uint32(34).string(message.service); + } + if (message.global !== false) { + writer.uint32(40).bool(message.global); + } + for (const v of message.hosts) { + writer.uint32(50).string(v!); + } + if (message.httpOptions !== undefined) { + ServiceExposeHTTPOptions.encode( + message.httpOptions, + writer.uint32(58).fork(), + ).ldelim(); + } + if (message.ip !== '') { + writer.uint32(66).string(message.ip); + } + if (message.endpointSequenceNumber !== 0) { + writer.uint32(72).uint32(message.endpointSequenceNumber); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceExpose { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceExpose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.port = reader.uint32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.externalPort = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.proto = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.service = reader.string(); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.global = reader.bool(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.hosts.push(reader.string()); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.httpOptions = ServiceExposeHTTPOptions.decode( + reader, + reader.uint32(), + ); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.ip = reader.string(); + continue; + case 9: + if (tag !== 72) { + break; + } + + message.endpointSequenceNumber = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceExpose { + return { + $type: ServiceExpose.$type, + port: isSet(object.port) ? globalThis.Number(object.port) : 0, + externalPort: isSet(object.externalPort) + ? globalThis.Number(object.externalPort) + : 0, + proto: isSet(object.proto) ? globalThis.String(object.proto) : '', + service: isSet(object.service) ? globalThis.String(object.service) : '', + global: isSet(object.global) ? globalThis.Boolean(object.global) : false, + hosts: globalThis.Array.isArray(object?.hosts) + ? object.hosts.map((e: any) => globalThis.String(e)) + : [], + httpOptions: isSet(object.httpOptions) + ? ServiceExposeHTTPOptions.fromJSON(object.httpOptions) + : undefined, + ip: isSet(object.ip) ? globalThis.String(object.ip) : '', + endpointSequenceNumber: isSet(object.endpointSequenceNumber) + ? globalThis.Number(object.endpointSequenceNumber) + : 0, + }; + }, + + toJSON(message: ServiceExpose): unknown { + const obj: any = {}; + if (message.port !== 0) { + obj.port = Math.round(message.port); + } + if (message.externalPort !== 0) { + obj.externalPort = Math.round(message.externalPort); + } + if (message.proto !== '') { + obj.proto = message.proto; + } + if (message.service !== '') { + obj.service = message.service; + } + if (message.global !== false) { + obj.global = message.global; + } + if (message.hosts?.length) { + obj.hosts = message.hosts; + } + if (message.httpOptions !== undefined) { + obj.httpOptions = ServiceExposeHTTPOptions.toJSON(message.httpOptions); + } + if (message.ip !== '') { + obj.ip = message.ip; + } + if (message.endpointSequenceNumber !== 0) { + obj.endpointSequenceNumber = Math.round(message.endpointSequenceNumber); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceExpose { + return ServiceExpose.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceExpose { + const message = createBaseServiceExpose(); + message.port = object.port ?? 0; + message.externalPort = object.externalPort ?? 0; + message.proto = object.proto ?? ''; + message.service = object.service ?? ''; + message.global = object.global ?? false; + message.hosts = object.hosts?.map((e) => e) || []; + message.httpOptions = + object.httpOptions !== undefined && object.httpOptions !== null + ? ServiceExposeHTTPOptions.fromPartial(object.httpOptions) + : undefined; + message.ip = object.ip ?? ''; + message.endpointSequenceNumber = object.endpointSequenceNumber ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ServiceExpose.$type, ServiceExpose); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta2/bid.ts b/ts/src/generated/akash/market/v1beta2/bid.ts new file mode 100644 index 00000000..3b09cbbd --- /dev/null +++ b/ts/src/generated/akash/market/v1beta2/bid.ts @@ -0,0 +1,904 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin, DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { OrderID } from './order'; + +export const protobufPackage = 'akash.market.v1beta2'; + +/** MsgCreateBid defines an SDK message for creating Bid */ +export interface MsgCreateBid { + $type: 'akash.market.v1beta2.MsgCreateBid'; + order: OrderID | undefined; + provider: string; + price: DecCoin | undefined; + deposit: Coin | undefined; +} + +/** MsgCreateBidResponse defines the Msg/CreateBid response type. */ +export interface MsgCreateBidResponse { + $type: 'akash.market.v1beta2.MsgCreateBidResponse'; +} + +/** MsgCloseBid defines an SDK message for closing bid */ +export interface MsgCloseBid { + $type: 'akash.market.v1beta2.MsgCloseBid'; + bidId: BidID | undefined; +} + +/** MsgCloseBidResponse defines the Msg/CloseBid response type. */ +export interface MsgCloseBidResponse { + $type: 'akash.market.v1beta2.MsgCloseBidResponse'; +} + +/** + * BidID stores owner and all other seq numbers + * A successful bid becomes a Lease(ID). + */ +export interface BidID { + $type: 'akash.market.v1beta2.BidID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; +} + +/** Bid stores BidID, state of bid and price */ +export interface Bid { + $type: 'akash.market.v1beta2.Bid'; + bidId: BidID | undefined; + state: Bid_State; + price: DecCoin | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of bid */ +export enum Bid_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - BidOpen denotes state for bid open */ + open = 1, + /** active - BidMatched denotes state for bid open */ + active = 2, + /** lost - BidLost denotes state for bid lost */ + lost = 3, + /** closed - BidClosed denotes state for bid closed */ + closed = 4, + UNRECOGNIZED = -1, +} + +export function bid_StateFromJSON(object: any): Bid_State { + switch (object) { + case 0: + case 'invalid': + return Bid_State.invalid; + case 1: + case 'open': + return Bid_State.open; + case 2: + case 'active': + return Bid_State.active; + case 3: + case 'lost': + return Bid_State.lost; + case 4: + case 'closed': + return Bid_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Bid_State.UNRECOGNIZED; + } +} + +export function bid_StateToJSON(object: Bid_State): string { + switch (object) { + case Bid_State.invalid: + return 'invalid'; + case Bid_State.open: + return 'open'; + case Bid_State.active: + return 'active'; + case Bid_State.lost: + return 'lost'; + case Bid_State.closed: + return 'closed'; + case Bid_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** BidFilters defines flags for bid list filter */ +export interface BidFilters { + $type: 'akash.market.v1beta2.BidFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; + state: string; +} + +function createBaseMsgCreateBid(): MsgCreateBid { + return { + $type: 'akash.market.v1beta2.MsgCreateBid', + order: undefined, + provider: '', + price: undefined, + deposit: undefined, + }; +} + +export const MsgCreateBid = { + $type: 'akash.market.v1beta2.MsgCreateBid' as const, + + encode( + message: MsgCreateBid, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.order !== undefined) { + OrderID.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.provider !== '') { + writer.uint32(18).string(message.provider); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.order = OrderID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.provider = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.deposit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateBid { + return { + $type: MsgCreateBid.$type, + order: isSet(object.order) ? OrderID.fromJSON(object.order) : undefined, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + deposit: isSet(object.deposit) + ? Coin.fromJSON(object.deposit) + : undefined, + }; + }, + + toJSON(message: MsgCreateBid): unknown { + const obj: any = {}; + if (message.order !== undefined) { + obj.order = OrderID.toJSON(message.order); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (message.deposit !== undefined) { + obj.deposit = Coin.toJSON(message.deposit); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateBid { + return MsgCreateBid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateBid { + const message = createBaseMsgCreateBid(); + message.order = + object.order !== undefined && object.order !== null + ? OrderID.fromPartial(object.order) + : undefined; + message.provider = object.provider ?? ''; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.deposit = + object.deposit !== undefined && object.deposit !== null + ? Coin.fromPartial(object.deposit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateBid.$type, MsgCreateBid); + +function createBaseMsgCreateBidResponse(): MsgCreateBidResponse { + return { $type: 'akash.market.v1beta2.MsgCreateBidResponse' }; +} + +export const MsgCreateBidResponse = { + $type: 'akash.market.v1beta2.MsgCreateBidResponse' as const, + + encode( + _: MsgCreateBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateBidResponse { + return { $type: MsgCreateBidResponse.$type }; + }, + + toJSON(_: MsgCreateBidResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateBidResponse { + return MsgCreateBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateBidResponse { + const message = createBaseMsgCreateBidResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateBidResponse.$type, MsgCreateBidResponse); + +function createBaseMsgCloseBid(): MsgCloseBid { + return { $type: 'akash.market.v1beta2.MsgCloseBid', bidId: undefined }; +} + +export const MsgCloseBid = { + $type: 'akash.market.v1beta2.MsgCloseBid' as const, + + encode( + message: MsgCloseBid, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseBid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseBid { + return { + $type: MsgCloseBid.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgCloseBid): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>(base?: I): MsgCloseBid { + return MsgCloseBid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseBid { + const message = createBaseMsgCloseBid(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseBid.$type, MsgCloseBid); + +function createBaseMsgCloseBidResponse(): MsgCloseBidResponse { + return { $type: 'akash.market.v1beta2.MsgCloseBidResponse' }; +} + +export const MsgCloseBidResponse = { + $type: 'akash.market.v1beta2.MsgCloseBidResponse' as const, + + encode( + _: MsgCloseBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseBidResponse { + return { $type: MsgCloseBidResponse.$type }; + }, + + toJSON(_: MsgCloseBidResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseBidResponse { + return MsgCloseBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseBidResponse { + const message = createBaseMsgCloseBidResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseBidResponse.$type, MsgCloseBidResponse); + +function createBaseBidID(): BidID { + return { + $type: 'akash.market.v1beta2.BidID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + }; +} + +export const BidID = { + $type: 'akash.market.v1beta2.BidID' as const, + + encode(message: BidID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BidID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBidID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BidID { + return { + $type: BidID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + }; + }, + + toJSON(message: BidID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + return obj; + }, + + create, I>>(base?: I): BidID { + return BidID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BidID { + const message = createBaseBidID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(BidID.$type, BidID); + +function createBaseBid(): Bid { + return { + $type: 'akash.market.v1beta2.Bid', + bidId: undefined, + state: 0, + price: undefined, + createdAt: Long.ZERO, + }; +} + +export const Bid = { + $type: 'akash.market.v1beta2.Bid' as const, + + encode(message: Bid, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Bid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Bid { + return { + $type: Bid.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Bid): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + if (message.state !== 0) { + obj.state = bid_StateToJSON(message.state); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Bid { + return Bid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Bid { + const message = createBaseBid(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + message.state = object.state ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Bid.$type, Bid); + +function createBaseBidFilters(): BidFilters { + return { + $type: 'akash.market.v1beta2.BidFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + state: '', + }; +} + +export const BidFilters = { + $type: 'akash.market.v1beta2.BidFilters' as const, + + encode( + message: BidFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + if (message.state !== '') { + writer.uint32(50).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BidFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBidFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BidFilters { + return { + $type: BidFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: BidFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>(base?: I): BidFilters { + return BidFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): BidFilters { + const message = createBaseBidFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(BidFilters.$type, BidFilters); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta2/genesis.ts b/ts/src/generated/akash/market/v1beta2/genesis.ts new file mode 100644 index 00000000..f085f5d6 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta2/genesis.ts @@ -0,0 +1,168 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Lease } from './lease'; +import { Order } from './order'; +import { Params } from './params'; + +export const protobufPackage = 'akash.market.v1beta2'; + +/** GenesisState defines the basic genesis state used by market module */ +export interface GenesisState { + $type: 'akash.market.v1beta2.GenesisState'; + orders: Order[]; + leases: Lease[]; + params: Params | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.market.v1beta2.GenesisState', + orders: [], + leases: [], + params: undefined, + }; +} + +export const GenesisState = { + $type: 'akash.market.v1beta2.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.orders) { + Order.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.leases) { + Lease.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.orders.push(Order.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.leases.push(Lease.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + orders: globalThis.Array.isArray(object?.orders) + ? object.orders.map((e: any) => Order.fromJSON(e)) + : [], + leases: globalThis.Array.isArray(object?.leases) + ? object.leases.map((e: any) => Lease.fromJSON(e)) + : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.orders?.length) { + obj.orders = message.orders.map((e) => Order.toJSON(e)); + } + if (message.leases?.length) { + obj.leases = message.leases.map((e) => Lease.toJSON(e)); + } + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; + message.leases = object.leases?.map((e) => Lease.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta2/lease.ts b/ts/src/generated/akash/market/v1beta2/lease.ts new file mode 100644 index 00000000..1138b786 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta2/lease.ts @@ -0,0 +1,1013 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { BidID } from './bid'; + +export const protobufPackage = 'akash.market.v1beta2'; + +/** LeaseID stores bid details of lease */ +export interface LeaseID { + $type: 'akash.market.v1beta2.LeaseID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; +} + +/** Lease stores LeaseID, state of lease and price */ +export interface Lease { + $type: 'akash.market.v1beta2.Lease'; + leaseId: LeaseID | undefined; + state: Lease_State; + price: DecCoin | undefined; + createdAt: Long; + closedOn: Long; +} + +/** State is an enum which refers to state of lease */ +export enum Lease_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** active - LeaseActive denotes state for lease active */ + active = 1, + /** insufficient_funds - LeaseInsufficientFunds denotes state for lease insufficient_funds */ + insufficient_funds = 2, + /** closed - LeaseClosed denotes state for lease closed */ + closed = 3, + UNRECOGNIZED = -1, +} + +export function lease_StateFromJSON(object: any): Lease_State { + switch (object) { + case 0: + case 'invalid': + return Lease_State.invalid; + case 1: + case 'active': + return Lease_State.active; + case 2: + case 'insufficient_funds': + return Lease_State.insufficient_funds; + case 3: + case 'closed': + return Lease_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Lease_State.UNRECOGNIZED; + } +} + +export function lease_StateToJSON(object: Lease_State): string { + switch (object) { + case Lease_State.invalid: + return 'invalid'; + case Lease_State.active: + return 'active'; + case Lease_State.insufficient_funds: + return 'insufficient_funds'; + case Lease_State.closed: + return 'closed'; + case Lease_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** LeaseFilters defines flags for lease list filter */ +export interface LeaseFilters { + $type: 'akash.market.v1beta2.LeaseFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; + state: string; +} + +/** MsgCreateLease is sent to create a lease */ +export interface MsgCreateLease { + $type: 'akash.market.v1beta2.MsgCreateLease'; + bidId: BidID | undefined; +} + +/** MsgCreateLeaseResponse is the response from creating a lease */ +export interface MsgCreateLeaseResponse { + $type: 'akash.market.v1beta2.MsgCreateLeaseResponse'; +} + +/** MsgWithdrawLease defines an SDK message for closing bid */ +export interface MsgWithdrawLease { + $type: 'akash.market.v1beta2.MsgWithdrawLease'; + bidId: LeaseID | undefined; +} + +/** MsgWithdrawLeaseResponse defines the Msg/WithdrawLease response type. */ +export interface MsgWithdrawLeaseResponse { + $type: 'akash.market.v1beta2.MsgWithdrawLeaseResponse'; +} + +/** MsgCloseLease defines an SDK message for closing order */ +export interface MsgCloseLease { + $type: 'akash.market.v1beta2.MsgCloseLease'; + leaseId: LeaseID | undefined; +} + +/** MsgCloseLeaseResponse defines the Msg/CloseLease response type. */ +export interface MsgCloseLeaseResponse { + $type: 'akash.market.v1beta2.MsgCloseLeaseResponse'; +} + +function createBaseLeaseID(): LeaseID { + return { + $type: 'akash.market.v1beta2.LeaseID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + }; +} + +export const LeaseID = { + $type: 'akash.market.v1beta2.LeaseID' as const, + + encode( + message: LeaseID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseID { + return { + $type: LeaseID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + }; + }, + + toJSON(message: LeaseID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + return obj; + }, + + create, I>>(base?: I): LeaseID { + return LeaseID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LeaseID { + const message = createBaseLeaseID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(LeaseID.$type, LeaseID); + +function createBaseLease(): Lease { + return { + $type: 'akash.market.v1beta2.Lease', + leaseId: undefined, + state: 0, + price: undefined, + createdAt: Long.ZERO, + closedOn: Long.ZERO, + }; +} + +export const Lease = { + $type: 'akash.market.v1beta2.Lease' as const, + + encode(message: Lease, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + if (!message.closedOn.equals(Long.ZERO)) { + writer.uint32(40).int64(message.closedOn); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Lease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.closedOn = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Lease { + return { + $type: Lease.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + closedOn: isSet(object.closedOn) + ? Long.fromValue(object.closedOn) + : Long.ZERO, + }; + }, + + toJSON(message: Lease): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + if (message.state !== 0) { + obj.state = lease_StateToJSON(message.state); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + if (!message.closedOn.equals(Long.ZERO)) { + obj.closedOn = (message.closedOn || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Lease { + return Lease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Lease { + const message = createBaseLease(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + message.state = object.state ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + message.closedOn = + object.closedOn !== undefined && object.closedOn !== null + ? Long.fromValue(object.closedOn) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Lease.$type, Lease); + +function createBaseLeaseFilters(): LeaseFilters { + return { + $type: 'akash.market.v1beta2.LeaseFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + state: '', + }; +} + +export const LeaseFilters = { + $type: 'akash.market.v1beta2.LeaseFilters' as const, + + encode( + message: LeaseFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + if (message.state !== '') { + writer.uint32(50).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseFilters { + return { + $type: LeaseFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: LeaseFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): LeaseFilters { + return LeaseFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): LeaseFilters { + const message = createBaseLeaseFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(LeaseFilters.$type, LeaseFilters); + +function createBaseMsgCreateLease(): MsgCreateLease { + return { $type: 'akash.market.v1beta2.MsgCreateLease', bidId: undefined }; +} + +export const MsgCreateLease = { + $type: 'akash.market.v1beta2.MsgCreateLease' as const, + + encode( + message: MsgCreateLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateLease { + return { + $type: MsgCreateLease.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgCreateLease): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateLease { + return MsgCreateLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateLease { + const message = createBaseMsgCreateLease(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateLease.$type, MsgCreateLease); + +function createBaseMsgCreateLeaseResponse(): MsgCreateLeaseResponse { + return { $type: 'akash.market.v1beta2.MsgCreateLeaseResponse' }; +} + +export const MsgCreateLeaseResponse = { + $type: 'akash.market.v1beta2.MsgCreateLeaseResponse' as const, + + encode( + _: MsgCreateLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateLeaseResponse { + return { $type: MsgCreateLeaseResponse.$type }; + }, + + toJSON(_: MsgCreateLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateLeaseResponse { + return MsgCreateLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateLeaseResponse { + const message = createBaseMsgCreateLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateLeaseResponse.$type, MsgCreateLeaseResponse); + +function createBaseMsgWithdrawLease(): MsgWithdrawLease { + return { $type: 'akash.market.v1beta2.MsgWithdrawLease', bidId: undefined }; +} + +export const MsgWithdrawLease = { + $type: 'akash.market.v1beta2.MsgWithdrawLease' as const, + + encode( + message: MsgWithdrawLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + LeaseID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgWithdrawLease { + return { + $type: MsgWithdrawLease.$type, + bidId: isSet(object.bidId) ? LeaseID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgWithdrawLease): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = LeaseID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgWithdrawLease { + return MsgWithdrawLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgWithdrawLease { + const message = createBaseMsgWithdrawLease(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? LeaseID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgWithdrawLease.$type, MsgWithdrawLease); + +function createBaseMsgWithdrawLeaseResponse(): MsgWithdrawLeaseResponse { + return { $type: 'akash.market.v1beta2.MsgWithdrawLeaseResponse' }; +} + +export const MsgWithdrawLeaseResponse = { + $type: 'akash.market.v1beta2.MsgWithdrawLeaseResponse' as const, + + encode( + _: MsgWithdrawLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgWithdrawLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgWithdrawLeaseResponse { + return { $type: MsgWithdrawLeaseResponse.$type }; + }, + + toJSON(_: MsgWithdrawLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgWithdrawLeaseResponse { + return MsgWithdrawLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgWithdrawLeaseResponse { + const message = createBaseMsgWithdrawLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgWithdrawLeaseResponse.$type, + MsgWithdrawLeaseResponse, +); + +function createBaseMsgCloseLease(): MsgCloseLease { + return { $type: 'akash.market.v1beta2.MsgCloseLease', leaseId: undefined }; +} + +export const MsgCloseLease = { + $type: 'akash.market.v1beta2.MsgCloseLease' as const, + + encode( + message: MsgCloseLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseLease { + return { + $type: MsgCloseLease.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + }; + }, + + toJSON(message: MsgCloseLease): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseLease { + return MsgCloseLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseLease { + const message = createBaseMsgCloseLease(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseLease.$type, MsgCloseLease); + +function createBaseMsgCloseLeaseResponse(): MsgCloseLeaseResponse { + return { $type: 'akash.market.v1beta2.MsgCloseLeaseResponse' }; +} + +export const MsgCloseLeaseResponse = { + $type: 'akash.market.v1beta2.MsgCloseLeaseResponse' as const, + + encode( + _: MsgCloseLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseLeaseResponse { + return { $type: MsgCloseLeaseResponse.$type }; + }, + + toJSON(_: MsgCloseLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseLeaseResponse { + return MsgCloseLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseLeaseResponse { + const message = createBaseMsgCloseLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseLeaseResponse.$type, MsgCloseLeaseResponse); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta2/order.ts b/ts/src/generated/akash/market/v1beta2/order.ts new file mode 100644 index 00000000..8caa8650 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta2/order.ts @@ -0,0 +1,515 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { GroupSpec } from '../../deployment/v1beta2/groupspec'; + +export const protobufPackage = 'akash.market.v1beta2'; + +/** OrderID stores owner and all other seq numbers */ +export interface OrderID { + $type: 'akash.market.v1beta2.OrderID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; +} + +/** Order stores orderID, state of order and other details */ +export interface Order { + $type: 'akash.market.v1beta2.Order'; + orderId: OrderID | undefined; + state: Order_State; + spec: GroupSpec | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of order */ +export enum Order_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - OrderOpen denotes state for order open */ + open = 1, + /** active - OrderMatched denotes state for order matched */ + active = 2, + /** closed - OrderClosed denotes state for order lost */ + closed = 3, + UNRECOGNIZED = -1, +} + +export function order_StateFromJSON(object: any): Order_State { + switch (object) { + case 0: + case 'invalid': + return Order_State.invalid; + case 1: + case 'open': + return Order_State.open; + case 2: + case 'active': + return Order_State.active; + case 3: + case 'closed': + return Order_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Order_State.UNRECOGNIZED; + } +} + +export function order_StateToJSON(object: Order_State): string { + switch (object) { + case Order_State.invalid: + return 'invalid'; + case Order_State.open: + return 'open'; + case Order_State.active: + return 'active'; + case Order_State.closed: + return 'closed'; + case Order_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** OrderFilters defines flags for order list filter */ +export interface OrderFilters { + $type: 'akash.market.v1beta2.OrderFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + state: string; +} + +function createBaseOrderID(): OrderID { + return { + $type: 'akash.market.v1beta2.OrderID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + }; +} + +export const OrderID = { + $type: 'akash.market.v1beta2.OrderID' as const, + + encode( + message: OrderID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OrderID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderID { + return { + $type: OrderID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + }; + }, + + toJSON(message: OrderID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + return obj; + }, + + create, I>>(base?: I): OrderID { + return OrderID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): OrderID { + const message = createBaseOrderID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(OrderID.$type, OrderID); + +function createBaseOrder(): Order { + return { + $type: 'akash.market.v1beta2.Order', + orderId: undefined, + state: 0, + spec: undefined, + createdAt: Long.ZERO, + }; +} + +export const Order = { + $type: 'akash.market.v1beta2.Order' as const, + + encode(message: Order, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.orderId !== undefined) { + OrderID.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.spec !== undefined) { + GroupSpec.encode(message.spec, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Order { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.orderId = OrderID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.spec = GroupSpec.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Order { + return { + $type: Order.$type, + orderId: isSet(object.orderId) + ? OrderID.fromJSON(object.orderId) + : undefined, + state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + spec: isSet(object.spec) ? GroupSpec.fromJSON(object.spec) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Order): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = OrderID.toJSON(message.orderId); + } + if (message.state !== 0) { + obj.state = order_StateToJSON(message.state); + } + if (message.spec !== undefined) { + obj.spec = GroupSpec.toJSON(message.spec); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Order { + return Order.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Order { + const message = createBaseOrder(); + message.orderId = + object.orderId !== undefined && object.orderId !== null + ? OrderID.fromPartial(object.orderId) + : undefined; + message.state = object.state ?? 0; + message.spec = + object.spec !== undefined && object.spec !== null + ? GroupSpec.fromPartial(object.spec) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Order.$type, Order); + +function createBaseOrderFilters(): OrderFilters { + return { + $type: 'akash.market.v1beta2.OrderFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + state: '', + }; +} + +export const OrderFilters = { + $type: 'akash.market.v1beta2.OrderFilters' as const, + + encode( + message: OrderFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.state !== '') { + writer.uint32(42).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OrderFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderFilters { + return { + $type: OrderFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: OrderFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): OrderFilters { + return OrderFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OrderFilters { + const message = createBaseOrderFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(OrderFilters.$type, OrderFilters); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta2/params.ts b/ts/src/generated/akash/market/v1beta2/params.ts new file mode 100644 index 00000000..fa20791c --- /dev/null +++ b/ts/src/generated/akash/market/v1beta2/params.ts @@ -0,0 +1,145 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.market.v1beta2'; + +/** Params is the params for the x/market module */ +export interface Params { + $type: 'akash.market.v1beta2.Params'; + bidMinDeposit: Coin | undefined; + orderMaxBids: number; +} + +function createBaseParams(): Params { + return { + $type: 'akash.market.v1beta2.Params', + bidMinDeposit: undefined, + orderMaxBids: 0, + }; +} + +export const Params = { + $type: 'akash.market.v1beta2.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidMinDeposit !== undefined) { + Coin.encode(message.bidMinDeposit, writer.uint32(10).fork()).ldelim(); + } + if (message.orderMaxBids !== 0) { + writer.uint32(16).uint32(message.orderMaxBids); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidMinDeposit = Coin.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.orderMaxBids = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + bidMinDeposit: isSet(object.bidMinDeposit) + ? Coin.fromJSON(object.bidMinDeposit) + : undefined, + orderMaxBids: isSet(object.orderMaxBids) + ? globalThis.Number(object.orderMaxBids) + : 0, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.bidMinDeposit !== undefined) { + obj.bidMinDeposit = Coin.toJSON(message.bidMinDeposit); + } + if (message.orderMaxBids !== 0) { + obj.orderMaxBids = Math.round(message.orderMaxBids); + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.bidMinDeposit = + object.bidMinDeposit !== undefined && object.bidMinDeposit !== null + ? Coin.fromPartial(object.bidMinDeposit) + : undefined; + message.orderMaxBids = object.orderMaxBids ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta2/query.ts b/ts/src/generated/akash/market/v1beta2/query.ts new file mode 100644 index 00000000..730e5192 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta2/query.ts @@ -0,0 +1,1332 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, FractionalPayment } from '../../escrow/v1beta2/types'; +import { Bid, BidFilters, BidID } from './bid'; +import { Lease, LeaseFilters, LeaseID } from './lease'; +import { Order, OrderFilters, OrderID } from './order'; + +export const protobufPackage = 'akash.market.v1beta2'; + +/** QueryOrdersRequest is request type for the Query/Orders RPC method */ +export interface QueryOrdersRequest { + $type: 'akash.market.v1beta2.QueryOrdersRequest'; + filters: OrderFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryOrdersResponse is response type for the Query/Orders RPC method */ +export interface QueryOrdersResponse { + $type: 'akash.market.v1beta2.QueryOrdersResponse'; + orders: Order[]; + pagination: PageResponse | undefined; +} + +/** QueryOrderRequest is request type for the Query/Order RPC method */ +export interface QueryOrderRequest { + $type: 'akash.market.v1beta2.QueryOrderRequest'; + id: OrderID | undefined; +} + +/** QueryOrderResponse is response type for the Query/Order RPC method */ +export interface QueryOrderResponse { + $type: 'akash.market.v1beta2.QueryOrderResponse'; + order: Order | undefined; +} + +/** QueryBidsRequest is request type for the Query/Bids RPC method */ +export interface QueryBidsRequest { + $type: 'akash.market.v1beta2.QueryBidsRequest'; + filters: BidFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryBidsResponse is response type for the Query/Bids RPC method */ +export interface QueryBidsResponse { + $type: 'akash.market.v1beta2.QueryBidsResponse'; + bids: QueryBidResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryBidRequest is request type for the Query/Bid RPC method */ +export interface QueryBidRequest { + $type: 'akash.market.v1beta2.QueryBidRequest'; + id: BidID | undefined; +} + +/** QueryBidResponse is response type for the Query/Bid RPC method */ +export interface QueryBidResponse { + $type: 'akash.market.v1beta2.QueryBidResponse'; + bid: Bid | undefined; + escrowAccount: Account | undefined; +} + +/** QueryLeasesRequest is request type for the Query/Leases RPC method */ +export interface QueryLeasesRequest { + $type: 'akash.market.v1beta2.QueryLeasesRequest'; + filters: LeaseFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryLeasesResponse is response type for the Query/Leases RPC method */ +export interface QueryLeasesResponse { + $type: 'akash.market.v1beta2.QueryLeasesResponse'; + leases: QueryLeaseResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryLeaseRequest is request type for the Query/Lease RPC method */ +export interface QueryLeaseRequest { + $type: 'akash.market.v1beta2.QueryLeaseRequest'; + id: LeaseID | undefined; +} + +/** QueryLeaseResponse is response type for the Query/Lease RPC method */ +export interface QueryLeaseResponse { + $type: 'akash.market.v1beta2.QueryLeaseResponse'; + lease: Lease | undefined; + escrowPayment: FractionalPayment | undefined; +} + +function createBaseQueryOrdersRequest(): QueryOrdersRequest { + return { + $type: 'akash.market.v1beta2.QueryOrdersRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryOrdersRequest = { + $type: 'akash.market.v1beta2.QueryOrdersRequest' as const, + + encode( + message: QueryOrdersRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + OrderFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrdersRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = OrderFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrdersRequest { + return { + $type: QueryOrdersRequest.$type, + filters: isSet(object.filters) + ? OrderFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryOrdersRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = OrderFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrdersRequest { + return QueryOrdersRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrdersRequest { + const message = createBaseQueryOrdersRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? OrderFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrdersRequest.$type, QueryOrdersRequest); + +function createBaseQueryOrdersResponse(): QueryOrdersResponse { + return { + $type: 'akash.market.v1beta2.QueryOrdersResponse', + orders: [], + pagination: undefined, + }; +} + +export const QueryOrdersResponse = { + $type: 'akash.market.v1beta2.QueryOrdersResponse' as const, + + encode( + message: QueryOrdersResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.orders) { + Order.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrdersResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.orders.push(Order.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrdersResponse { + return { + $type: QueryOrdersResponse.$type, + orders: globalThis.Array.isArray(object?.orders) + ? object.orders.map((e: any) => Order.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryOrdersResponse): unknown { + const obj: any = {}; + if (message.orders?.length) { + obj.orders = message.orders.map((e) => Order.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrdersResponse { + return QueryOrdersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrdersResponse { + const message = createBaseQueryOrdersResponse(); + message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrdersResponse.$type, QueryOrdersResponse); + +function createBaseQueryOrderRequest(): QueryOrderRequest { + return { $type: 'akash.market.v1beta2.QueryOrderRequest', id: undefined }; +} + +export const QueryOrderRequest = { + $type: 'akash.market.v1beta2.QueryOrderRequest' as const, + + encode( + message: QueryOrderRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + OrderID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrderRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = OrderID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrderRequest { + return { + $type: QueryOrderRequest.$type, + id: isSet(object.id) ? OrderID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryOrderRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = OrderID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrderRequest { + return QueryOrderRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrderRequest { + const message = createBaseQueryOrderRequest(); + message.id = + object.id !== undefined && object.id !== null + ? OrderID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrderRequest.$type, QueryOrderRequest); + +function createBaseQueryOrderResponse(): QueryOrderResponse { + return { $type: 'akash.market.v1beta2.QueryOrderResponse', order: undefined }; +} + +export const QueryOrderResponse = { + $type: 'akash.market.v1beta2.QueryOrderResponse' as const, + + encode( + message: QueryOrderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.order = Order.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrderResponse { + return { + $type: QueryOrderResponse.$type, + order: isSet(object.order) ? Order.fromJSON(object.order) : undefined, + }; + }, + + toJSON(message: QueryOrderResponse): unknown { + const obj: any = {}; + if (message.order !== undefined) { + obj.order = Order.toJSON(message.order); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrderResponse { + return QueryOrderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrderResponse { + const message = createBaseQueryOrderResponse(); + message.order = + object.order !== undefined && object.order !== null + ? Order.fromPartial(object.order) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrderResponse.$type, QueryOrderResponse); + +function createBaseQueryBidsRequest(): QueryBidsRequest { + return { + $type: 'akash.market.v1beta2.QueryBidsRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryBidsRequest = { + $type: 'akash.market.v1beta2.QueryBidsRequest' as const, + + encode( + message: QueryBidsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + BidFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = BidFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidsRequest { + return { + $type: QueryBidsRequest.$type, + filters: isSet(object.filters) + ? BidFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryBidsRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = BidFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidsRequest { + return QueryBidsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidsRequest { + const message = createBaseQueryBidsRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? BidFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidsRequest.$type, QueryBidsRequest); + +function createBaseQueryBidsResponse(): QueryBidsResponse { + return { + $type: 'akash.market.v1beta2.QueryBidsResponse', + bids: [], + pagination: undefined, + }; +} + +export const QueryBidsResponse = { + $type: 'akash.market.v1beta2.QueryBidsResponse' as const, + + encode( + message: QueryBidsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.bids) { + QueryBidResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bids.push(QueryBidResponse.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidsResponse { + return { + $type: QueryBidsResponse.$type, + bids: globalThis.Array.isArray(object?.bids) + ? object.bids.map((e: any) => QueryBidResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryBidsResponse): unknown { + const obj: any = {}; + if (message.bids?.length) { + obj.bids = message.bids.map((e) => QueryBidResponse.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidsResponse { + return QueryBidsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidsResponse { + const message = createBaseQueryBidsResponse(); + message.bids = + object.bids?.map((e) => QueryBidResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidsResponse.$type, QueryBidsResponse); + +function createBaseQueryBidRequest(): QueryBidRequest { + return { $type: 'akash.market.v1beta2.QueryBidRequest', id: undefined }; +} + +export const QueryBidRequest = { + $type: 'akash.market.v1beta2.QueryBidRequest' as const, + + encode( + message: QueryBidRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + BidID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidRequest { + return { + $type: QueryBidRequest.$type, + id: isSet(object.id) ? BidID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryBidRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = BidID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidRequest { + return QueryBidRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidRequest { + const message = createBaseQueryBidRequest(); + message.id = + object.id !== undefined && object.id !== null + ? BidID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidRequest.$type, QueryBidRequest); + +function createBaseQueryBidResponse(): QueryBidResponse { + return { + $type: 'akash.market.v1beta2.QueryBidResponse', + bid: undefined, + escrowAccount: undefined, + }; +} + +export const QueryBidResponse = { + $type: 'akash.market.v1beta2.QueryBidResponse' as const, + + encode( + message: QueryBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bid !== undefined) { + Bid.encode(message.bid, writer.uint32(10).fork()).ldelim(); + } + if (message.escrowAccount !== undefined) { + Account.encode(message.escrowAccount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bid = Bid.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.escrowAccount = Account.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidResponse { + return { + $type: QueryBidResponse.$type, + bid: isSet(object.bid) ? Bid.fromJSON(object.bid) : undefined, + escrowAccount: isSet(object.escrowAccount) + ? Account.fromJSON(object.escrowAccount) + : undefined, + }; + }, + + toJSON(message: QueryBidResponse): unknown { + const obj: any = {}; + if (message.bid !== undefined) { + obj.bid = Bid.toJSON(message.bid); + } + if (message.escrowAccount !== undefined) { + obj.escrowAccount = Account.toJSON(message.escrowAccount); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidResponse { + return QueryBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidResponse { + const message = createBaseQueryBidResponse(); + message.bid = + object.bid !== undefined && object.bid !== null + ? Bid.fromPartial(object.bid) + : undefined; + message.escrowAccount = + object.escrowAccount !== undefined && object.escrowAccount !== null + ? Account.fromPartial(object.escrowAccount) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidResponse.$type, QueryBidResponse); + +function createBaseQueryLeasesRequest(): QueryLeasesRequest { + return { + $type: 'akash.market.v1beta2.QueryLeasesRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryLeasesRequest = { + $type: 'akash.market.v1beta2.QueryLeasesRequest' as const, + + encode( + message: QueryLeasesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + LeaseFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeasesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeasesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = LeaseFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeasesRequest { + return { + $type: QueryLeasesRequest.$type, + filters: isSet(object.filters) + ? LeaseFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryLeasesRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = LeaseFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeasesRequest { + return QueryLeasesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeasesRequest { + const message = createBaseQueryLeasesRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? LeaseFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeasesRequest.$type, QueryLeasesRequest); + +function createBaseQueryLeasesResponse(): QueryLeasesResponse { + return { + $type: 'akash.market.v1beta2.QueryLeasesResponse', + leases: [], + pagination: undefined, + }; +} + +export const QueryLeasesResponse = { + $type: 'akash.market.v1beta2.QueryLeasesResponse' as const, + + encode( + message: QueryLeasesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.leases) { + QueryLeaseResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeasesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeasesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leases.push( + QueryLeaseResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeasesResponse { + return { + $type: QueryLeasesResponse.$type, + leases: globalThis.Array.isArray(object?.leases) + ? object.leases.map((e: any) => QueryLeaseResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryLeasesResponse): unknown { + const obj: any = {}; + if (message.leases?.length) { + obj.leases = message.leases.map((e) => QueryLeaseResponse.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeasesResponse { + return QueryLeasesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeasesResponse { + const message = createBaseQueryLeasesResponse(); + message.leases = + object.leases?.map((e) => QueryLeaseResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeasesResponse.$type, QueryLeasesResponse); + +function createBaseQueryLeaseRequest(): QueryLeaseRequest { + return { $type: 'akash.market.v1beta2.QueryLeaseRequest', id: undefined }; +} + +export const QueryLeaseRequest = { + $type: 'akash.market.v1beta2.QueryLeaseRequest' as const, + + encode( + message: QueryLeaseRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + LeaseID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeaseRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeaseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeaseRequest { + return { + $type: QueryLeaseRequest.$type, + id: isSet(object.id) ? LeaseID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryLeaseRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = LeaseID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeaseRequest { + return QueryLeaseRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeaseRequest { + const message = createBaseQueryLeaseRequest(); + message.id = + object.id !== undefined && object.id !== null + ? LeaseID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeaseRequest.$type, QueryLeaseRequest); + +function createBaseQueryLeaseResponse(): QueryLeaseResponse { + return { + $type: 'akash.market.v1beta2.QueryLeaseResponse', + lease: undefined, + escrowPayment: undefined, + }; +} + +export const QueryLeaseResponse = { + $type: 'akash.market.v1beta2.QueryLeaseResponse' as const, + + encode( + message: QueryLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.lease !== undefined) { + Lease.encode(message.lease, writer.uint32(10).fork()).ldelim(); + } + if (message.escrowPayment !== undefined) { + FractionalPayment.encode( + message.escrowPayment, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.lease = Lease.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.escrowPayment = FractionalPayment.decode( + reader, + reader.uint32(), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeaseResponse { + return { + $type: QueryLeaseResponse.$type, + lease: isSet(object.lease) ? Lease.fromJSON(object.lease) : undefined, + escrowPayment: isSet(object.escrowPayment) + ? FractionalPayment.fromJSON(object.escrowPayment) + : undefined, + }; + }, + + toJSON(message: QueryLeaseResponse): unknown { + const obj: any = {}; + if (message.lease !== undefined) { + obj.lease = Lease.toJSON(message.lease); + } + if (message.escrowPayment !== undefined) { + obj.escrowPayment = FractionalPayment.toJSON(message.escrowPayment); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeaseResponse { + return QueryLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeaseResponse { + const message = createBaseQueryLeaseResponse(); + message.lease = + object.lease !== undefined && object.lease !== null + ? Lease.fromPartial(object.lease) + : undefined; + message.escrowPayment = + object.escrowPayment !== undefined && object.escrowPayment !== null + ? FractionalPayment.fromPartial(object.escrowPayment) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeaseResponse.$type, QueryLeaseResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Orders queries orders with filters */ + Orders(request: QueryOrdersRequest): Promise; + /** Order queries order details */ + Order(request: QueryOrderRequest): Promise; + /** Bids queries bids with filters */ + Bids(request: QueryBidsRequest): Promise; + /** Bid queries bid details */ + Bid(request: QueryBidRequest): Promise; + /** Leases queries leases with filters */ + Leases(request: QueryLeasesRequest): Promise; + /** Lease queries lease details */ + Lease(request: QueryLeaseRequest): Promise; +} + +export const QueryServiceName = 'akash.market.v1beta2.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Orders = this.Orders.bind(this); + this.Order = this.Order.bind(this); + this.Bids = this.Bids.bind(this); + this.Bid = this.Bid.bind(this); + this.Leases = this.Leases.bind(this); + this.Lease = this.Lease.bind(this); + } + Orders(request: QueryOrdersRequest): Promise { + const data = QueryOrdersRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Orders', data); + return promise.then((data) => + QueryOrdersResponse.decode(_m0.Reader.create(data)), + ); + } + + Order(request: QueryOrderRequest): Promise { + const data = QueryOrderRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Order', data); + return promise.then((data) => + QueryOrderResponse.decode(_m0.Reader.create(data)), + ); + } + + Bids(request: QueryBidsRequest): Promise { + const data = QueryBidsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Bids', data); + return promise.then((data) => + QueryBidsResponse.decode(_m0.Reader.create(data)), + ); + } + + Bid(request: QueryBidRequest): Promise { + const data = QueryBidRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Bid', data); + return promise.then((data) => + QueryBidResponse.decode(_m0.Reader.create(data)), + ); + } + + Leases(request: QueryLeasesRequest): Promise { + const data = QueryLeasesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Leases', data); + return promise.then((data) => + QueryLeasesResponse.decode(_m0.Reader.create(data)), + ); + } + + Lease(request: QueryLeaseRequest): Promise { + const data = QueryLeaseRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Lease', data); + return promise.then((data) => + QueryLeaseResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta2/service.ts b/ts/src/generated/akash/market/v1beta2/service.ts new file mode 100644 index 00000000..c1d8ba7e --- /dev/null +++ b/ts/src/generated/akash/market/v1beta2/service.ts @@ -0,0 +1,94 @@ +/* eslint-disable */ +import _m0 from 'protobufjs/minimal'; +import { + MsgCloseBid, + MsgCloseBidResponse, + MsgCreateBid, + MsgCreateBidResponse, +} from './bid'; +import { + MsgCloseLease, + MsgCloseLeaseResponse, + MsgCreateLease, + MsgCreateLeaseResponse, + MsgWithdrawLease, + MsgWithdrawLeaseResponse, +} from './lease'; + +export const protobufPackage = 'akash.market.v1beta2'; + +/** Msg defines the market Msg service */ +export interface Msg { + /** CreateBid defines a method to create a bid given proper inputs. */ + CreateBid(request: MsgCreateBid): Promise; + /** CloseBid defines a method to close a bid given proper inputs. */ + CloseBid(request: MsgCloseBid): Promise; + /** WithdrawLease withdraws accrued funds from the lease payment */ + WithdrawLease(request: MsgWithdrawLease): Promise; + /** CreateLease creates a new lease */ + CreateLease(request: MsgCreateLease): Promise; + /** CloseLease defines a method to close an order given proper inputs. */ + CloseLease(request: MsgCloseLease): Promise; +} + +export const MsgServiceName = 'akash.market.v1beta2.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateBid = this.CreateBid.bind(this); + this.CloseBid = this.CloseBid.bind(this); + this.WithdrawLease = this.WithdrawLease.bind(this); + this.CreateLease = this.CreateLease.bind(this); + this.CloseLease = this.CloseLease.bind(this); + } + CreateBid(request: MsgCreateBid): Promise { + const data = MsgCreateBid.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateBid', data); + return promise.then((data) => + MsgCreateBidResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseBid(request: MsgCloseBid): Promise { + const data = MsgCloseBid.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseBid', data); + return promise.then((data) => + MsgCloseBidResponse.decode(_m0.Reader.create(data)), + ); + } + + WithdrawLease(request: MsgWithdrawLease): Promise { + const data = MsgWithdrawLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'WithdrawLease', data); + return promise.then((data) => + MsgWithdrawLeaseResponse.decode(_m0.Reader.create(data)), + ); + } + + CreateLease(request: MsgCreateLease): Promise { + const data = MsgCreateLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateLease', data); + return promise.then((data) => + MsgCreateLeaseResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseLease(request: MsgCloseLease): Promise { + const data = MsgCloseLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseLease', data); + return promise.then((data) => + MsgCloseLeaseResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} diff --git a/ts/src/generated/akash/market/v1beta3/bid.ts b/ts/src/generated/akash/market/v1beta3/bid.ts new file mode 100644 index 00000000..88ce8dd0 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta3/bid.ts @@ -0,0 +1,904 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin, DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { OrderID } from './order'; + +export const protobufPackage = 'akash.market.v1beta3'; + +/** MsgCreateBid defines an SDK message for creating Bid */ +export interface MsgCreateBid { + $type: 'akash.market.v1beta3.MsgCreateBid'; + order: OrderID | undefined; + provider: string; + price: DecCoin | undefined; + deposit: Coin | undefined; +} + +/** MsgCreateBidResponse defines the Msg/CreateBid response type. */ +export interface MsgCreateBidResponse { + $type: 'akash.market.v1beta3.MsgCreateBidResponse'; +} + +/** MsgCloseBid defines an SDK message for closing bid */ +export interface MsgCloseBid { + $type: 'akash.market.v1beta3.MsgCloseBid'; + bidId: BidID | undefined; +} + +/** MsgCloseBidResponse defines the Msg/CloseBid response type. */ +export interface MsgCloseBidResponse { + $type: 'akash.market.v1beta3.MsgCloseBidResponse'; +} + +/** + * BidID stores owner and all other seq numbers + * A successful bid becomes a Lease(ID). + */ +export interface BidID { + $type: 'akash.market.v1beta3.BidID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; +} + +/** Bid stores BidID, state of bid and price */ +export interface Bid { + $type: 'akash.market.v1beta3.Bid'; + bidId: BidID | undefined; + state: Bid_State; + price: DecCoin | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of bid */ +export enum Bid_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - BidOpen denotes state for bid open */ + open = 1, + /** active - BidMatched denotes state for bid open */ + active = 2, + /** lost - BidLost denotes state for bid lost */ + lost = 3, + /** closed - BidClosed denotes state for bid closed */ + closed = 4, + UNRECOGNIZED = -1, +} + +export function bid_StateFromJSON(object: any): Bid_State { + switch (object) { + case 0: + case 'invalid': + return Bid_State.invalid; + case 1: + case 'open': + return Bid_State.open; + case 2: + case 'active': + return Bid_State.active; + case 3: + case 'lost': + return Bid_State.lost; + case 4: + case 'closed': + return Bid_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Bid_State.UNRECOGNIZED; + } +} + +export function bid_StateToJSON(object: Bid_State): string { + switch (object) { + case Bid_State.invalid: + return 'invalid'; + case Bid_State.open: + return 'open'; + case Bid_State.active: + return 'active'; + case Bid_State.lost: + return 'lost'; + case Bid_State.closed: + return 'closed'; + case Bid_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** BidFilters defines flags for bid list filter */ +export interface BidFilters { + $type: 'akash.market.v1beta3.BidFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; + state: string; +} + +function createBaseMsgCreateBid(): MsgCreateBid { + return { + $type: 'akash.market.v1beta3.MsgCreateBid', + order: undefined, + provider: '', + price: undefined, + deposit: undefined, + }; +} + +export const MsgCreateBid = { + $type: 'akash.market.v1beta3.MsgCreateBid' as const, + + encode( + message: MsgCreateBid, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.order !== undefined) { + OrderID.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.provider !== '') { + writer.uint32(18).string(message.provider); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.order = OrderID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.provider = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.deposit = Coin.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateBid { + return { + $type: MsgCreateBid.$type, + order: isSet(object.order) ? OrderID.fromJSON(object.order) : undefined, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + deposit: isSet(object.deposit) + ? Coin.fromJSON(object.deposit) + : undefined, + }; + }, + + toJSON(message: MsgCreateBid): unknown { + const obj: any = {}; + if (message.order !== undefined) { + obj.order = OrderID.toJSON(message.order); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (message.deposit !== undefined) { + obj.deposit = Coin.toJSON(message.deposit); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateBid { + return MsgCreateBid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateBid { + const message = createBaseMsgCreateBid(); + message.order = + object.order !== undefined && object.order !== null + ? OrderID.fromPartial(object.order) + : undefined; + message.provider = object.provider ?? ''; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.deposit = + object.deposit !== undefined && object.deposit !== null + ? Coin.fromPartial(object.deposit) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateBid.$type, MsgCreateBid); + +function createBaseMsgCreateBidResponse(): MsgCreateBidResponse { + return { $type: 'akash.market.v1beta3.MsgCreateBidResponse' }; +} + +export const MsgCreateBidResponse = { + $type: 'akash.market.v1beta3.MsgCreateBidResponse' as const, + + encode( + _: MsgCreateBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateBidResponse { + return { $type: MsgCreateBidResponse.$type }; + }, + + toJSON(_: MsgCreateBidResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateBidResponse { + return MsgCreateBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateBidResponse { + const message = createBaseMsgCreateBidResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateBidResponse.$type, MsgCreateBidResponse); + +function createBaseMsgCloseBid(): MsgCloseBid { + return { $type: 'akash.market.v1beta3.MsgCloseBid', bidId: undefined }; +} + +export const MsgCloseBid = { + $type: 'akash.market.v1beta3.MsgCloseBid' as const, + + encode( + message: MsgCloseBid, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseBid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseBid { + return { + $type: MsgCloseBid.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgCloseBid): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>(base?: I): MsgCloseBid { + return MsgCloseBid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseBid { + const message = createBaseMsgCloseBid(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseBid.$type, MsgCloseBid); + +function createBaseMsgCloseBidResponse(): MsgCloseBidResponse { + return { $type: 'akash.market.v1beta3.MsgCloseBidResponse' }; +} + +export const MsgCloseBidResponse = { + $type: 'akash.market.v1beta3.MsgCloseBidResponse' as const, + + encode( + _: MsgCloseBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseBidResponse { + return { $type: MsgCloseBidResponse.$type }; + }, + + toJSON(_: MsgCloseBidResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseBidResponse { + return MsgCloseBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseBidResponse { + const message = createBaseMsgCloseBidResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseBidResponse.$type, MsgCloseBidResponse); + +function createBaseBidID(): BidID { + return { + $type: 'akash.market.v1beta3.BidID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + }; +} + +export const BidID = { + $type: 'akash.market.v1beta3.BidID' as const, + + encode(message: BidID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BidID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBidID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BidID { + return { + $type: BidID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + }; + }, + + toJSON(message: BidID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + return obj; + }, + + create, I>>(base?: I): BidID { + return BidID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BidID { + const message = createBaseBidID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(BidID.$type, BidID); + +function createBaseBid(): Bid { + return { + $type: 'akash.market.v1beta3.Bid', + bidId: undefined, + state: 0, + price: undefined, + createdAt: Long.ZERO, + }; +} + +export const Bid = { + $type: 'akash.market.v1beta3.Bid' as const, + + encode(message: Bid, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Bid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Bid { + return { + $type: Bid.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Bid): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + if (message.state !== 0) { + obj.state = bid_StateToJSON(message.state); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Bid { + return Bid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Bid { + const message = createBaseBid(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + message.state = object.state ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Bid.$type, Bid); + +function createBaseBidFilters(): BidFilters { + return { + $type: 'akash.market.v1beta3.BidFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + state: '', + }; +} + +export const BidFilters = { + $type: 'akash.market.v1beta3.BidFilters' as const, + + encode( + message: BidFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + if (message.state !== '') { + writer.uint32(50).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BidFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBidFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BidFilters { + return { + $type: BidFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: BidFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>(base?: I): BidFilters { + return BidFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): BidFilters { + const message = createBaseBidFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(BidFilters.$type, BidFilters); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta3/genesis.ts b/ts/src/generated/akash/market/v1beta3/genesis.ts new file mode 100644 index 00000000..eb6c6a6b --- /dev/null +++ b/ts/src/generated/akash/market/v1beta3/genesis.ts @@ -0,0 +1,188 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Bid } from './bid'; +import { Lease } from './lease'; +import { Order } from './order'; +import { Params } from './params'; + +export const protobufPackage = 'akash.market.v1beta3'; + +/** GenesisState defines the basic genesis state used by market module */ +export interface GenesisState { + $type: 'akash.market.v1beta3.GenesisState'; + params: Params | undefined; + orders: Order[]; + leases: Lease[]; + bids: Bid[]; +} + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.market.v1beta3.GenesisState', + params: undefined, + orders: [], + leases: [], + bids: [], + }; +} + +export const GenesisState = { + $type: 'akash.market.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.orders) { + Order.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.leases) { + Lease.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.bids) { + Bid.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.orders.push(Order.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.leases.push(Lease.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.bids.push(Bid.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + orders: globalThis.Array.isArray(object?.orders) + ? object.orders.map((e: any) => Order.fromJSON(e)) + : [], + leases: globalThis.Array.isArray(object?.leases) + ? object.leases.map((e: any) => Lease.fromJSON(e)) + : [], + bids: globalThis.Array.isArray(object?.bids) + ? object.bids.map((e: any) => Bid.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + if (message.orders?.length) { + obj.orders = message.orders.map((e) => Order.toJSON(e)); + } + if (message.leases?.length) { + obj.leases = message.leases.map((e) => Lease.toJSON(e)); + } + if (message.bids?.length) { + obj.bids = message.bids.map((e) => Bid.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; + message.leases = object.leases?.map((e) => Lease.fromPartial(e)) || []; + message.bids = object.bids?.map((e) => Bid.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta3/lease.ts b/ts/src/generated/akash/market/v1beta3/lease.ts new file mode 100644 index 00000000..13343109 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta3/lease.ts @@ -0,0 +1,1013 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { BidID } from './bid'; + +export const protobufPackage = 'akash.market.v1beta3'; + +/** LeaseID stores bid details of lease */ +export interface LeaseID { + $type: 'akash.market.v1beta3.LeaseID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; +} + +/** Lease stores LeaseID, state of lease and price */ +export interface Lease { + $type: 'akash.market.v1beta3.Lease'; + leaseId: LeaseID | undefined; + state: Lease_State; + price: DecCoin | undefined; + createdAt: Long; + closedOn: Long; +} + +/** State is an enum which refers to state of lease */ +export enum Lease_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** active - LeaseActive denotes state for lease active */ + active = 1, + /** insufficient_funds - LeaseInsufficientFunds denotes state for lease insufficient_funds */ + insufficient_funds = 2, + /** closed - LeaseClosed denotes state for lease closed */ + closed = 3, + UNRECOGNIZED = -1, +} + +export function lease_StateFromJSON(object: any): Lease_State { + switch (object) { + case 0: + case 'invalid': + return Lease_State.invalid; + case 1: + case 'active': + return Lease_State.active; + case 2: + case 'insufficient_funds': + return Lease_State.insufficient_funds; + case 3: + case 'closed': + return Lease_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Lease_State.UNRECOGNIZED; + } +} + +export function lease_StateToJSON(object: Lease_State): string { + switch (object) { + case Lease_State.invalid: + return 'invalid'; + case Lease_State.active: + return 'active'; + case Lease_State.insufficient_funds: + return 'insufficient_funds'; + case Lease_State.closed: + return 'closed'; + case Lease_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** LeaseFilters defines flags for lease list filter */ +export interface LeaseFilters { + $type: 'akash.market.v1beta3.LeaseFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; + state: string; +} + +/** MsgCreateLease is sent to create a lease */ +export interface MsgCreateLease { + $type: 'akash.market.v1beta3.MsgCreateLease'; + bidId: BidID | undefined; +} + +/** MsgCreateLeaseResponse is the response from creating a lease */ +export interface MsgCreateLeaseResponse { + $type: 'akash.market.v1beta3.MsgCreateLeaseResponse'; +} + +/** MsgWithdrawLease defines an SDK message for closing bid */ +export interface MsgWithdrawLease { + $type: 'akash.market.v1beta3.MsgWithdrawLease'; + bidId: LeaseID | undefined; +} + +/** MsgWithdrawLeaseResponse defines the Msg/WithdrawLease response type. */ +export interface MsgWithdrawLeaseResponse { + $type: 'akash.market.v1beta3.MsgWithdrawLeaseResponse'; +} + +/** MsgCloseLease defines an SDK message for closing order */ +export interface MsgCloseLease { + $type: 'akash.market.v1beta3.MsgCloseLease'; + leaseId: LeaseID | undefined; +} + +/** MsgCloseLeaseResponse defines the Msg/CloseLease response type. */ +export interface MsgCloseLeaseResponse { + $type: 'akash.market.v1beta3.MsgCloseLeaseResponse'; +} + +function createBaseLeaseID(): LeaseID { + return { + $type: 'akash.market.v1beta3.LeaseID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + }; +} + +export const LeaseID = { + $type: 'akash.market.v1beta3.LeaseID' as const, + + encode( + message: LeaseID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseID { + return { + $type: LeaseID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + }; + }, + + toJSON(message: LeaseID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + return obj; + }, + + create, I>>(base?: I): LeaseID { + return LeaseID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LeaseID { + const message = createBaseLeaseID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(LeaseID.$type, LeaseID); + +function createBaseLease(): Lease { + return { + $type: 'akash.market.v1beta3.Lease', + leaseId: undefined, + state: 0, + price: undefined, + createdAt: Long.ZERO, + closedOn: Long.ZERO, + }; +} + +export const Lease = { + $type: 'akash.market.v1beta3.Lease' as const, + + encode(message: Lease, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + if (!message.closedOn.equals(Long.ZERO)) { + writer.uint32(40).int64(message.closedOn); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Lease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.closedOn = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Lease { + return { + $type: Lease.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + closedOn: isSet(object.closedOn) + ? Long.fromValue(object.closedOn) + : Long.ZERO, + }; + }, + + toJSON(message: Lease): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + if (message.state !== 0) { + obj.state = lease_StateToJSON(message.state); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + if (!message.closedOn.equals(Long.ZERO)) { + obj.closedOn = (message.closedOn || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Lease { + return Lease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Lease { + const message = createBaseLease(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + message.state = object.state ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + message.closedOn = + object.closedOn !== undefined && object.closedOn !== null + ? Long.fromValue(object.closedOn) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Lease.$type, Lease); + +function createBaseLeaseFilters(): LeaseFilters { + return { + $type: 'akash.market.v1beta3.LeaseFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + state: '', + }; +} + +export const LeaseFilters = { + $type: 'akash.market.v1beta3.LeaseFilters' as const, + + encode( + message: LeaseFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + if (message.state !== '') { + writer.uint32(50).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseFilters { + return { + $type: LeaseFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: LeaseFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): LeaseFilters { + return LeaseFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): LeaseFilters { + const message = createBaseLeaseFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(LeaseFilters.$type, LeaseFilters); + +function createBaseMsgCreateLease(): MsgCreateLease { + return { $type: 'akash.market.v1beta3.MsgCreateLease', bidId: undefined }; +} + +export const MsgCreateLease = { + $type: 'akash.market.v1beta3.MsgCreateLease' as const, + + encode( + message: MsgCreateLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateLease { + return { + $type: MsgCreateLease.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgCreateLease): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateLease { + return MsgCreateLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateLease { + const message = createBaseMsgCreateLease(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateLease.$type, MsgCreateLease); + +function createBaseMsgCreateLeaseResponse(): MsgCreateLeaseResponse { + return { $type: 'akash.market.v1beta3.MsgCreateLeaseResponse' }; +} + +export const MsgCreateLeaseResponse = { + $type: 'akash.market.v1beta3.MsgCreateLeaseResponse' as const, + + encode( + _: MsgCreateLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateLeaseResponse { + return { $type: MsgCreateLeaseResponse.$type }; + }, + + toJSON(_: MsgCreateLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateLeaseResponse { + return MsgCreateLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateLeaseResponse { + const message = createBaseMsgCreateLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateLeaseResponse.$type, MsgCreateLeaseResponse); + +function createBaseMsgWithdrawLease(): MsgWithdrawLease { + return { $type: 'akash.market.v1beta3.MsgWithdrawLease', bidId: undefined }; +} + +export const MsgWithdrawLease = { + $type: 'akash.market.v1beta3.MsgWithdrawLease' as const, + + encode( + message: MsgWithdrawLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + LeaseID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgWithdrawLease { + return { + $type: MsgWithdrawLease.$type, + bidId: isSet(object.bidId) ? LeaseID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgWithdrawLease): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = LeaseID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgWithdrawLease { + return MsgWithdrawLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgWithdrawLease { + const message = createBaseMsgWithdrawLease(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? LeaseID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgWithdrawLease.$type, MsgWithdrawLease); + +function createBaseMsgWithdrawLeaseResponse(): MsgWithdrawLeaseResponse { + return { $type: 'akash.market.v1beta3.MsgWithdrawLeaseResponse' }; +} + +export const MsgWithdrawLeaseResponse = { + $type: 'akash.market.v1beta3.MsgWithdrawLeaseResponse' as const, + + encode( + _: MsgWithdrawLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgWithdrawLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgWithdrawLeaseResponse { + return { $type: MsgWithdrawLeaseResponse.$type }; + }, + + toJSON(_: MsgWithdrawLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgWithdrawLeaseResponse { + return MsgWithdrawLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgWithdrawLeaseResponse { + const message = createBaseMsgWithdrawLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgWithdrawLeaseResponse.$type, + MsgWithdrawLeaseResponse, +); + +function createBaseMsgCloseLease(): MsgCloseLease { + return { $type: 'akash.market.v1beta3.MsgCloseLease', leaseId: undefined }; +} + +export const MsgCloseLease = { + $type: 'akash.market.v1beta3.MsgCloseLease' as const, + + encode( + message: MsgCloseLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseLease { + return { + $type: MsgCloseLease.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + }; + }, + + toJSON(message: MsgCloseLease): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseLease { + return MsgCloseLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseLease { + const message = createBaseMsgCloseLease(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseLease.$type, MsgCloseLease); + +function createBaseMsgCloseLeaseResponse(): MsgCloseLeaseResponse { + return { $type: 'akash.market.v1beta3.MsgCloseLeaseResponse' }; +} + +export const MsgCloseLeaseResponse = { + $type: 'akash.market.v1beta3.MsgCloseLeaseResponse' as const, + + encode( + _: MsgCloseLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseLeaseResponse { + return { $type: MsgCloseLeaseResponse.$type }; + }, + + toJSON(_: MsgCloseLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseLeaseResponse { + return MsgCloseLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseLeaseResponse { + const message = createBaseMsgCloseLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseLeaseResponse.$type, MsgCloseLeaseResponse); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta3/order.ts b/ts/src/generated/akash/market/v1beta3/order.ts new file mode 100644 index 00000000..28ff58a6 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta3/order.ts @@ -0,0 +1,515 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { GroupSpec } from '../../deployment/v1beta3/groupspec'; + +export const protobufPackage = 'akash.market.v1beta3'; + +/** OrderID stores owner and all other seq numbers */ +export interface OrderID { + $type: 'akash.market.v1beta3.OrderID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; +} + +/** Order stores orderID, state of order and other details */ +export interface Order { + $type: 'akash.market.v1beta3.Order'; + orderId: OrderID | undefined; + state: Order_State; + spec: GroupSpec | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of order */ +export enum Order_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - OrderOpen denotes state for order open */ + open = 1, + /** active - OrderMatched denotes state for order matched */ + active = 2, + /** closed - OrderClosed denotes state for order lost */ + closed = 3, + UNRECOGNIZED = -1, +} + +export function order_StateFromJSON(object: any): Order_State { + switch (object) { + case 0: + case 'invalid': + return Order_State.invalid; + case 1: + case 'open': + return Order_State.open; + case 2: + case 'active': + return Order_State.active; + case 3: + case 'closed': + return Order_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Order_State.UNRECOGNIZED; + } +} + +export function order_StateToJSON(object: Order_State): string { + switch (object) { + case Order_State.invalid: + return 'invalid'; + case Order_State.open: + return 'open'; + case Order_State.active: + return 'active'; + case Order_State.closed: + return 'closed'; + case Order_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** OrderFilters defines flags for order list filter */ +export interface OrderFilters { + $type: 'akash.market.v1beta3.OrderFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + state: string; +} + +function createBaseOrderID(): OrderID { + return { + $type: 'akash.market.v1beta3.OrderID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + }; +} + +export const OrderID = { + $type: 'akash.market.v1beta3.OrderID' as const, + + encode( + message: OrderID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OrderID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderID { + return { + $type: OrderID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + }; + }, + + toJSON(message: OrderID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + return obj; + }, + + create, I>>(base?: I): OrderID { + return OrderID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): OrderID { + const message = createBaseOrderID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(OrderID.$type, OrderID); + +function createBaseOrder(): Order { + return { + $type: 'akash.market.v1beta3.Order', + orderId: undefined, + state: 0, + spec: undefined, + createdAt: Long.ZERO, + }; +} + +export const Order = { + $type: 'akash.market.v1beta3.Order' as const, + + encode(message: Order, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.orderId !== undefined) { + OrderID.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.spec !== undefined) { + GroupSpec.encode(message.spec, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Order { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.orderId = OrderID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.spec = GroupSpec.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Order { + return { + $type: Order.$type, + orderId: isSet(object.orderId) + ? OrderID.fromJSON(object.orderId) + : undefined, + state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + spec: isSet(object.spec) ? GroupSpec.fromJSON(object.spec) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Order): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = OrderID.toJSON(message.orderId); + } + if (message.state !== 0) { + obj.state = order_StateToJSON(message.state); + } + if (message.spec !== undefined) { + obj.spec = GroupSpec.toJSON(message.spec); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Order { + return Order.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Order { + const message = createBaseOrder(); + message.orderId = + object.orderId !== undefined && object.orderId !== null + ? OrderID.fromPartial(object.orderId) + : undefined; + message.state = object.state ?? 0; + message.spec = + object.spec !== undefined && object.spec !== null + ? GroupSpec.fromPartial(object.spec) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Order.$type, Order); + +function createBaseOrderFilters(): OrderFilters { + return { + $type: 'akash.market.v1beta3.OrderFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + state: '', + }; +} + +export const OrderFilters = { + $type: 'akash.market.v1beta3.OrderFilters' as const, + + encode( + message: OrderFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.state !== '') { + writer.uint32(42).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OrderFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderFilters { + return { + $type: OrderFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: OrderFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): OrderFilters { + return OrderFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OrderFilters { + const message = createBaseOrderFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(OrderFilters.$type, OrderFilters); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta3/params.ts b/ts/src/generated/akash/market/v1beta3/params.ts new file mode 100644 index 00000000..3636fab4 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta3/params.ts @@ -0,0 +1,145 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.market.v1beta3'; + +/** Params is the params for the x/market module */ +export interface Params { + $type: 'akash.market.v1beta3.Params'; + bidMinDeposit: Coin | undefined; + orderMaxBids: number; +} + +function createBaseParams(): Params { + return { + $type: 'akash.market.v1beta3.Params', + bidMinDeposit: undefined, + orderMaxBids: 0, + }; +} + +export const Params = { + $type: 'akash.market.v1beta3.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidMinDeposit !== undefined) { + Coin.encode(message.bidMinDeposit, writer.uint32(10).fork()).ldelim(); + } + if (message.orderMaxBids !== 0) { + writer.uint32(16).uint32(message.orderMaxBids); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidMinDeposit = Coin.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.orderMaxBids = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + bidMinDeposit: isSet(object.bidMinDeposit) + ? Coin.fromJSON(object.bidMinDeposit) + : undefined, + orderMaxBids: isSet(object.orderMaxBids) + ? globalThis.Number(object.orderMaxBids) + : 0, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.bidMinDeposit !== undefined) { + obj.bidMinDeposit = Coin.toJSON(message.bidMinDeposit); + } + if (message.orderMaxBids !== 0) { + obj.orderMaxBids = Math.round(message.orderMaxBids); + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.bidMinDeposit = + object.bidMinDeposit !== undefined && object.bidMinDeposit !== null + ? Coin.fromPartial(object.bidMinDeposit) + : undefined; + message.orderMaxBids = object.orderMaxBids ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta3/query.ts b/ts/src/generated/akash/market/v1beta3/query.ts new file mode 100644 index 00000000..f5f563ce --- /dev/null +++ b/ts/src/generated/akash/market/v1beta3/query.ts @@ -0,0 +1,1332 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, FractionalPayment } from '../../escrow/v1beta3/types'; +import { Bid, BidFilters, BidID } from './bid'; +import { Lease, LeaseFilters, LeaseID } from './lease'; +import { Order, OrderFilters, OrderID } from './order'; + +export const protobufPackage = 'akash.market.v1beta3'; + +/** QueryOrdersRequest is request type for the Query/Orders RPC method */ +export interface QueryOrdersRequest { + $type: 'akash.market.v1beta3.QueryOrdersRequest'; + filters: OrderFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryOrdersResponse is response type for the Query/Orders RPC method */ +export interface QueryOrdersResponse { + $type: 'akash.market.v1beta3.QueryOrdersResponse'; + orders: Order[]; + pagination: PageResponse | undefined; +} + +/** QueryOrderRequest is request type for the Query/Order RPC method */ +export interface QueryOrderRequest { + $type: 'akash.market.v1beta3.QueryOrderRequest'; + id: OrderID | undefined; +} + +/** QueryOrderResponse is response type for the Query/Order RPC method */ +export interface QueryOrderResponse { + $type: 'akash.market.v1beta3.QueryOrderResponse'; + order: Order | undefined; +} + +/** QueryBidsRequest is request type for the Query/Bids RPC method */ +export interface QueryBidsRequest { + $type: 'akash.market.v1beta3.QueryBidsRequest'; + filters: BidFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryBidsResponse is response type for the Query/Bids RPC method */ +export interface QueryBidsResponse { + $type: 'akash.market.v1beta3.QueryBidsResponse'; + bids: QueryBidResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryBidRequest is request type for the Query/Bid RPC method */ +export interface QueryBidRequest { + $type: 'akash.market.v1beta3.QueryBidRequest'; + id: BidID | undefined; +} + +/** QueryBidResponse is response type for the Query/Bid RPC method */ +export interface QueryBidResponse { + $type: 'akash.market.v1beta3.QueryBidResponse'; + bid: Bid | undefined; + escrowAccount: Account | undefined; +} + +/** QueryLeasesRequest is request type for the Query/Leases RPC method */ +export interface QueryLeasesRequest { + $type: 'akash.market.v1beta3.QueryLeasesRequest'; + filters: LeaseFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryLeasesResponse is response type for the Query/Leases RPC method */ +export interface QueryLeasesResponse { + $type: 'akash.market.v1beta3.QueryLeasesResponse'; + leases: QueryLeaseResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryLeaseRequest is request type for the Query/Lease RPC method */ +export interface QueryLeaseRequest { + $type: 'akash.market.v1beta3.QueryLeaseRequest'; + id: LeaseID | undefined; +} + +/** QueryLeaseResponse is response type for the Query/Lease RPC method */ +export interface QueryLeaseResponse { + $type: 'akash.market.v1beta3.QueryLeaseResponse'; + lease: Lease | undefined; + escrowPayment: FractionalPayment | undefined; +} + +function createBaseQueryOrdersRequest(): QueryOrdersRequest { + return { + $type: 'akash.market.v1beta3.QueryOrdersRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryOrdersRequest = { + $type: 'akash.market.v1beta3.QueryOrdersRequest' as const, + + encode( + message: QueryOrdersRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + OrderFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrdersRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = OrderFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrdersRequest { + return { + $type: QueryOrdersRequest.$type, + filters: isSet(object.filters) + ? OrderFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryOrdersRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = OrderFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrdersRequest { + return QueryOrdersRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrdersRequest { + const message = createBaseQueryOrdersRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? OrderFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrdersRequest.$type, QueryOrdersRequest); + +function createBaseQueryOrdersResponse(): QueryOrdersResponse { + return { + $type: 'akash.market.v1beta3.QueryOrdersResponse', + orders: [], + pagination: undefined, + }; +} + +export const QueryOrdersResponse = { + $type: 'akash.market.v1beta3.QueryOrdersResponse' as const, + + encode( + message: QueryOrdersResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.orders) { + Order.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrdersResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.orders.push(Order.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrdersResponse { + return { + $type: QueryOrdersResponse.$type, + orders: globalThis.Array.isArray(object?.orders) + ? object.orders.map((e: any) => Order.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryOrdersResponse): unknown { + const obj: any = {}; + if (message.orders?.length) { + obj.orders = message.orders.map((e) => Order.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrdersResponse { + return QueryOrdersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrdersResponse { + const message = createBaseQueryOrdersResponse(); + message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrdersResponse.$type, QueryOrdersResponse); + +function createBaseQueryOrderRequest(): QueryOrderRequest { + return { $type: 'akash.market.v1beta3.QueryOrderRequest', id: undefined }; +} + +export const QueryOrderRequest = { + $type: 'akash.market.v1beta3.QueryOrderRequest' as const, + + encode( + message: QueryOrderRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + OrderID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrderRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = OrderID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrderRequest { + return { + $type: QueryOrderRequest.$type, + id: isSet(object.id) ? OrderID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryOrderRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = OrderID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrderRequest { + return QueryOrderRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrderRequest { + const message = createBaseQueryOrderRequest(); + message.id = + object.id !== undefined && object.id !== null + ? OrderID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrderRequest.$type, QueryOrderRequest); + +function createBaseQueryOrderResponse(): QueryOrderResponse { + return { $type: 'akash.market.v1beta3.QueryOrderResponse', order: undefined }; +} + +export const QueryOrderResponse = { + $type: 'akash.market.v1beta3.QueryOrderResponse' as const, + + encode( + message: QueryOrderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.order = Order.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrderResponse { + return { + $type: QueryOrderResponse.$type, + order: isSet(object.order) ? Order.fromJSON(object.order) : undefined, + }; + }, + + toJSON(message: QueryOrderResponse): unknown { + const obj: any = {}; + if (message.order !== undefined) { + obj.order = Order.toJSON(message.order); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrderResponse { + return QueryOrderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrderResponse { + const message = createBaseQueryOrderResponse(); + message.order = + object.order !== undefined && object.order !== null + ? Order.fromPartial(object.order) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrderResponse.$type, QueryOrderResponse); + +function createBaseQueryBidsRequest(): QueryBidsRequest { + return { + $type: 'akash.market.v1beta3.QueryBidsRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryBidsRequest = { + $type: 'akash.market.v1beta3.QueryBidsRequest' as const, + + encode( + message: QueryBidsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + BidFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = BidFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidsRequest { + return { + $type: QueryBidsRequest.$type, + filters: isSet(object.filters) + ? BidFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryBidsRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = BidFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidsRequest { + return QueryBidsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidsRequest { + const message = createBaseQueryBidsRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? BidFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidsRequest.$type, QueryBidsRequest); + +function createBaseQueryBidsResponse(): QueryBidsResponse { + return { + $type: 'akash.market.v1beta3.QueryBidsResponse', + bids: [], + pagination: undefined, + }; +} + +export const QueryBidsResponse = { + $type: 'akash.market.v1beta3.QueryBidsResponse' as const, + + encode( + message: QueryBidsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.bids) { + QueryBidResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bids.push(QueryBidResponse.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidsResponse { + return { + $type: QueryBidsResponse.$type, + bids: globalThis.Array.isArray(object?.bids) + ? object.bids.map((e: any) => QueryBidResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryBidsResponse): unknown { + const obj: any = {}; + if (message.bids?.length) { + obj.bids = message.bids.map((e) => QueryBidResponse.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidsResponse { + return QueryBidsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidsResponse { + const message = createBaseQueryBidsResponse(); + message.bids = + object.bids?.map((e) => QueryBidResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidsResponse.$type, QueryBidsResponse); + +function createBaseQueryBidRequest(): QueryBidRequest { + return { $type: 'akash.market.v1beta3.QueryBidRequest', id: undefined }; +} + +export const QueryBidRequest = { + $type: 'akash.market.v1beta3.QueryBidRequest' as const, + + encode( + message: QueryBidRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + BidID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidRequest { + return { + $type: QueryBidRequest.$type, + id: isSet(object.id) ? BidID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryBidRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = BidID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidRequest { + return QueryBidRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidRequest { + const message = createBaseQueryBidRequest(); + message.id = + object.id !== undefined && object.id !== null + ? BidID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidRequest.$type, QueryBidRequest); + +function createBaseQueryBidResponse(): QueryBidResponse { + return { + $type: 'akash.market.v1beta3.QueryBidResponse', + bid: undefined, + escrowAccount: undefined, + }; +} + +export const QueryBidResponse = { + $type: 'akash.market.v1beta3.QueryBidResponse' as const, + + encode( + message: QueryBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bid !== undefined) { + Bid.encode(message.bid, writer.uint32(10).fork()).ldelim(); + } + if (message.escrowAccount !== undefined) { + Account.encode(message.escrowAccount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bid = Bid.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.escrowAccount = Account.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidResponse { + return { + $type: QueryBidResponse.$type, + bid: isSet(object.bid) ? Bid.fromJSON(object.bid) : undefined, + escrowAccount: isSet(object.escrowAccount) + ? Account.fromJSON(object.escrowAccount) + : undefined, + }; + }, + + toJSON(message: QueryBidResponse): unknown { + const obj: any = {}; + if (message.bid !== undefined) { + obj.bid = Bid.toJSON(message.bid); + } + if (message.escrowAccount !== undefined) { + obj.escrowAccount = Account.toJSON(message.escrowAccount); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidResponse { + return QueryBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidResponse { + const message = createBaseQueryBidResponse(); + message.bid = + object.bid !== undefined && object.bid !== null + ? Bid.fromPartial(object.bid) + : undefined; + message.escrowAccount = + object.escrowAccount !== undefined && object.escrowAccount !== null + ? Account.fromPartial(object.escrowAccount) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidResponse.$type, QueryBidResponse); + +function createBaseQueryLeasesRequest(): QueryLeasesRequest { + return { + $type: 'akash.market.v1beta3.QueryLeasesRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryLeasesRequest = { + $type: 'akash.market.v1beta3.QueryLeasesRequest' as const, + + encode( + message: QueryLeasesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + LeaseFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeasesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeasesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = LeaseFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeasesRequest { + return { + $type: QueryLeasesRequest.$type, + filters: isSet(object.filters) + ? LeaseFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryLeasesRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = LeaseFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeasesRequest { + return QueryLeasesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeasesRequest { + const message = createBaseQueryLeasesRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? LeaseFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeasesRequest.$type, QueryLeasesRequest); + +function createBaseQueryLeasesResponse(): QueryLeasesResponse { + return { + $type: 'akash.market.v1beta3.QueryLeasesResponse', + leases: [], + pagination: undefined, + }; +} + +export const QueryLeasesResponse = { + $type: 'akash.market.v1beta3.QueryLeasesResponse' as const, + + encode( + message: QueryLeasesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.leases) { + QueryLeaseResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeasesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeasesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leases.push( + QueryLeaseResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeasesResponse { + return { + $type: QueryLeasesResponse.$type, + leases: globalThis.Array.isArray(object?.leases) + ? object.leases.map((e: any) => QueryLeaseResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryLeasesResponse): unknown { + const obj: any = {}; + if (message.leases?.length) { + obj.leases = message.leases.map((e) => QueryLeaseResponse.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeasesResponse { + return QueryLeasesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeasesResponse { + const message = createBaseQueryLeasesResponse(); + message.leases = + object.leases?.map((e) => QueryLeaseResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeasesResponse.$type, QueryLeasesResponse); + +function createBaseQueryLeaseRequest(): QueryLeaseRequest { + return { $type: 'akash.market.v1beta3.QueryLeaseRequest', id: undefined }; +} + +export const QueryLeaseRequest = { + $type: 'akash.market.v1beta3.QueryLeaseRequest' as const, + + encode( + message: QueryLeaseRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + LeaseID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeaseRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeaseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeaseRequest { + return { + $type: QueryLeaseRequest.$type, + id: isSet(object.id) ? LeaseID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryLeaseRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = LeaseID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeaseRequest { + return QueryLeaseRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeaseRequest { + const message = createBaseQueryLeaseRequest(); + message.id = + object.id !== undefined && object.id !== null + ? LeaseID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeaseRequest.$type, QueryLeaseRequest); + +function createBaseQueryLeaseResponse(): QueryLeaseResponse { + return { + $type: 'akash.market.v1beta3.QueryLeaseResponse', + lease: undefined, + escrowPayment: undefined, + }; +} + +export const QueryLeaseResponse = { + $type: 'akash.market.v1beta3.QueryLeaseResponse' as const, + + encode( + message: QueryLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.lease !== undefined) { + Lease.encode(message.lease, writer.uint32(10).fork()).ldelim(); + } + if (message.escrowPayment !== undefined) { + FractionalPayment.encode( + message.escrowPayment, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.lease = Lease.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.escrowPayment = FractionalPayment.decode( + reader, + reader.uint32(), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeaseResponse { + return { + $type: QueryLeaseResponse.$type, + lease: isSet(object.lease) ? Lease.fromJSON(object.lease) : undefined, + escrowPayment: isSet(object.escrowPayment) + ? FractionalPayment.fromJSON(object.escrowPayment) + : undefined, + }; + }, + + toJSON(message: QueryLeaseResponse): unknown { + const obj: any = {}; + if (message.lease !== undefined) { + obj.lease = Lease.toJSON(message.lease); + } + if (message.escrowPayment !== undefined) { + obj.escrowPayment = FractionalPayment.toJSON(message.escrowPayment); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeaseResponse { + return QueryLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeaseResponse { + const message = createBaseQueryLeaseResponse(); + message.lease = + object.lease !== undefined && object.lease !== null + ? Lease.fromPartial(object.lease) + : undefined; + message.escrowPayment = + object.escrowPayment !== undefined && object.escrowPayment !== null + ? FractionalPayment.fromPartial(object.escrowPayment) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeaseResponse.$type, QueryLeaseResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Orders queries orders with filters */ + Orders(request: QueryOrdersRequest): Promise; + /** Order queries order details */ + Order(request: QueryOrderRequest): Promise; + /** Bids queries bids with filters */ + Bids(request: QueryBidsRequest): Promise; + /** Bid queries bid details */ + Bid(request: QueryBidRequest): Promise; + /** Leases queries leases with filters */ + Leases(request: QueryLeasesRequest): Promise; + /** Lease queries lease details */ + Lease(request: QueryLeaseRequest): Promise; +} + +export const QueryServiceName = 'akash.market.v1beta3.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Orders = this.Orders.bind(this); + this.Order = this.Order.bind(this); + this.Bids = this.Bids.bind(this); + this.Bid = this.Bid.bind(this); + this.Leases = this.Leases.bind(this); + this.Lease = this.Lease.bind(this); + } + Orders(request: QueryOrdersRequest): Promise { + const data = QueryOrdersRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Orders', data); + return promise.then((data) => + QueryOrdersResponse.decode(_m0.Reader.create(data)), + ); + } + + Order(request: QueryOrderRequest): Promise { + const data = QueryOrderRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Order', data); + return promise.then((data) => + QueryOrderResponse.decode(_m0.Reader.create(data)), + ); + } + + Bids(request: QueryBidsRequest): Promise { + const data = QueryBidsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Bids', data); + return promise.then((data) => + QueryBidsResponse.decode(_m0.Reader.create(data)), + ); + } + + Bid(request: QueryBidRequest): Promise { + const data = QueryBidRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Bid', data); + return promise.then((data) => + QueryBidResponse.decode(_m0.Reader.create(data)), + ); + } + + Leases(request: QueryLeasesRequest): Promise { + const data = QueryLeasesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Leases', data); + return promise.then((data) => + QueryLeasesResponse.decode(_m0.Reader.create(data)), + ); + } + + Lease(request: QueryLeaseRequest): Promise { + const data = QueryLeaseRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Lease', data); + return promise.then((data) => + QueryLeaseResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta3/service.ts b/ts/src/generated/akash/market/v1beta3/service.ts new file mode 100644 index 00000000..dd33082b --- /dev/null +++ b/ts/src/generated/akash/market/v1beta3/service.ts @@ -0,0 +1,94 @@ +/* eslint-disable */ +import _m0 from 'protobufjs/minimal'; +import { + MsgCloseBid, + MsgCloseBidResponse, + MsgCreateBid, + MsgCreateBidResponse, +} from './bid'; +import { + MsgCloseLease, + MsgCloseLeaseResponse, + MsgCreateLease, + MsgCreateLeaseResponse, + MsgWithdrawLease, + MsgWithdrawLeaseResponse, +} from './lease'; + +export const protobufPackage = 'akash.market.v1beta3'; + +/** Msg defines the market Msg service */ +export interface Msg { + /** CreateBid defines a method to create a bid given proper inputs. */ + CreateBid(request: MsgCreateBid): Promise; + /** CloseBid defines a method to close a bid given proper inputs. */ + CloseBid(request: MsgCloseBid): Promise; + /** WithdrawLease withdraws accrued funds from the lease payment */ + WithdrawLease(request: MsgWithdrawLease): Promise; + /** CreateLease creates a new lease */ + CreateLease(request: MsgCreateLease): Promise; + /** CloseLease defines a method to close an order given proper inputs. */ + CloseLease(request: MsgCloseLease): Promise; +} + +export const MsgServiceName = 'akash.market.v1beta3.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateBid = this.CreateBid.bind(this); + this.CloseBid = this.CloseBid.bind(this); + this.WithdrawLease = this.WithdrawLease.bind(this); + this.CreateLease = this.CreateLease.bind(this); + this.CloseLease = this.CloseLease.bind(this); + } + CreateBid(request: MsgCreateBid): Promise { + const data = MsgCreateBid.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateBid', data); + return promise.then((data) => + MsgCreateBidResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseBid(request: MsgCloseBid): Promise { + const data = MsgCloseBid.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseBid', data); + return promise.then((data) => + MsgCloseBidResponse.decode(_m0.Reader.create(data)), + ); + } + + WithdrawLease(request: MsgWithdrawLease): Promise { + const data = MsgWithdrawLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'WithdrawLease', data); + return promise.then((data) => + MsgWithdrawLeaseResponse.decode(_m0.Reader.create(data)), + ); + } + + CreateLease(request: MsgCreateLease): Promise { + const data = MsgCreateLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateLease', data); + return promise.then((data) => + MsgCreateLeaseResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseLease(request: MsgCloseLease): Promise { + const data = MsgCloseLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseLease', data); + return promise.then((data) => + MsgCloseLeaseResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} diff --git a/ts/src/generated/akash/market/v1beta4/bid.ts b/ts/src/generated/akash/market/v1beta4/bid.ts new file mode 100644 index 00000000..7d824a8c --- /dev/null +++ b/ts/src/generated/akash/market/v1beta4/bid.ts @@ -0,0 +1,1059 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin, DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Resources } from '../../base/v1beta3/resources'; +import { OrderID } from './order'; + +export const protobufPackage = 'akash.market.v1beta4'; + +/** + * ResourceOffer describes resources that provider is offering + * for deployment + */ +export interface ResourceOffer { + $type: 'akash.market.v1beta4.ResourceOffer'; + resources: Resources | undefined; + count: number; +} + +/** MsgCreateBid defines an SDK message for creating Bid */ +export interface MsgCreateBid { + $type: 'akash.market.v1beta4.MsgCreateBid'; + order: OrderID | undefined; + provider: string; + price: DecCoin | undefined; + deposit: Coin | undefined; + resourcesOffer: ResourceOffer[]; +} + +/** MsgCreateBidResponse defines the Msg/CreateBid response type. */ +export interface MsgCreateBidResponse { + $type: 'akash.market.v1beta4.MsgCreateBidResponse'; +} + +/** MsgCloseBid defines an SDK message for closing bid */ +export interface MsgCloseBid { + $type: 'akash.market.v1beta4.MsgCloseBid'; + bidId: BidID | undefined; +} + +/** MsgCloseBidResponse defines the Msg/CloseBid response type. */ +export interface MsgCloseBidResponse { + $type: 'akash.market.v1beta4.MsgCloseBidResponse'; +} + +/** + * BidID stores owner and all other seq numbers + * A successful bid becomes a Lease(ID). + */ +export interface BidID { + $type: 'akash.market.v1beta4.BidID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; +} + +/** Bid stores BidID, state of bid and price */ +export interface Bid { + $type: 'akash.market.v1beta4.Bid'; + bidId: BidID | undefined; + state: Bid_State; + price: DecCoin | undefined; + createdAt: Long; + resourcesOffer: ResourceOffer[]; +} + +/** State is an enum which refers to state of bid */ +export enum Bid_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - BidOpen denotes state for bid open */ + open = 1, + /** active - BidMatched denotes state for bid open */ + active = 2, + /** lost - BidLost denotes state for bid lost */ + lost = 3, + /** closed - BidClosed denotes state for bid closed */ + closed = 4, + UNRECOGNIZED = -1, +} + +export function bid_StateFromJSON(object: any): Bid_State { + switch (object) { + case 0: + case 'invalid': + return Bid_State.invalid; + case 1: + case 'open': + return Bid_State.open; + case 2: + case 'active': + return Bid_State.active; + case 3: + case 'lost': + return Bid_State.lost; + case 4: + case 'closed': + return Bid_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Bid_State.UNRECOGNIZED; + } +} + +export function bid_StateToJSON(object: Bid_State): string { + switch (object) { + case Bid_State.invalid: + return 'invalid'; + case Bid_State.open: + return 'open'; + case Bid_State.active: + return 'active'; + case Bid_State.lost: + return 'lost'; + case Bid_State.closed: + return 'closed'; + case Bid_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** BidFilters defines flags for bid list filter */ +export interface BidFilters { + $type: 'akash.market.v1beta4.BidFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; + state: string; +} + +function createBaseResourceOffer(): ResourceOffer { + return { + $type: 'akash.market.v1beta4.ResourceOffer', + resources: undefined, + count: 0, + }; +} + +export const ResourceOffer = { + $type: 'akash.market.v1beta4.ResourceOffer' as const, + + encode( + message: ResourceOffer, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(10).fork()).ldelim(); + } + if (message.count !== 0) { + writer.uint32(16).uint32(message.count); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceOffer { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceOffer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resources = Resources.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.count = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourceOffer { + return { + $type: ResourceOffer.$type, + resources: isSet(object.resources) + ? Resources.fromJSON(object.resources) + : undefined, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + }; + }, + + toJSON(message: ResourceOffer): unknown { + const obj: any = {}; + if (message.resources !== undefined) { + obj.resources = Resources.toJSON(message.resources); + } + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourceOffer { + return ResourceOffer.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourceOffer { + const message = createBaseResourceOffer(); + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.count = object.count ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ResourceOffer.$type, ResourceOffer); + +function createBaseMsgCreateBid(): MsgCreateBid { + return { + $type: 'akash.market.v1beta4.MsgCreateBid', + order: undefined, + provider: '', + price: undefined, + deposit: undefined, + resourcesOffer: [], + }; +} + +export const MsgCreateBid = { + $type: 'akash.market.v1beta4.MsgCreateBid' as const, + + encode( + message: MsgCreateBid, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.order !== undefined) { + OrderID.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.provider !== '') { + writer.uint32(18).string(message.provider); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.resourcesOffer) { + ResourceOffer.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.order = OrderID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.provider = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.deposit = Coin.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.resourcesOffer.push( + ResourceOffer.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateBid { + return { + $type: MsgCreateBid.$type, + order: isSet(object.order) ? OrderID.fromJSON(object.order) : undefined, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + deposit: isSet(object.deposit) + ? Coin.fromJSON(object.deposit) + : undefined, + resourcesOffer: globalThis.Array.isArray(object?.resourcesOffer) + ? object.resourcesOffer.map((e: any) => ResourceOffer.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MsgCreateBid): unknown { + const obj: any = {}; + if (message.order !== undefined) { + obj.order = OrderID.toJSON(message.order); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (message.deposit !== undefined) { + obj.deposit = Coin.toJSON(message.deposit); + } + if (message.resourcesOffer?.length) { + obj.resourcesOffer = message.resourcesOffer.map((e) => + ResourceOffer.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateBid { + return MsgCreateBid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateBid { + const message = createBaseMsgCreateBid(); + message.order = + object.order !== undefined && object.order !== null + ? OrderID.fromPartial(object.order) + : undefined; + message.provider = object.provider ?? ''; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.deposit = + object.deposit !== undefined && object.deposit !== null + ? Coin.fromPartial(object.deposit) + : undefined; + message.resourcesOffer = + object.resourcesOffer?.map((e) => ResourceOffer.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateBid.$type, MsgCreateBid); + +function createBaseMsgCreateBidResponse(): MsgCreateBidResponse { + return { $type: 'akash.market.v1beta4.MsgCreateBidResponse' }; +} + +export const MsgCreateBidResponse = { + $type: 'akash.market.v1beta4.MsgCreateBidResponse' as const, + + encode( + _: MsgCreateBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateBidResponse { + return { $type: MsgCreateBidResponse.$type }; + }, + + toJSON(_: MsgCreateBidResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateBidResponse { + return MsgCreateBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateBidResponse { + const message = createBaseMsgCreateBidResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateBidResponse.$type, MsgCreateBidResponse); + +function createBaseMsgCloseBid(): MsgCloseBid { + return { $type: 'akash.market.v1beta4.MsgCloseBid', bidId: undefined }; +} + +export const MsgCloseBid = { + $type: 'akash.market.v1beta4.MsgCloseBid' as const, + + encode( + message: MsgCloseBid, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseBid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseBid { + return { + $type: MsgCloseBid.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgCloseBid): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>(base?: I): MsgCloseBid { + return MsgCloseBid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseBid { + const message = createBaseMsgCloseBid(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseBid.$type, MsgCloseBid); + +function createBaseMsgCloseBidResponse(): MsgCloseBidResponse { + return { $type: 'akash.market.v1beta4.MsgCloseBidResponse' }; +} + +export const MsgCloseBidResponse = { + $type: 'akash.market.v1beta4.MsgCloseBidResponse' as const, + + encode( + _: MsgCloseBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseBidResponse { + return { $type: MsgCloseBidResponse.$type }; + }, + + toJSON(_: MsgCloseBidResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseBidResponse { + return MsgCloseBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseBidResponse { + const message = createBaseMsgCloseBidResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseBidResponse.$type, MsgCloseBidResponse); + +function createBaseBidID(): BidID { + return { + $type: 'akash.market.v1beta4.BidID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + }; +} + +export const BidID = { + $type: 'akash.market.v1beta4.BidID' as const, + + encode(message: BidID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BidID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBidID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BidID { + return { + $type: BidID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + }; + }, + + toJSON(message: BidID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + return obj; + }, + + create, I>>(base?: I): BidID { + return BidID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BidID { + const message = createBaseBidID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(BidID.$type, BidID); + +function createBaseBid(): Bid { + return { + $type: 'akash.market.v1beta4.Bid', + bidId: undefined, + state: 0, + price: undefined, + createdAt: Long.ZERO, + resourcesOffer: [], + }; +} + +export const Bid = { + $type: 'akash.market.v1beta4.Bid' as const, + + encode(message: Bid, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + for (const v of message.resourcesOffer) { + ResourceOffer.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Bid { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + case 5: + if (tag !== 42) { + break; + } + + message.resourcesOffer.push( + ResourceOffer.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Bid { + return { + $type: Bid.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + resourcesOffer: globalThis.Array.isArray(object?.resourcesOffer) + ? object.resourcesOffer.map((e: any) => ResourceOffer.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Bid): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + if (message.state !== 0) { + obj.state = bid_StateToJSON(message.state); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + if (message.resourcesOffer?.length) { + obj.resourcesOffer = message.resourcesOffer.map((e) => + ResourceOffer.toJSON(e), + ); + } + return obj; + }, + + create, I>>(base?: I): Bid { + return Bid.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Bid { + const message = createBaseBid(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + message.state = object.state ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + message.resourcesOffer = + object.resourcesOffer?.map((e) => ResourceOffer.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Bid.$type, Bid); + +function createBaseBidFilters(): BidFilters { + return { + $type: 'akash.market.v1beta4.BidFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + state: '', + }; +} + +export const BidFilters = { + $type: 'akash.market.v1beta4.BidFilters' as const, + + encode( + message: BidFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + if (message.state !== '') { + writer.uint32(50).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BidFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBidFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BidFilters { + return { + $type: BidFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: BidFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>(base?: I): BidFilters { + return BidFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): BidFilters { + const message = createBaseBidFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(BidFilters.$type, BidFilters); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta4/genesis.ts b/ts/src/generated/akash/market/v1beta4/genesis.ts new file mode 100644 index 00000000..09ddc481 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta4/genesis.ts @@ -0,0 +1,188 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Bid } from './bid'; +import { Lease } from './lease'; +import { Order } from './order'; +import { Params } from './params'; + +export const protobufPackage = 'akash.market.v1beta4'; + +/** GenesisState defines the basic genesis state used by market module */ +export interface GenesisState { + $type: 'akash.market.v1beta4.GenesisState'; + params: Params | undefined; + orders: Order[]; + leases: Lease[]; + bids: Bid[]; +} + +function createBaseGenesisState(): GenesisState { + return { + $type: 'akash.market.v1beta4.GenesisState', + params: undefined, + orders: [], + leases: [], + bids: [], + }; +} + +export const GenesisState = { + $type: 'akash.market.v1beta4.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.orders) { + Order.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.leases) { + Lease.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.bids) { + Bid.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.orders.push(Order.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.leases.push(Lease.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.bids.push(Bid.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + orders: globalThis.Array.isArray(object?.orders) + ? object.orders.map((e: any) => Order.fromJSON(e)) + : [], + leases: globalThis.Array.isArray(object?.leases) + ? object.leases.map((e: any) => Lease.fromJSON(e)) + : [], + bids: globalThis.Array.isArray(object?.bids) + ? object.bids.map((e: any) => Bid.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + if (message.orders?.length) { + obj.orders = message.orders.map((e) => Order.toJSON(e)); + } + if (message.leases?.length) { + obj.leases = message.leases.map((e) => Lease.toJSON(e)); + } + if (message.bids?.length) { + obj.bids = message.bids.map((e) => Bid.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; + message.leases = object.leases?.map((e) => Lease.fromPartial(e)) || []; + message.bids = object.bids?.map((e) => Bid.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta4/lease.ts b/ts/src/generated/akash/market/v1beta4/lease.ts new file mode 100644 index 00000000..c22c8e53 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta4/lease.ts @@ -0,0 +1,1013 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { DecCoin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { BidID } from './bid'; + +export const protobufPackage = 'akash.market.v1beta4'; + +/** LeaseID stores bid details of lease */ +export interface LeaseID { + $type: 'akash.market.v1beta4.LeaseID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; +} + +/** Lease stores LeaseID, state of lease and price */ +export interface Lease { + $type: 'akash.market.v1beta4.Lease'; + leaseId: LeaseID | undefined; + state: Lease_State; + price: DecCoin | undefined; + createdAt: Long; + closedOn: Long; +} + +/** State is an enum which refers to state of lease */ +export enum Lease_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** active - LeaseActive denotes state for lease active */ + active = 1, + /** insufficient_funds - LeaseInsufficientFunds denotes state for lease insufficient_funds */ + insufficient_funds = 2, + /** closed - LeaseClosed denotes state for lease closed */ + closed = 3, + UNRECOGNIZED = -1, +} + +export function lease_StateFromJSON(object: any): Lease_State { + switch (object) { + case 0: + case 'invalid': + return Lease_State.invalid; + case 1: + case 'active': + return Lease_State.active; + case 2: + case 'insufficient_funds': + return Lease_State.insufficient_funds; + case 3: + case 'closed': + return Lease_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Lease_State.UNRECOGNIZED; + } +} + +export function lease_StateToJSON(object: Lease_State): string { + switch (object) { + case Lease_State.invalid: + return 'invalid'; + case Lease_State.active: + return 'active'; + case Lease_State.insufficient_funds: + return 'insufficient_funds'; + case Lease_State.closed: + return 'closed'; + case Lease_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** LeaseFilters defines flags for lease list filter */ +export interface LeaseFilters { + $type: 'akash.market.v1beta4.LeaseFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + provider: string; + state: string; +} + +/** MsgCreateLease is sent to create a lease */ +export interface MsgCreateLease { + $type: 'akash.market.v1beta4.MsgCreateLease'; + bidId: BidID | undefined; +} + +/** MsgCreateLeaseResponse is the response from creating a lease */ +export interface MsgCreateLeaseResponse { + $type: 'akash.market.v1beta4.MsgCreateLeaseResponse'; +} + +/** MsgWithdrawLease defines an SDK message for closing bid */ +export interface MsgWithdrawLease { + $type: 'akash.market.v1beta4.MsgWithdrawLease'; + bidId: LeaseID | undefined; +} + +/** MsgWithdrawLeaseResponse defines the Msg/WithdrawLease response type. */ +export interface MsgWithdrawLeaseResponse { + $type: 'akash.market.v1beta4.MsgWithdrawLeaseResponse'; +} + +/** MsgCloseLease defines an SDK message for closing order */ +export interface MsgCloseLease { + $type: 'akash.market.v1beta4.MsgCloseLease'; + leaseId: LeaseID | undefined; +} + +/** MsgCloseLeaseResponse defines the Msg/CloseLease response type. */ +export interface MsgCloseLeaseResponse { + $type: 'akash.market.v1beta4.MsgCloseLeaseResponse'; +} + +function createBaseLeaseID(): LeaseID { + return { + $type: 'akash.market.v1beta4.LeaseID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + }; +} + +export const LeaseID = { + $type: 'akash.market.v1beta4.LeaseID' as const, + + encode( + message: LeaseID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseID { + return { + $type: LeaseID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + }; + }, + + toJSON(message: LeaseID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + return obj; + }, + + create, I>>(base?: I): LeaseID { + return LeaseID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LeaseID { + const message = createBaseLeaseID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(LeaseID.$type, LeaseID); + +function createBaseLease(): Lease { + return { + $type: 'akash.market.v1beta4.Lease', + leaseId: undefined, + state: 0, + price: undefined, + createdAt: Long.ZERO, + closedOn: Long.ZERO, + }; +} + +export const Lease = { + $type: 'akash.market.v1beta4.Lease' as const, + + encode(message: Lease, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + if (!message.closedOn.equals(Long.ZERO)) { + writer.uint32(40).int64(message.closedOn); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Lease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.price = DecCoin.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.closedOn = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Lease { + return { + $type: Lease.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + closedOn: isSet(object.closedOn) + ? Long.fromValue(object.closedOn) + : Long.ZERO, + }; + }, + + toJSON(message: Lease): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + if (message.state !== 0) { + obj.state = lease_StateToJSON(message.state); + } + if (message.price !== undefined) { + obj.price = DecCoin.toJSON(message.price); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + if (!message.closedOn.equals(Long.ZERO)) { + obj.closedOn = (message.closedOn || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Lease { + return Lease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Lease { + const message = createBaseLease(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + message.state = object.state ?? 0; + message.price = + object.price !== undefined && object.price !== null + ? DecCoin.fromPartial(object.price) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + message.closedOn = + object.closedOn !== undefined && object.closedOn !== null + ? Long.fromValue(object.closedOn) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Lease.$type, Lease); + +function createBaseLeaseFilters(): LeaseFilters { + return { + $type: 'akash.market.v1beta4.LeaseFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + provider: '', + state: '', + }; +} + +export const LeaseFilters = { + $type: 'akash.market.v1beta4.LeaseFilters' as const, + + encode( + message: LeaseFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.provider !== '') { + writer.uint32(42).string(message.provider); + } + if (message.state !== '') { + writer.uint32(50).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.provider = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseFilters { + return { + $type: LeaseFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + provider: isSet(object.provider) + ? globalThis.String(object.provider) + : '', + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: LeaseFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.provider !== '') { + obj.provider = message.provider; + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): LeaseFilters { + return LeaseFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): LeaseFilters { + const message = createBaseLeaseFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.provider = object.provider ?? ''; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(LeaseFilters.$type, LeaseFilters); + +function createBaseMsgCreateLease(): MsgCreateLease { + return { $type: 'akash.market.v1beta4.MsgCreateLease', bidId: undefined }; +} + +export const MsgCreateLease = { + $type: 'akash.market.v1beta4.MsgCreateLease' as const, + + encode( + message: MsgCreateLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + BidID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateLease { + return { + $type: MsgCreateLease.$type, + bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgCreateLease): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = BidID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateLease { + return MsgCreateLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateLease { + const message = createBaseMsgCreateLease(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? BidID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateLease.$type, MsgCreateLease); + +function createBaseMsgCreateLeaseResponse(): MsgCreateLeaseResponse { + return { $type: 'akash.market.v1beta4.MsgCreateLeaseResponse' }; +} + +export const MsgCreateLeaseResponse = { + $type: 'akash.market.v1beta4.MsgCreateLeaseResponse' as const, + + encode( + _: MsgCreateLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateLeaseResponse { + return { $type: MsgCreateLeaseResponse.$type }; + }, + + toJSON(_: MsgCreateLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateLeaseResponse { + return MsgCreateLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateLeaseResponse { + const message = createBaseMsgCreateLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateLeaseResponse.$type, MsgCreateLeaseResponse); + +function createBaseMsgWithdrawLease(): MsgWithdrawLease { + return { $type: 'akash.market.v1beta4.MsgWithdrawLease', bidId: undefined }; +} + +export const MsgWithdrawLease = { + $type: 'akash.market.v1beta4.MsgWithdrawLease' as const, + + encode( + message: MsgWithdrawLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidId !== undefined) { + LeaseID.encode(message.bidId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidId = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgWithdrawLease { + return { + $type: MsgWithdrawLease.$type, + bidId: isSet(object.bidId) ? LeaseID.fromJSON(object.bidId) : undefined, + }; + }, + + toJSON(message: MsgWithdrawLease): unknown { + const obj: any = {}; + if (message.bidId !== undefined) { + obj.bidId = LeaseID.toJSON(message.bidId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgWithdrawLease { + return MsgWithdrawLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgWithdrawLease { + const message = createBaseMsgWithdrawLease(); + message.bidId = + object.bidId !== undefined && object.bidId !== null + ? LeaseID.fromPartial(object.bidId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgWithdrawLease.$type, MsgWithdrawLease); + +function createBaseMsgWithdrawLeaseResponse(): MsgWithdrawLeaseResponse { + return { $type: 'akash.market.v1beta4.MsgWithdrawLeaseResponse' }; +} + +export const MsgWithdrawLeaseResponse = { + $type: 'akash.market.v1beta4.MsgWithdrawLeaseResponse' as const, + + encode( + _: MsgWithdrawLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgWithdrawLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgWithdrawLeaseResponse { + return { $type: MsgWithdrawLeaseResponse.$type }; + }, + + toJSON(_: MsgWithdrawLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgWithdrawLeaseResponse { + return MsgWithdrawLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgWithdrawLeaseResponse { + const message = createBaseMsgWithdrawLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgWithdrawLeaseResponse.$type, + MsgWithdrawLeaseResponse, +); + +function createBaseMsgCloseLease(): MsgCloseLease { + return { $type: 'akash.market.v1beta4.MsgCloseLease', leaseId: undefined }; +} + +export const MsgCloseLease = { + $type: 'akash.market.v1beta4.MsgCloseLease' as const, + + encode( + message: MsgCloseLease, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseLease { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseLease(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCloseLease { + return { + $type: MsgCloseLease.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + }; + }, + + toJSON(message: MsgCloseLease): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseLease { + return MsgCloseLease.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCloseLease { + const message = createBaseMsgCloseLease(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseLease.$type, MsgCloseLease); + +function createBaseMsgCloseLeaseResponse(): MsgCloseLeaseResponse { + return { $type: 'akash.market.v1beta4.MsgCloseLeaseResponse' }; +} + +export const MsgCloseLeaseResponse = { + $type: 'akash.market.v1beta4.MsgCloseLeaseResponse' as const, + + encode( + _: MsgCloseLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCloseLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCloseLeaseResponse { + return { $type: MsgCloseLeaseResponse.$type }; + }, + + toJSON(_: MsgCloseLeaseResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCloseLeaseResponse { + return MsgCloseLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCloseLeaseResponse { + const message = createBaseMsgCloseLeaseResponse(); + return message; + }, +}; + +messageTypeRegistry.set(MsgCloseLeaseResponse.$type, MsgCloseLeaseResponse); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta4/order.ts b/ts/src/generated/akash/market/v1beta4/order.ts new file mode 100644 index 00000000..3fc74131 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta4/order.ts @@ -0,0 +1,515 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { GroupSpec } from '../../deployment/v1beta3/groupspec'; + +export const protobufPackage = 'akash.market.v1beta4'; + +/** OrderID stores owner and all other seq numbers */ +export interface OrderID { + $type: 'akash.market.v1beta4.OrderID'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; +} + +/** Order stores orderID, state of order and other details */ +export interface Order { + $type: 'akash.market.v1beta4.Order'; + orderId: OrderID | undefined; + state: Order_State; + spec: GroupSpec | undefined; + createdAt: Long; +} + +/** State is an enum which refers to state of order */ +export enum Order_State { + /** invalid - Prefix should start with 0 in enum. So declaring dummy state */ + invalid = 0, + /** open - OrderOpen denotes state for order open */ + open = 1, + /** active - OrderMatched denotes state for order matched */ + active = 2, + /** closed - OrderClosed denotes state for order lost */ + closed = 3, + UNRECOGNIZED = -1, +} + +export function order_StateFromJSON(object: any): Order_State { + switch (object) { + case 0: + case 'invalid': + return Order_State.invalid; + case 1: + case 'open': + return Order_State.open; + case 2: + case 'active': + return Order_State.active; + case 3: + case 'closed': + return Order_State.closed; + case -1: + case 'UNRECOGNIZED': + default: + return Order_State.UNRECOGNIZED; + } +} + +export function order_StateToJSON(object: Order_State): string { + switch (object) { + case Order_State.invalid: + return 'invalid'; + case Order_State.open: + return 'open'; + case Order_State.active: + return 'active'; + case Order_State.closed: + return 'closed'; + case Order_State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** OrderFilters defines flags for order list filter */ +export interface OrderFilters { + $type: 'akash.market.v1beta4.OrderFilters'; + owner: string; + dseq: Long; + gseq: number; + oseq: number; + state: string; +} + +function createBaseOrderID(): OrderID { + return { + $type: 'akash.market.v1beta4.OrderID', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + }; +} + +export const OrderID = { + $type: 'akash.market.v1beta4.OrderID' as const, + + encode( + message: OrderID, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OrderID { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderID { + return { + $type: OrderID.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + }; + }, + + toJSON(message: OrderID): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + return obj; + }, + + create, I>>(base?: I): OrderID { + return OrderID.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): OrderID { + const message = createBaseOrderID(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(OrderID.$type, OrderID); + +function createBaseOrder(): Order { + return { + $type: 'akash.market.v1beta4.Order', + orderId: undefined, + state: 0, + spec: undefined, + createdAt: Long.ZERO, + }; +} + +export const Order = { + $type: 'akash.market.v1beta4.Order' as const, + + encode(message: Order, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.orderId !== undefined) { + OrderID.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(16).int32(message.state); + } + if (message.spec !== undefined) { + GroupSpec.encode(message.spec, writer.uint32(26).fork()).ldelim(); + } + if (!message.createdAt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.createdAt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Order { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.orderId = OrderID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.state = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.spec = GroupSpec.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdAt = reader.int64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Order { + return { + $type: Order.$type, + orderId: isSet(object.orderId) + ? OrderID.fromJSON(object.orderId) + : undefined, + state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + spec: isSet(object.spec) ? GroupSpec.fromJSON(object.spec) : undefined, + createdAt: isSet(object.createdAt) + ? Long.fromValue(object.createdAt) + : Long.ZERO, + }; + }, + + toJSON(message: Order): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = OrderID.toJSON(message.orderId); + } + if (message.state !== 0) { + obj.state = order_StateToJSON(message.state); + } + if (message.spec !== undefined) { + obj.spec = GroupSpec.toJSON(message.spec); + } + if (!message.createdAt.equals(Long.ZERO)) { + obj.createdAt = (message.createdAt || Long.ZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): Order { + return Order.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Order { + const message = createBaseOrder(); + message.orderId = + object.orderId !== undefined && object.orderId !== null + ? OrderID.fromPartial(object.orderId) + : undefined; + message.state = object.state ?? 0; + message.spec = + object.spec !== undefined && object.spec !== null + ? GroupSpec.fromPartial(object.spec) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? Long.fromValue(object.createdAt) + : Long.ZERO; + return message; + }, +}; + +messageTypeRegistry.set(Order.$type, Order); + +function createBaseOrderFilters(): OrderFilters { + return { + $type: 'akash.market.v1beta4.OrderFilters', + owner: '', + dseq: Long.UZERO, + gseq: 0, + oseq: 0, + state: '', + }; +} + +export const OrderFilters = { + $type: 'akash.market.v1beta4.OrderFilters' as const, + + encode( + message: OrderFilters, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (!message.dseq.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.dseq); + } + if (message.gseq !== 0) { + writer.uint32(24).uint32(message.gseq); + } + if (message.oseq !== 0) { + writer.uint32(32).uint32(message.oseq); + } + if (message.state !== '') { + writer.uint32(42).string(message.state); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OrderFilters { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderFilters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.dseq = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.gseq = reader.uint32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.oseq = reader.uint32(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.state = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderFilters { + return { + $type: OrderFilters.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, + gseq: isSet(object.gseq) ? globalThis.Number(object.gseq) : 0, + oseq: isSet(object.oseq) ? globalThis.Number(object.oseq) : 0, + state: isSet(object.state) ? globalThis.String(object.state) : '', + }; + }, + + toJSON(message: OrderFilters): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (!message.dseq.equals(Long.UZERO)) { + obj.dseq = (message.dseq || Long.UZERO).toString(); + } + if (message.gseq !== 0) { + obj.gseq = Math.round(message.gseq); + } + if (message.oseq !== 0) { + obj.oseq = Math.round(message.oseq); + } + if (message.state !== '') { + obj.state = message.state; + } + return obj; + }, + + create, I>>( + base?: I, + ): OrderFilters { + return OrderFilters.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OrderFilters { + const message = createBaseOrderFilters(); + message.owner = object.owner ?? ''; + message.dseq = + object.dseq !== undefined && object.dseq !== null + ? Long.fromValue(object.dseq) + : Long.UZERO; + message.gseq = object.gseq ?? 0; + message.oseq = object.oseq ?? 0; + message.state = object.state ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(OrderFilters.$type, OrderFilters); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta4/params.ts b/ts/src/generated/akash/market/v1beta4/params.ts new file mode 100644 index 00000000..9f5d2ce6 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta4/params.ts @@ -0,0 +1,145 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Coin } from '../../../cosmos/base/v1beta1/coin'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.market.v1beta4'; + +/** Params is the params for the x/market module */ +export interface Params { + $type: 'akash.market.v1beta4.Params'; + bidMinDeposit: Coin | undefined; + orderMaxBids: number; +} + +function createBaseParams(): Params { + return { + $type: 'akash.market.v1beta4.Params', + bidMinDeposit: undefined, + orderMaxBids: 0, + }; +} + +export const Params = { + $type: 'akash.market.v1beta4.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bidMinDeposit !== undefined) { + Coin.encode(message.bidMinDeposit, writer.uint32(10).fork()).ldelim(); + } + if (message.orderMaxBids !== 0) { + writer.uint32(16).uint32(message.orderMaxBids); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bidMinDeposit = Coin.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.orderMaxBids = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + bidMinDeposit: isSet(object.bidMinDeposit) + ? Coin.fromJSON(object.bidMinDeposit) + : undefined, + orderMaxBids: isSet(object.orderMaxBids) + ? globalThis.Number(object.orderMaxBids) + : 0, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.bidMinDeposit !== undefined) { + obj.bidMinDeposit = Coin.toJSON(message.bidMinDeposit); + } + if (message.orderMaxBids !== 0) { + obj.orderMaxBids = Math.round(message.orderMaxBids); + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.bidMinDeposit = + object.bidMinDeposit !== undefined && object.bidMinDeposit !== null + ? Coin.fromPartial(object.bidMinDeposit) + : undefined; + message.orderMaxBids = object.orderMaxBids ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta4/query.ts b/ts/src/generated/akash/market/v1beta4/query.ts new file mode 100644 index 00000000..e3a9a631 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta4/query.ts @@ -0,0 +1,1332 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Account, FractionalPayment } from '../../escrow/v1beta3/types'; +import { Bid, BidFilters, BidID } from './bid'; +import { Lease, LeaseFilters, LeaseID } from './lease'; +import { Order, OrderFilters, OrderID } from './order'; + +export const protobufPackage = 'akash.market.v1beta4'; + +/** QueryOrdersRequest is request type for the Query/Orders RPC method */ +export interface QueryOrdersRequest { + $type: 'akash.market.v1beta4.QueryOrdersRequest'; + filters: OrderFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryOrdersResponse is response type for the Query/Orders RPC method */ +export interface QueryOrdersResponse { + $type: 'akash.market.v1beta4.QueryOrdersResponse'; + orders: Order[]; + pagination: PageResponse | undefined; +} + +/** QueryOrderRequest is request type for the Query/Order RPC method */ +export interface QueryOrderRequest { + $type: 'akash.market.v1beta4.QueryOrderRequest'; + id: OrderID | undefined; +} + +/** QueryOrderResponse is response type for the Query/Order RPC method */ +export interface QueryOrderResponse { + $type: 'akash.market.v1beta4.QueryOrderResponse'; + order: Order | undefined; +} + +/** QueryBidsRequest is request type for the Query/Bids RPC method */ +export interface QueryBidsRequest { + $type: 'akash.market.v1beta4.QueryBidsRequest'; + filters: BidFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryBidsResponse is response type for the Query/Bids RPC method */ +export interface QueryBidsResponse { + $type: 'akash.market.v1beta4.QueryBidsResponse'; + bids: QueryBidResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryBidRequest is request type for the Query/Bid RPC method */ +export interface QueryBidRequest { + $type: 'akash.market.v1beta4.QueryBidRequest'; + id: BidID | undefined; +} + +/** QueryBidResponse is response type for the Query/Bid RPC method */ +export interface QueryBidResponse { + $type: 'akash.market.v1beta4.QueryBidResponse'; + bid: Bid | undefined; + escrowAccount: Account | undefined; +} + +/** QueryLeasesRequest is request type for the Query/Leases RPC method */ +export interface QueryLeasesRequest { + $type: 'akash.market.v1beta4.QueryLeasesRequest'; + filters: LeaseFilters | undefined; + pagination: PageRequest | undefined; +} + +/** QueryLeasesResponse is response type for the Query/Leases RPC method */ +export interface QueryLeasesResponse { + $type: 'akash.market.v1beta4.QueryLeasesResponse'; + leases: QueryLeaseResponse[]; + pagination: PageResponse | undefined; +} + +/** QueryLeaseRequest is request type for the Query/Lease RPC method */ +export interface QueryLeaseRequest { + $type: 'akash.market.v1beta4.QueryLeaseRequest'; + id: LeaseID | undefined; +} + +/** QueryLeaseResponse is response type for the Query/Lease RPC method */ +export interface QueryLeaseResponse { + $type: 'akash.market.v1beta4.QueryLeaseResponse'; + lease: Lease | undefined; + escrowPayment: FractionalPayment | undefined; +} + +function createBaseQueryOrdersRequest(): QueryOrdersRequest { + return { + $type: 'akash.market.v1beta4.QueryOrdersRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryOrdersRequest = { + $type: 'akash.market.v1beta4.QueryOrdersRequest' as const, + + encode( + message: QueryOrdersRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + OrderFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrdersRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = OrderFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrdersRequest { + return { + $type: QueryOrdersRequest.$type, + filters: isSet(object.filters) + ? OrderFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryOrdersRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = OrderFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrdersRequest { + return QueryOrdersRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrdersRequest { + const message = createBaseQueryOrdersRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? OrderFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrdersRequest.$type, QueryOrdersRequest); + +function createBaseQueryOrdersResponse(): QueryOrdersResponse { + return { + $type: 'akash.market.v1beta4.QueryOrdersResponse', + orders: [], + pagination: undefined, + }; +} + +export const QueryOrdersResponse = { + $type: 'akash.market.v1beta4.QueryOrdersResponse' as const, + + encode( + message: QueryOrdersResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.orders) { + Order.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrdersResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.orders.push(Order.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrdersResponse { + return { + $type: QueryOrdersResponse.$type, + orders: globalThis.Array.isArray(object?.orders) + ? object.orders.map((e: any) => Order.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryOrdersResponse): unknown { + const obj: any = {}; + if (message.orders?.length) { + obj.orders = message.orders.map((e) => Order.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrdersResponse { + return QueryOrdersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrdersResponse { + const message = createBaseQueryOrdersResponse(); + message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrdersResponse.$type, QueryOrdersResponse); + +function createBaseQueryOrderRequest(): QueryOrderRequest { + return { $type: 'akash.market.v1beta4.QueryOrderRequest', id: undefined }; +} + +export const QueryOrderRequest = { + $type: 'akash.market.v1beta4.QueryOrderRequest' as const, + + encode( + message: QueryOrderRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + OrderID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrderRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = OrderID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrderRequest { + return { + $type: QueryOrderRequest.$type, + id: isSet(object.id) ? OrderID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryOrderRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = OrderID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrderRequest { + return QueryOrderRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrderRequest { + const message = createBaseQueryOrderRequest(); + message.id = + object.id !== undefined && object.id !== null + ? OrderID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrderRequest.$type, QueryOrderRequest); + +function createBaseQueryOrderResponse(): QueryOrderResponse { + return { $type: 'akash.market.v1beta4.QueryOrderResponse', order: undefined }; +} + +export const QueryOrderResponse = { + $type: 'akash.market.v1beta4.QueryOrderResponse' as const, + + encode( + message: QueryOrderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOrderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.order = Order.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryOrderResponse { + return { + $type: QueryOrderResponse.$type, + order: isSet(object.order) ? Order.fromJSON(object.order) : undefined, + }; + }, + + toJSON(message: QueryOrderResponse): unknown { + const obj: any = {}; + if (message.order !== undefined) { + obj.order = Order.toJSON(message.order); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryOrderResponse { + return QueryOrderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryOrderResponse { + const message = createBaseQueryOrderResponse(); + message.order = + object.order !== undefined && object.order !== null + ? Order.fromPartial(object.order) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryOrderResponse.$type, QueryOrderResponse); + +function createBaseQueryBidsRequest(): QueryBidsRequest { + return { + $type: 'akash.market.v1beta4.QueryBidsRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryBidsRequest = { + $type: 'akash.market.v1beta4.QueryBidsRequest' as const, + + encode( + message: QueryBidsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + BidFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = BidFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidsRequest { + return { + $type: QueryBidsRequest.$type, + filters: isSet(object.filters) + ? BidFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryBidsRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = BidFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidsRequest { + return QueryBidsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidsRequest { + const message = createBaseQueryBidsRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? BidFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidsRequest.$type, QueryBidsRequest); + +function createBaseQueryBidsResponse(): QueryBidsResponse { + return { + $type: 'akash.market.v1beta4.QueryBidsResponse', + bids: [], + pagination: undefined, + }; +} + +export const QueryBidsResponse = { + $type: 'akash.market.v1beta4.QueryBidsResponse' as const, + + encode( + message: QueryBidsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.bids) { + QueryBidResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bids.push(QueryBidResponse.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidsResponse { + return { + $type: QueryBidsResponse.$type, + bids: globalThis.Array.isArray(object?.bids) + ? object.bids.map((e: any) => QueryBidResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryBidsResponse): unknown { + const obj: any = {}; + if (message.bids?.length) { + obj.bids = message.bids.map((e) => QueryBidResponse.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidsResponse { + return QueryBidsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidsResponse { + const message = createBaseQueryBidsResponse(); + message.bids = + object.bids?.map((e) => QueryBidResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidsResponse.$type, QueryBidsResponse); + +function createBaseQueryBidRequest(): QueryBidRequest { + return { $type: 'akash.market.v1beta4.QueryBidRequest', id: undefined }; +} + +export const QueryBidRequest = { + $type: 'akash.market.v1beta4.QueryBidRequest' as const, + + encode( + message: QueryBidRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + BidID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = BidID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidRequest { + return { + $type: QueryBidRequest.$type, + id: isSet(object.id) ? BidID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryBidRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = BidID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidRequest { + return QueryBidRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidRequest { + const message = createBaseQueryBidRequest(); + message.id = + object.id !== undefined && object.id !== null + ? BidID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidRequest.$type, QueryBidRequest); + +function createBaseQueryBidResponse(): QueryBidResponse { + return { + $type: 'akash.market.v1beta4.QueryBidResponse', + bid: undefined, + escrowAccount: undefined, + }; +} + +export const QueryBidResponse = { + $type: 'akash.market.v1beta4.QueryBidResponse' as const, + + encode( + message: QueryBidResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.bid !== undefined) { + Bid.encode(message.bid, writer.uint32(10).fork()).ldelim(); + } + if (message.escrowAccount !== undefined) { + Account.encode(message.escrowAccount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBidResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.bid = Bid.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.escrowAccount = Account.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryBidResponse { + return { + $type: QueryBidResponse.$type, + bid: isSet(object.bid) ? Bid.fromJSON(object.bid) : undefined, + escrowAccount: isSet(object.escrowAccount) + ? Account.fromJSON(object.escrowAccount) + : undefined, + }; + }, + + toJSON(message: QueryBidResponse): unknown { + const obj: any = {}; + if (message.bid !== undefined) { + obj.bid = Bid.toJSON(message.bid); + } + if (message.escrowAccount !== undefined) { + obj.escrowAccount = Account.toJSON(message.escrowAccount); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryBidResponse { + return QueryBidResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryBidResponse { + const message = createBaseQueryBidResponse(); + message.bid = + object.bid !== undefined && object.bid !== null + ? Bid.fromPartial(object.bid) + : undefined; + message.escrowAccount = + object.escrowAccount !== undefined && object.escrowAccount !== null + ? Account.fromPartial(object.escrowAccount) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryBidResponse.$type, QueryBidResponse); + +function createBaseQueryLeasesRequest(): QueryLeasesRequest { + return { + $type: 'akash.market.v1beta4.QueryLeasesRequest', + filters: undefined, + pagination: undefined, + }; +} + +export const QueryLeasesRequest = { + $type: 'akash.market.v1beta4.QueryLeasesRequest' as const, + + encode( + message: QueryLeasesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.filters !== undefined) { + LeaseFilters.encode(message.filters, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeasesRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeasesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filters = LeaseFilters.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeasesRequest { + return { + $type: QueryLeasesRequest.$type, + filters: isSet(object.filters) + ? LeaseFilters.fromJSON(object.filters) + : undefined, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryLeasesRequest): unknown { + const obj: any = {}; + if (message.filters !== undefined) { + obj.filters = LeaseFilters.toJSON(message.filters); + } + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeasesRequest { + return QueryLeasesRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeasesRequest { + const message = createBaseQueryLeasesRequest(); + message.filters = + object.filters !== undefined && object.filters !== null + ? LeaseFilters.fromPartial(object.filters) + : undefined; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeasesRequest.$type, QueryLeasesRequest); + +function createBaseQueryLeasesResponse(): QueryLeasesResponse { + return { + $type: 'akash.market.v1beta4.QueryLeasesResponse', + leases: [], + pagination: undefined, + }; +} + +export const QueryLeasesResponse = { + $type: 'akash.market.v1beta4.QueryLeasesResponse' as const, + + encode( + message: QueryLeasesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.leases) { + QueryLeaseResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeasesResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeasesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leases.push( + QueryLeaseResponse.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeasesResponse { + return { + $type: QueryLeasesResponse.$type, + leases: globalThis.Array.isArray(object?.leases) + ? object.leases.map((e: any) => QueryLeaseResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryLeasesResponse): unknown { + const obj: any = {}; + if (message.leases?.length) { + obj.leases = message.leases.map((e) => QueryLeaseResponse.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeasesResponse { + return QueryLeasesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeasesResponse { + const message = createBaseQueryLeasesResponse(); + message.leases = + object.leases?.map((e) => QueryLeaseResponse.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeasesResponse.$type, QueryLeasesResponse); + +function createBaseQueryLeaseRequest(): QueryLeaseRequest { + return { $type: 'akash.market.v1beta4.QueryLeaseRequest', id: undefined }; +} + +export const QueryLeaseRequest = { + $type: 'akash.market.v1beta4.QueryLeaseRequest' as const, + + encode( + message: QueryLeaseRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== undefined) { + LeaseID.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeaseRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeaseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeaseRequest { + return { + $type: QueryLeaseRequest.$type, + id: isSet(object.id) ? LeaseID.fromJSON(object.id) : undefined, + }; + }, + + toJSON(message: QueryLeaseRequest): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = LeaseID.toJSON(message.id); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeaseRequest { + return QueryLeaseRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeaseRequest { + const message = createBaseQueryLeaseRequest(); + message.id = + object.id !== undefined && object.id !== null + ? LeaseID.fromPartial(object.id) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeaseRequest.$type, QueryLeaseRequest); + +function createBaseQueryLeaseResponse(): QueryLeaseResponse { + return { + $type: 'akash.market.v1beta4.QueryLeaseResponse', + lease: undefined, + escrowPayment: undefined, + }; +} + +export const QueryLeaseResponse = { + $type: 'akash.market.v1beta4.QueryLeaseResponse' as const, + + encode( + message: QueryLeaseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.lease !== undefined) { + Lease.encode(message.lease, writer.uint32(10).fork()).ldelim(); + } + if (message.escrowPayment !== undefined) { + FractionalPayment.encode( + message.escrowPayment, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLeaseResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLeaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.lease = Lease.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.escrowPayment = FractionalPayment.decode( + reader, + reader.uint32(), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryLeaseResponse { + return { + $type: QueryLeaseResponse.$type, + lease: isSet(object.lease) ? Lease.fromJSON(object.lease) : undefined, + escrowPayment: isSet(object.escrowPayment) + ? FractionalPayment.fromJSON(object.escrowPayment) + : undefined, + }; + }, + + toJSON(message: QueryLeaseResponse): unknown { + const obj: any = {}; + if (message.lease !== undefined) { + obj.lease = Lease.toJSON(message.lease); + } + if (message.escrowPayment !== undefined) { + obj.escrowPayment = FractionalPayment.toJSON(message.escrowPayment); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryLeaseResponse { + return QueryLeaseResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryLeaseResponse { + const message = createBaseQueryLeaseResponse(); + message.lease = + object.lease !== undefined && object.lease !== null + ? Lease.fromPartial(object.lease) + : undefined; + message.escrowPayment = + object.escrowPayment !== undefined && object.escrowPayment !== null + ? FractionalPayment.fromPartial(object.escrowPayment) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryLeaseResponse.$type, QueryLeaseResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Orders queries orders with filters */ + Orders(request: QueryOrdersRequest): Promise; + /** Order queries order details */ + Order(request: QueryOrderRequest): Promise; + /** Bids queries bids with filters */ + Bids(request: QueryBidsRequest): Promise; + /** Bid queries bid details */ + Bid(request: QueryBidRequest): Promise; + /** Leases queries leases with filters */ + Leases(request: QueryLeasesRequest): Promise; + /** Lease queries lease details */ + Lease(request: QueryLeaseRequest): Promise; +} + +export const QueryServiceName = 'akash.market.v1beta4.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Orders = this.Orders.bind(this); + this.Order = this.Order.bind(this); + this.Bids = this.Bids.bind(this); + this.Bid = this.Bid.bind(this); + this.Leases = this.Leases.bind(this); + this.Lease = this.Lease.bind(this); + } + Orders(request: QueryOrdersRequest): Promise { + const data = QueryOrdersRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Orders', data); + return promise.then((data) => + QueryOrdersResponse.decode(_m0.Reader.create(data)), + ); + } + + Order(request: QueryOrderRequest): Promise { + const data = QueryOrderRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Order', data); + return promise.then((data) => + QueryOrderResponse.decode(_m0.Reader.create(data)), + ); + } + + Bids(request: QueryBidsRequest): Promise { + const data = QueryBidsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Bids', data); + return promise.then((data) => + QueryBidsResponse.decode(_m0.Reader.create(data)), + ); + } + + Bid(request: QueryBidRequest): Promise { + const data = QueryBidRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Bid', data); + return promise.then((data) => + QueryBidResponse.decode(_m0.Reader.create(data)), + ); + } + + Leases(request: QueryLeasesRequest): Promise { + const data = QueryLeasesRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Leases', data); + return promise.then((data) => + QueryLeasesResponse.decode(_m0.Reader.create(data)), + ); + } + + Lease(request: QueryLeaseRequest): Promise { + const data = QueryLeaseRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Lease', data); + return promise.then((data) => + QueryLeaseResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/market/v1beta4/service.ts b/ts/src/generated/akash/market/v1beta4/service.ts new file mode 100644 index 00000000..153ee178 --- /dev/null +++ b/ts/src/generated/akash/market/v1beta4/service.ts @@ -0,0 +1,94 @@ +/* eslint-disable */ +import _m0 from 'protobufjs/minimal'; +import { + MsgCloseBid, + MsgCloseBidResponse, + MsgCreateBid, + MsgCreateBidResponse, +} from './bid'; +import { + MsgCloseLease, + MsgCloseLeaseResponse, + MsgCreateLease, + MsgCreateLeaseResponse, + MsgWithdrawLease, + MsgWithdrawLeaseResponse, +} from './lease'; + +export const protobufPackage = 'akash.market.v1beta4'; + +/** Msg defines the market Msg service */ +export interface Msg { + /** CreateBid defines a method to create a bid given proper inputs. */ + CreateBid(request: MsgCreateBid): Promise; + /** CloseBid defines a method to close a bid given proper inputs. */ + CloseBid(request: MsgCloseBid): Promise; + /** WithdrawLease withdraws accrued funds from the lease payment */ + WithdrawLease(request: MsgWithdrawLease): Promise; + /** CreateLease creates a new lease */ + CreateLease(request: MsgCreateLease): Promise; + /** CloseLease defines a method to close an order given proper inputs. */ + CloseLease(request: MsgCloseLease): Promise; +} + +export const MsgServiceName = 'akash.market.v1beta4.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateBid = this.CreateBid.bind(this); + this.CloseBid = this.CloseBid.bind(this); + this.WithdrawLease = this.WithdrawLease.bind(this); + this.CreateLease = this.CreateLease.bind(this); + this.CloseLease = this.CloseLease.bind(this); + } + CreateBid(request: MsgCreateBid): Promise { + const data = MsgCreateBid.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateBid', data); + return promise.then((data) => + MsgCreateBidResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseBid(request: MsgCloseBid): Promise { + const data = MsgCloseBid.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseBid', data); + return promise.then((data) => + MsgCloseBidResponse.decode(_m0.Reader.create(data)), + ); + } + + WithdrawLease(request: MsgWithdrawLease): Promise { + const data = MsgWithdrawLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'WithdrawLease', data); + return promise.then((data) => + MsgWithdrawLeaseResponse.decode(_m0.Reader.create(data)), + ); + } + + CreateLease(request: MsgCreateLease): Promise { + const data = MsgCreateLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateLease', data); + return promise.then((data) => + MsgCreateLeaseResponse.decode(_m0.Reader.create(data)), + ); + } + + CloseLease(request: MsgCloseLease): Promise { + const data = MsgCloseLease.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CloseLease', data); + return promise.then((data) => + MsgCloseLeaseResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} diff --git a/ts/src/generated/akash/provider/lease/v1/service.ts b/ts/src/generated/akash/provider/lease/v1/service.ts new file mode 100644 index 00000000..912df4c9 --- /dev/null +++ b/ts/src/generated/akash/provider/lease/v1/service.ts @@ -0,0 +1,1577 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { messageTypeRegistry } from '../../../../typeRegistry'; +import { Group } from '../../../manifest/v2beta2/group'; +import { LeaseID } from '../../../market/v1beta4/lease'; + +export const protobufPackage = 'akash.provider.lease.v1'; + +/** LeaseServiceStatus */ +export interface LeaseServiceStatus { + $type: 'akash.provider.lease.v1.LeaseServiceStatus'; + available: number; + total: number; + uris: string[]; + observedGeneration: Long; + replicas: number; + updatedReplicas: number; + readyReplicas: number; + availableReplicas: number; +} + +/** LeaseIPStatus */ +export interface LeaseIPStatus { + $type: 'akash.provider.lease.v1.LeaseIPStatus'; + port: number; + externalPort: number; + protocol: string; + ip: string; +} + +/** ForwarderPortStatus */ +export interface ForwarderPortStatus { + $type: 'akash.provider.lease.v1.ForwarderPortStatus'; + host: string; + port: number; + externalPort: number; + proto: string; + name: string; +} + +/** ServiceStatus */ +export interface ServiceStatus { + $type: 'akash.provider.lease.v1.ServiceStatus'; + name: string; + status: LeaseServiceStatus | undefined; + ports: ForwarderPortStatus[]; + ips: LeaseIPStatus[]; +} + +/** SendManifestRequest is request type for the SendManifest Providers RPC method */ +export interface SendManifestRequest { + $type: 'akash.provider.lease.v1.SendManifestRequest'; + leaseId: LeaseID | undefined; + manifest: Group[]; +} + +/** SendManifestResponse is response type for the SendManifest Providers RPC method */ +export interface SendManifestResponse { + $type: 'akash.provider.lease.v1.SendManifestResponse'; +} + +/** ServiceLogsRequest */ +export interface ServiceLogsRequest { + $type: 'akash.provider.lease.v1.ServiceLogsRequest'; + leaseId: LeaseID | undefined; + services: string[]; +} + +/** ServiceLogs */ +export interface ServiceLogs { + $type: 'akash.provider.lease.v1.ServiceLogs'; + name: string; + logs: Uint8Array; +} + +/** ServiceLogsResponse */ +export interface ServiceLogsResponse { + $type: 'akash.provider.lease.v1.ServiceLogsResponse'; + services: ServiceLogs[]; +} + +/** ShellRequest */ +export interface ShellRequest { + $type: 'akash.provider.lease.v1.ShellRequest'; + leaseId: LeaseID | undefined; +} + +/** ServiceStatusRequest */ +export interface ServiceStatusRequest { + $type: 'akash.provider.lease.v1.ServiceStatusRequest'; + leaseId: LeaseID | undefined; + services: string[]; +} + +/** ServiceStatusResponse */ +export interface ServiceStatusResponse { + $type: 'akash.provider.lease.v1.ServiceStatusResponse'; + services: ServiceStatus[]; +} + +function createBaseLeaseServiceStatus(): LeaseServiceStatus { + return { + $type: 'akash.provider.lease.v1.LeaseServiceStatus', + available: 0, + total: 0, + uris: [], + observedGeneration: Long.ZERO, + replicas: 0, + updatedReplicas: 0, + readyReplicas: 0, + availableReplicas: 0, + }; +} + +export const LeaseServiceStatus = { + $type: 'akash.provider.lease.v1.LeaseServiceStatus' as const, + + encode( + message: LeaseServiceStatus, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.available !== 0) { + writer.uint32(8).int32(message.available); + } + if (message.total !== 0) { + writer.uint32(16).int32(message.total); + } + for (const v of message.uris) { + writer.uint32(26).string(v!); + } + if (!message.observedGeneration.equals(Long.ZERO)) { + writer.uint32(32).int64(message.observedGeneration); + } + if (message.replicas !== 0) { + writer.uint32(40).int32(message.replicas); + } + if (message.updatedReplicas !== 0) { + writer.uint32(48).int32(message.updatedReplicas); + } + if (message.readyReplicas !== 0) { + writer.uint32(56).int32(message.readyReplicas); + } + if (message.availableReplicas !== 0) { + writer.uint32(64).int32(message.availableReplicas); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseServiceStatus { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseServiceStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.available = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.total = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.uris.push(reader.string()); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.observedGeneration = reader.int64() as Long; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.replicas = reader.int32(); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.updatedReplicas = reader.int32(); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.readyReplicas = reader.int32(); + continue; + case 8: + if (tag !== 64) { + break; + } + + message.availableReplicas = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseServiceStatus { + return { + $type: LeaseServiceStatus.$type, + available: isSet(object.available) + ? globalThis.Number(object.available) + : 0, + total: isSet(object.total) ? globalThis.Number(object.total) : 0, + uris: globalThis.Array.isArray(object?.uris) + ? object.uris.map((e: any) => globalThis.String(e)) + : [], + observedGeneration: isSet(object.observedGeneration) + ? Long.fromValue(object.observedGeneration) + : Long.ZERO, + replicas: isSet(object.replicas) ? globalThis.Number(object.replicas) : 0, + updatedReplicas: isSet(object.updatedReplicas) + ? globalThis.Number(object.updatedReplicas) + : 0, + readyReplicas: isSet(object.readyReplicas) + ? globalThis.Number(object.readyReplicas) + : 0, + availableReplicas: isSet(object.availableReplicas) + ? globalThis.Number(object.availableReplicas) + : 0, + }; + }, + + toJSON(message: LeaseServiceStatus): unknown { + const obj: any = {}; + if (message.available !== 0) { + obj.available = Math.round(message.available); + } + if (message.total !== 0) { + obj.total = Math.round(message.total); + } + if (message.uris?.length) { + obj.uris = message.uris; + } + if (!message.observedGeneration.equals(Long.ZERO)) { + obj.observedGeneration = ( + message.observedGeneration || Long.ZERO + ).toString(); + } + if (message.replicas !== 0) { + obj.replicas = Math.round(message.replicas); + } + if (message.updatedReplicas !== 0) { + obj.updatedReplicas = Math.round(message.updatedReplicas); + } + if (message.readyReplicas !== 0) { + obj.readyReplicas = Math.round(message.readyReplicas); + } + if (message.availableReplicas !== 0) { + obj.availableReplicas = Math.round(message.availableReplicas); + } + return obj; + }, + + create, I>>( + base?: I, + ): LeaseServiceStatus { + return LeaseServiceStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): LeaseServiceStatus { + const message = createBaseLeaseServiceStatus(); + message.available = object.available ?? 0; + message.total = object.total ?? 0; + message.uris = object.uris?.map((e) => e) || []; + message.observedGeneration = + object.observedGeneration !== undefined && + object.observedGeneration !== null + ? Long.fromValue(object.observedGeneration) + : Long.ZERO; + message.replicas = object.replicas ?? 0; + message.updatedReplicas = object.updatedReplicas ?? 0; + message.readyReplicas = object.readyReplicas ?? 0; + message.availableReplicas = object.availableReplicas ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(LeaseServiceStatus.$type, LeaseServiceStatus); + +function createBaseLeaseIPStatus(): LeaseIPStatus { + return { + $type: 'akash.provider.lease.v1.LeaseIPStatus', + port: 0, + externalPort: 0, + protocol: '', + ip: '', + }; +} + +export const LeaseIPStatus = { + $type: 'akash.provider.lease.v1.LeaseIPStatus' as const, + + encode( + message: LeaseIPStatus, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.port !== 0) { + writer.uint32(8).uint32(message.port); + } + if (message.externalPort !== 0) { + writer.uint32(16).uint32(message.externalPort); + } + if (message.protocol !== '') { + writer.uint32(26).string(message.protocol); + } + if (message.ip !== '') { + writer.uint32(34).string(message.ip); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeaseIPStatus { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaseIPStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.port = reader.uint32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.externalPort = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.protocol = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.ip = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LeaseIPStatus { + return { + $type: LeaseIPStatus.$type, + port: isSet(object.port) ? globalThis.Number(object.port) : 0, + externalPort: isSet(object.externalPort) + ? globalThis.Number(object.externalPort) + : 0, + protocol: isSet(object.protocol) + ? globalThis.String(object.protocol) + : '', + ip: isSet(object.ip) ? globalThis.String(object.ip) : '', + }; + }, + + toJSON(message: LeaseIPStatus): unknown { + const obj: any = {}; + if (message.port !== 0) { + obj.port = Math.round(message.port); + } + if (message.externalPort !== 0) { + obj.externalPort = Math.round(message.externalPort); + } + if (message.protocol !== '') { + obj.protocol = message.protocol; + } + if (message.ip !== '') { + obj.ip = message.ip; + } + return obj; + }, + + create, I>>( + base?: I, + ): LeaseIPStatus { + return LeaseIPStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): LeaseIPStatus { + const message = createBaseLeaseIPStatus(); + message.port = object.port ?? 0; + message.externalPort = object.externalPort ?? 0; + message.protocol = object.protocol ?? ''; + message.ip = object.ip ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(LeaseIPStatus.$type, LeaseIPStatus); + +function createBaseForwarderPortStatus(): ForwarderPortStatus { + return { + $type: 'akash.provider.lease.v1.ForwarderPortStatus', + host: '', + port: 0, + externalPort: 0, + proto: '', + name: '', + }; +} + +export const ForwarderPortStatus = { + $type: 'akash.provider.lease.v1.ForwarderPortStatus' as const, + + encode( + message: ForwarderPortStatus, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.host !== '') { + writer.uint32(10).string(message.host); + } + if (message.port !== 0) { + writer.uint32(16).uint32(message.port); + } + if (message.externalPort !== 0) { + writer.uint32(24).uint32(message.externalPort); + } + if (message.proto !== '') { + writer.uint32(34).string(message.proto); + } + if (message.name !== '') { + writer.uint32(42).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ForwarderPortStatus { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForwarderPortStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.host = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.port = reader.uint32(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.externalPort = reader.uint32(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.proto = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.name = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ForwarderPortStatus { + return { + $type: ForwarderPortStatus.$type, + host: isSet(object.host) ? globalThis.String(object.host) : '', + port: isSet(object.port) ? globalThis.Number(object.port) : 0, + externalPort: isSet(object.externalPort) + ? globalThis.Number(object.externalPort) + : 0, + proto: isSet(object.proto) ? globalThis.String(object.proto) : '', + name: isSet(object.name) ? globalThis.String(object.name) : '', + }; + }, + + toJSON(message: ForwarderPortStatus): unknown { + const obj: any = {}; + if (message.host !== '') { + obj.host = message.host; + } + if (message.port !== 0) { + obj.port = Math.round(message.port); + } + if (message.externalPort !== 0) { + obj.externalPort = Math.round(message.externalPort); + } + if (message.proto !== '') { + obj.proto = message.proto; + } + if (message.name !== '') { + obj.name = message.name; + } + return obj; + }, + + create, I>>( + base?: I, + ): ForwarderPortStatus { + return ForwarderPortStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ForwarderPortStatus { + const message = createBaseForwarderPortStatus(); + message.host = object.host ?? ''; + message.port = object.port ?? 0; + message.externalPort = object.externalPort ?? 0; + message.proto = object.proto ?? ''; + message.name = object.name ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(ForwarderPortStatus.$type, ForwarderPortStatus); + +function createBaseServiceStatus(): ServiceStatus { + return { + $type: 'akash.provider.lease.v1.ServiceStatus', + name: '', + status: undefined, + ports: [], + ips: [], + }; +} + +export const ServiceStatus = { + $type: 'akash.provider.lease.v1.ServiceStatus' as const, + + encode( + message: ServiceStatus, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.status !== undefined) { + LeaseServiceStatus.encode( + message.status, + writer.uint32(18).fork(), + ).ldelim(); + } + for (const v of message.ports) { + ForwarderPortStatus.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.ips) { + LeaseIPStatus.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceStatus { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.status = LeaseServiceStatus.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.ports.push( + ForwarderPortStatus.decode(reader, reader.uint32()), + ); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.ips.push(LeaseIPStatus.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceStatus { + return { + $type: ServiceStatus.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + status: isSet(object.status) + ? LeaseServiceStatus.fromJSON(object.status) + : undefined, + ports: globalThis.Array.isArray(object?.ports) + ? object.ports.map((e: any) => ForwarderPortStatus.fromJSON(e)) + : [], + ips: globalThis.Array.isArray(object?.ips) + ? object.ips.map((e: any) => LeaseIPStatus.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ServiceStatus): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.status !== undefined) { + obj.status = LeaseServiceStatus.toJSON(message.status); + } + if (message.ports?.length) { + obj.ports = message.ports.map((e) => ForwarderPortStatus.toJSON(e)); + } + if (message.ips?.length) { + obj.ips = message.ips.map((e) => LeaseIPStatus.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceStatus { + return ServiceStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceStatus { + const message = createBaseServiceStatus(); + message.name = object.name ?? ''; + message.status = + object.status !== undefined && object.status !== null + ? LeaseServiceStatus.fromPartial(object.status) + : undefined; + message.ports = + object.ports?.map((e) => ForwarderPortStatus.fromPartial(e)) || []; + message.ips = object.ips?.map((e) => LeaseIPStatus.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceStatus.$type, ServiceStatus); + +function createBaseSendManifestRequest(): SendManifestRequest { + return { + $type: 'akash.provider.lease.v1.SendManifestRequest', + leaseId: undefined, + manifest: [], + }; +} + +export const SendManifestRequest = { + $type: 'akash.provider.lease.v1.SendManifestRequest' as const, + + encode( + message: SendManifestRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.manifest) { + Group.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SendManifestRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendManifestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.manifest.push(Group.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): SendManifestRequest { + return { + $type: SendManifestRequest.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + manifest: globalThis.Array.isArray(object?.manifest) + ? object.manifest.map((e: any) => Group.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SendManifestRequest): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + if (message.manifest?.length) { + obj.manifest = message.manifest.map((e) => Group.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): SendManifestRequest { + return SendManifestRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): SendManifestRequest { + const message = createBaseSendManifestRequest(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + message.manifest = object.manifest?.map((e) => Group.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(SendManifestRequest.$type, SendManifestRequest); + +function createBaseSendManifestResponse(): SendManifestResponse { + return { $type: 'akash.provider.lease.v1.SendManifestResponse' }; +} + +export const SendManifestResponse = { + $type: 'akash.provider.lease.v1.SendManifestResponse' as const, + + encode( + _: SendManifestResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): SendManifestResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendManifestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): SendManifestResponse { + return { $type: SendManifestResponse.$type }; + }, + + toJSON(_: SendManifestResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): SendManifestResponse { + return SendManifestResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): SendManifestResponse { + const message = createBaseSendManifestResponse(); + return message; + }, +}; + +messageTypeRegistry.set(SendManifestResponse.$type, SendManifestResponse); + +function createBaseServiceLogsRequest(): ServiceLogsRequest { + return { + $type: 'akash.provider.lease.v1.ServiceLogsRequest', + leaseId: undefined, + services: [], + }; +} + +export const ServiceLogsRequest = { + $type: 'akash.provider.lease.v1.ServiceLogsRequest' as const, + + encode( + message: ServiceLogsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.services) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceLogsRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceLogsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.services.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceLogsRequest { + return { + $type: ServiceLogsRequest.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + services: globalThis.Array.isArray(object?.services) + ? object.services.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: ServiceLogsRequest): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + if (message.services?.length) { + obj.services = message.services; + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceLogsRequest { + return ServiceLogsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceLogsRequest { + const message = createBaseServiceLogsRequest(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + message.services = object.services?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceLogsRequest.$type, ServiceLogsRequest); + +function createBaseServiceLogs(): ServiceLogs { + return { + $type: 'akash.provider.lease.v1.ServiceLogs', + name: '', + logs: new Uint8Array(0), + }; +} + +export const ServiceLogs = { + $type: 'akash.provider.lease.v1.ServiceLogs' as const, + + encode( + message: ServiceLogs, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.logs.length !== 0) { + writer.uint32(18).bytes(message.logs); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceLogs { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceLogs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.logs = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceLogs { + return { + $type: ServiceLogs.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + logs: isSet(object.logs) + ? bytesFromBase64(object.logs) + : new Uint8Array(0), + }; + }, + + toJSON(message: ServiceLogs): unknown { + const obj: any = {}; + if (message.name !== '') { + obj.name = message.name; + } + if (message.logs.length !== 0) { + obj.logs = base64FromBytes(message.logs); + } + return obj; + }, + + create, I>>(base?: I): ServiceLogs { + return ServiceLogs.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceLogs { + const message = createBaseServiceLogs(); + message.name = object.name ?? ''; + message.logs = object.logs ?? new Uint8Array(0); + return message; + }, +}; + +messageTypeRegistry.set(ServiceLogs.$type, ServiceLogs); + +function createBaseServiceLogsResponse(): ServiceLogsResponse { + return { $type: 'akash.provider.lease.v1.ServiceLogsResponse', services: [] }; +} + +export const ServiceLogsResponse = { + $type: 'akash.provider.lease.v1.ServiceLogsResponse' as const, + + encode( + message: ServiceLogsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.services) { + ServiceLogs.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceLogsResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceLogsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.services.push(ServiceLogs.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceLogsResponse { + return { + $type: ServiceLogsResponse.$type, + services: globalThis.Array.isArray(object?.services) + ? object.services.map((e: any) => ServiceLogs.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ServiceLogsResponse): unknown { + const obj: any = {}; + if (message.services?.length) { + obj.services = message.services.map((e) => ServiceLogs.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceLogsResponse { + return ServiceLogsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceLogsResponse { + const message = createBaseServiceLogsResponse(); + message.services = + object.services?.map((e) => ServiceLogs.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceLogsResponse.$type, ServiceLogsResponse); + +function createBaseShellRequest(): ShellRequest { + return { $type: 'akash.provider.lease.v1.ShellRequest', leaseId: undefined }; +} + +export const ShellRequest = { + $type: 'akash.provider.lease.v1.ShellRequest' as const, + + encode( + message: ShellRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ShellRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseShellRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ShellRequest { + return { + $type: ShellRequest.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + }; + }, + + toJSON(message: ShellRequest): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + return obj; + }, + + create, I>>( + base?: I, + ): ShellRequest { + return ShellRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ShellRequest { + const message = createBaseShellRequest(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ShellRequest.$type, ShellRequest); + +function createBaseServiceStatusRequest(): ServiceStatusRequest { + return { + $type: 'akash.provider.lease.v1.ServiceStatusRequest', + leaseId: undefined, + services: [], + }; +} + +export const ServiceStatusRequest = { + $type: 'akash.provider.lease.v1.ServiceStatusRequest' as const, + + encode( + message: ServiceStatusRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leaseId !== undefined) { + LeaseID.encode(message.leaseId, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.services) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ServiceStatusRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceStatusRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leaseId = LeaseID.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.services.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceStatusRequest { + return { + $type: ServiceStatusRequest.$type, + leaseId: isSet(object.leaseId) + ? LeaseID.fromJSON(object.leaseId) + : undefined, + services: globalThis.Array.isArray(object?.services) + ? object.services.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: ServiceStatusRequest): unknown { + const obj: any = {}; + if (message.leaseId !== undefined) { + obj.leaseId = LeaseID.toJSON(message.leaseId); + } + if (message.services?.length) { + obj.services = message.services; + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceStatusRequest { + return ServiceStatusRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceStatusRequest { + const message = createBaseServiceStatusRequest(); + message.leaseId = + object.leaseId !== undefined && object.leaseId !== null + ? LeaseID.fromPartial(object.leaseId) + : undefined; + message.services = object.services?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceStatusRequest.$type, ServiceStatusRequest); + +function createBaseServiceStatusResponse(): ServiceStatusResponse { + return { + $type: 'akash.provider.lease.v1.ServiceStatusResponse', + services: [], + }; +} + +export const ServiceStatusResponse = { + $type: 'akash.provider.lease.v1.ServiceStatusResponse' as const, + + encode( + message: ServiceStatusResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.services) { + ServiceStatus.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ServiceStatusResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceStatusResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.services.push(ServiceStatus.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceStatusResponse { + return { + $type: ServiceStatusResponse.$type, + services: globalThis.Array.isArray(object?.services) + ? object.services.map((e: any) => ServiceStatus.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ServiceStatusResponse): unknown { + const obj: any = {}; + if (message.services?.length) { + obj.services = message.services.map((e) => ServiceStatus.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceStatusResponse { + return ServiceStatusResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceStatusResponse { + const message = createBaseServiceStatusResponse(); + message.services = + object.services?.map((e) => ServiceStatus.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceStatusResponse.$type, ServiceStatusResponse); + +/** LeaseRPC defines the RPC server for lease control */ +export interface LeaseRPC { + /** SendManifest sends manifest to the provider */ + SendManifest(request: SendManifestRequest): Promise; + /** + * ServiceStatus + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + ServiceStatus(request: ServiceStatusRequest): Promise; + /** + * StreamServiceStatus + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + StreamServiceStatus( + request: ServiceStatusRequest, + ): Observable; + /** + * ServiceLogs + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + ServiceLogs(request: ServiceLogsRequest): Promise; + /** + * StreamServiceLogs + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + StreamServiceLogs( + request: ServiceLogsRequest, + ): Observable; +} + +export const LeaseRPCServiceName = 'akash.provider.lease.v1.LeaseRPC'; +export class LeaseRPCClientImpl implements LeaseRPC { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || LeaseRPCServiceName; + this.rpc = rpc; + this.SendManifest = this.SendManifest.bind(this); + this.ServiceStatus = this.ServiceStatus.bind(this); + this.StreamServiceStatus = this.StreamServiceStatus.bind(this); + this.ServiceLogs = this.ServiceLogs.bind(this); + this.StreamServiceLogs = this.StreamServiceLogs.bind(this); + } + SendManifest(request: SendManifestRequest): Promise { + const data = SendManifestRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'SendManifest', data); + return promise.then((data) => + SendManifestResponse.decode(_m0.Reader.create(data)), + ); + } + + ServiceStatus(request: ServiceStatusRequest): Promise { + const data = ServiceStatusRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'ServiceStatus', data); + return promise.then((data) => + ServiceStatusResponse.decode(_m0.Reader.create(data)), + ); + } + + StreamServiceStatus( + request: ServiceStatusRequest, + ): Observable { + const data = ServiceStatusRequest.encode(request).finish(); + const result = this.rpc.serverStreamingRequest( + this.service, + 'StreamServiceStatus', + data, + ); + return result.pipe( + map((data) => ServiceStatusResponse.decode(_m0.Reader.create(data))), + ); + } + + ServiceLogs(request: ServiceLogsRequest): Promise { + const data = ServiceLogsRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'ServiceLogs', data); + return promise.then((data) => + ServiceLogsResponse.decode(_m0.Reader.create(data)), + ); + } + + StreamServiceLogs( + request: ServiceLogsRequest, + ): Observable { + const data = ServiceLogsRequest.encode(request).finish(); + const result = this.rpc.serverStreamingRequest( + this.service, + 'StreamServiceLogs', + data, + ); + return result.pipe( + map((data) => ServiceLogsResponse.decode(_m0.Reader.create(data))), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; + clientStreamingRequest( + service: string, + method: string, + data: Observable, + ): Promise; + serverStreamingRequest( + service: string, + method: string, + data: Uint8Array, + ): Observable; + bidirectionalStreamingRequest( + service: string, + method: string, + data: Observable, + ): Observable; +} + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/provider/v1/service.ts b/ts/src/generated/akash/provider/v1/service.ts new file mode 100644 index 00000000..45909895 --- /dev/null +++ b/ts/src/generated/akash/provider/v1/service.ts @@ -0,0 +1,74 @@ +/* eslint-disable */ +import _m0 from 'protobufjs/minimal'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { Empty } from '../../../google/protobuf/empty'; +import { Status } from './status'; + +export const protobufPackage = 'akash.provider.v1'; + +/** ProviderRPC defines the RPC server for provider */ +export interface ProviderRPC { + /** + * GetStatus defines a method to query provider state + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + GetStatus(request: Empty): Promise; + /** + * Status defines a method to stream provider state + * buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + */ + StreamStatus(request: Empty): Observable; +} + +export const ProviderRPCServiceName = 'akash.provider.v1.ProviderRPC'; +export class ProviderRPCClientImpl implements ProviderRPC { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || ProviderRPCServiceName; + this.rpc = rpc; + this.GetStatus = this.GetStatus.bind(this); + this.StreamStatus = this.StreamStatus.bind(this); + } + GetStatus(request: Empty): Promise { + const data = Empty.encode(request).finish(); + const promise = this.rpc.request(this.service, 'GetStatus', data); + return promise.then((data) => Status.decode(_m0.Reader.create(data))); + } + + StreamStatus(request: Empty): Observable { + const data = Empty.encode(request).finish(); + const result = this.rpc.serverStreamingRequest( + this.service, + 'StreamStatus', + data, + ); + return result.pipe(map((data) => Status.decode(_m0.Reader.create(data)))); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; + clientStreamingRequest( + service: string, + method: string, + data: Observable, + ): Promise; + serverStreamingRequest( + service: string, + method: string, + data: Uint8Array, + ): Observable; + bidirectionalStreamingRequest( + service: string, + method: string, + data: Observable, + ): Observable; +} diff --git a/ts/src/generated/akash/provider/v1/status.ts b/ts/src/generated/akash/provider/v1/status.ts new file mode 100644 index 00000000..5b465538 --- /dev/null +++ b/ts/src/generated/akash/provider/v1/status.ts @@ -0,0 +1,1245 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { Timestamp } from '../../../google/protobuf/timestamp'; +import { Quantity } from '../../../k8s.io/apimachinery/pkg/api/resource/generated'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Cluster } from '../../inventory/v1/cluster'; + +export const protobufPackage = 'akash.provider.v1'; + +/** ResourceMetrics */ +export interface ResourcesMetric { + $type: 'akash.provider.v1.ResourcesMetric'; + cpu: Quantity | undefined; + memory: Quantity | undefined; + gpu: Quantity | undefined; + ephemeralStorage: Quantity | undefined; + storage: { [key: string]: Quantity }; +} + +export interface ResourcesMetric_StorageEntry { + $type: 'akash.provider.v1.ResourcesMetric.StorageEntry'; + key: string; + value: Quantity | undefined; +} + +/** Leases */ +export interface Leases { + $type: 'akash.provider.v1.Leases'; + active: number; +} + +/** ReservationsMetric */ +export interface ReservationsMetric { + $type: 'akash.provider.v1.ReservationsMetric'; + count: number; + resources: ResourcesMetric | undefined; +} + +/** Reservations */ +export interface Reservations { + $type: 'akash.provider.v1.Reservations'; + pending: ReservationsMetric | undefined; + active: ReservationsMetric | undefined; +} + +/** Inventory */ +export interface Inventory { + $type: 'akash.provider.v1.Inventory'; + cluster: Cluster | undefined; + reservations: Reservations | undefined; +} + +/** ClusterStatus */ +export interface ClusterStatus { + $type: 'akash.provider.v1.ClusterStatus'; + leases: Leases | undefined; + inventory: Inventory | undefined; +} + +/** BidEngineStatus */ +export interface BidEngineStatus { + $type: 'akash.provider.v1.BidEngineStatus'; + orders: number; +} + +/** ManifestStatus */ +export interface ManifestStatus { + $type: 'akash.provider.v1.ManifestStatus'; + deployments: number; +} + +/** Status */ +export interface Status { + $type: 'akash.provider.v1.Status'; + errors: string[]; + cluster: ClusterStatus | undefined; + bidEngine: BidEngineStatus | undefined; + manifest: ManifestStatus | undefined; + publicHostnames: string[]; + timestamp: Date | undefined; +} + +function createBaseResourcesMetric(): ResourcesMetric { + return { + $type: 'akash.provider.v1.ResourcesMetric', + cpu: undefined, + memory: undefined, + gpu: undefined, + ephemeralStorage: undefined, + storage: {}, + }; +} + +export const ResourcesMetric = { + $type: 'akash.provider.v1.ResourcesMetric' as const, + + encode( + message: ResourcesMetric, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.cpu !== undefined) { + Quantity.encode(message.cpu, writer.uint32(10).fork()).ldelim(); + } + if (message.memory !== undefined) { + Quantity.encode(message.memory, writer.uint32(18).fork()).ldelim(); + } + if (message.gpu !== undefined) { + Quantity.encode(message.gpu, writer.uint32(26).fork()).ldelim(); + } + if (message.ephemeralStorage !== undefined) { + Quantity.encode( + message.ephemeralStorage, + writer.uint32(34).fork(), + ).ldelim(); + } + Object.entries(message.storage).forEach(([key, value]) => { + ResourcesMetric_StorageEntry.encode( + { + $type: 'akash.provider.v1.ResourcesMetric.StorageEntry', + key: key as any, + value, + }, + writer.uint32(42).fork(), + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourcesMetric { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourcesMetric(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.cpu = Quantity.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.memory = Quantity.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.gpu = Quantity.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.ephemeralStorage = Quantity.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + const entry5 = ResourcesMetric_StorageEntry.decode( + reader, + reader.uint32(), + ); + if (entry5.value !== undefined) { + message.storage[entry5.key] = entry5.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourcesMetric { + return { + $type: ResourcesMetric.$type, + cpu: isSet(object.cpu) ? Quantity.fromJSON(object.cpu) : undefined, + memory: isSet(object.memory) + ? Quantity.fromJSON(object.memory) + : undefined, + gpu: isSet(object.gpu) ? Quantity.fromJSON(object.gpu) : undefined, + ephemeralStorage: isSet(object.ephemeralStorage) + ? Quantity.fromJSON(object.ephemeralStorage) + : undefined, + storage: isObject(object.storage) + ? Object.entries(object.storage).reduce<{ [key: string]: Quantity }>( + (acc, [key, value]) => { + acc[key] = Quantity.fromJSON(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: ResourcesMetric): unknown { + const obj: any = {}; + if (message.cpu !== undefined) { + obj.cpu = Quantity.toJSON(message.cpu); + } + if (message.memory !== undefined) { + obj.memory = Quantity.toJSON(message.memory); + } + if (message.gpu !== undefined) { + obj.gpu = Quantity.toJSON(message.gpu); + } + if (message.ephemeralStorage !== undefined) { + obj.ephemeralStorage = Quantity.toJSON(message.ephemeralStorage); + } + if (message.storage) { + const entries = Object.entries(message.storage); + if (entries.length > 0) { + obj.storage = {}; + entries.forEach(([k, v]) => { + obj.storage[k] = Quantity.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourcesMetric { + return ResourcesMetric.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourcesMetric { + const message = createBaseResourcesMetric(); + message.cpu = + object.cpu !== undefined && object.cpu !== null + ? Quantity.fromPartial(object.cpu) + : undefined; + message.memory = + object.memory !== undefined && object.memory !== null + ? Quantity.fromPartial(object.memory) + : undefined; + message.gpu = + object.gpu !== undefined && object.gpu !== null + ? Quantity.fromPartial(object.gpu) + : undefined; + message.ephemeralStorage = + object.ephemeralStorage !== undefined && object.ephemeralStorage !== null + ? Quantity.fromPartial(object.ephemeralStorage) + : undefined; + message.storage = Object.entries(object.storage ?? {}).reduce<{ + [key: string]: Quantity; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Quantity.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(ResourcesMetric.$type, ResourcesMetric); + +function createBaseResourcesMetric_StorageEntry(): ResourcesMetric_StorageEntry { + return { + $type: 'akash.provider.v1.ResourcesMetric.StorageEntry', + key: '', + value: undefined, + }; +} + +export const ResourcesMetric_StorageEntry = { + $type: 'akash.provider.v1.ResourcesMetric.StorageEntry' as const, + + encode( + message: ResourcesMetric_StorageEntry, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.key !== '') { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Quantity.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ResourcesMetric_StorageEntry { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourcesMetric_StorageEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Quantity.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResourcesMetric_StorageEntry { + return { + $type: ResourcesMetric_StorageEntry.$type, + key: isSet(object.key) ? globalThis.String(object.key) : '', + value: isSet(object.value) ? Quantity.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: ResourcesMetric_StorageEntry): unknown { + const obj: any = {}; + if (message.key !== '') { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Quantity.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): ResourcesMetric_StorageEntry { + return ResourcesMetric_StorageEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ResourcesMetric_StorageEntry { + const message = createBaseResourcesMetric_StorageEntry(); + message.key = object.key ?? ''; + message.value = + object.value !== undefined && object.value !== null + ? Quantity.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + ResourcesMetric_StorageEntry.$type, + ResourcesMetric_StorageEntry, +); + +function createBaseLeases(): Leases { + return { $type: 'akash.provider.v1.Leases', active: 0 }; +} + +export const Leases = { + $type: 'akash.provider.v1.Leases' as const, + + encode( + message: Leases, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.active !== 0) { + writer.uint32(8).uint32(message.active); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Leases { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeases(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.active = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Leases { + return { + $type: Leases.$type, + active: isSet(object.active) ? globalThis.Number(object.active) : 0, + }; + }, + + toJSON(message: Leases): unknown { + const obj: any = {}; + if (message.active !== 0) { + obj.active = Math.round(message.active); + } + return obj; + }, + + create, I>>(base?: I): Leases { + return Leases.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Leases { + const message = createBaseLeases(); + message.active = object.active ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Leases.$type, Leases); + +function createBaseReservationsMetric(): ReservationsMetric { + return { + $type: 'akash.provider.v1.ReservationsMetric', + count: 0, + resources: undefined, + }; +} + +export const ReservationsMetric = { + $type: 'akash.provider.v1.ReservationsMetric' as const, + + encode( + message: ReservationsMetric, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.count !== 0) { + writer.uint32(8).uint32(message.count); + } + if (message.resources !== undefined) { + ResourcesMetric.encode( + message.resources, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ReservationsMetric { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReservationsMetric(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.count = reader.uint32(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.resources = ResourcesMetric.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ReservationsMetric { + return { + $type: ReservationsMetric.$type, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + resources: isSet(object.resources) + ? ResourcesMetric.fromJSON(object.resources) + : undefined, + }; + }, + + toJSON(message: ReservationsMetric): unknown { + const obj: any = {}; + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + if (message.resources !== undefined) { + obj.resources = ResourcesMetric.toJSON(message.resources); + } + return obj; + }, + + create, I>>( + base?: I, + ): ReservationsMetric { + return ReservationsMetric.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ReservationsMetric { + const message = createBaseReservationsMetric(); + message.count = object.count ?? 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? ResourcesMetric.fromPartial(object.resources) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ReservationsMetric.$type, ReservationsMetric); + +function createBaseReservations(): Reservations { + return { + $type: 'akash.provider.v1.Reservations', + pending: undefined, + active: undefined, + }; +} + +export const Reservations = { + $type: 'akash.provider.v1.Reservations' as const, + + encode( + message: Reservations, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pending !== undefined) { + ReservationsMetric.encode( + message.pending, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.active !== undefined) { + ReservationsMetric.encode( + message.active, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Reservations { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReservations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.pending = ReservationsMetric.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.active = ReservationsMetric.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Reservations { + return { + $type: Reservations.$type, + pending: isSet(object.pending) + ? ReservationsMetric.fromJSON(object.pending) + : undefined, + active: isSet(object.active) + ? ReservationsMetric.fromJSON(object.active) + : undefined, + }; + }, + + toJSON(message: Reservations): unknown { + const obj: any = {}; + if (message.pending !== undefined) { + obj.pending = ReservationsMetric.toJSON(message.pending); + } + if (message.active !== undefined) { + obj.active = ReservationsMetric.toJSON(message.active); + } + return obj; + }, + + create, I>>( + base?: I, + ): Reservations { + return Reservations.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Reservations { + const message = createBaseReservations(); + message.pending = + object.pending !== undefined && object.pending !== null + ? ReservationsMetric.fromPartial(object.pending) + : undefined; + message.active = + object.active !== undefined && object.active !== null + ? ReservationsMetric.fromPartial(object.active) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Reservations.$type, Reservations); + +function createBaseInventory(): Inventory { + return { + $type: 'akash.provider.v1.Inventory', + cluster: undefined, + reservations: undefined, + }; +} + +export const Inventory = { + $type: 'akash.provider.v1.Inventory' as const, + + encode( + message: Inventory, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.cluster !== undefined) { + Cluster.encode(message.cluster, writer.uint32(10).fork()).ldelim(); + } + if (message.reservations !== undefined) { + Reservations.encode( + message.reservations, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Inventory { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInventory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.cluster = Cluster.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.reservations = Reservations.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Inventory { + return { + $type: Inventory.$type, + cluster: isSet(object.cluster) + ? Cluster.fromJSON(object.cluster) + : undefined, + reservations: isSet(object.reservations) + ? Reservations.fromJSON(object.reservations) + : undefined, + }; + }, + + toJSON(message: Inventory): unknown { + const obj: any = {}; + if (message.cluster !== undefined) { + obj.cluster = Cluster.toJSON(message.cluster); + } + if (message.reservations !== undefined) { + obj.reservations = Reservations.toJSON(message.reservations); + } + return obj; + }, + + create, I>>(base?: I): Inventory { + return Inventory.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Inventory { + const message = createBaseInventory(); + message.cluster = + object.cluster !== undefined && object.cluster !== null + ? Cluster.fromPartial(object.cluster) + : undefined; + message.reservations = + object.reservations !== undefined && object.reservations !== null + ? Reservations.fromPartial(object.reservations) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Inventory.$type, Inventory); + +function createBaseClusterStatus(): ClusterStatus { + return { + $type: 'akash.provider.v1.ClusterStatus', + leases: undefined, + inventory: undefined, + }; +} + +export const ClusterStatus = { + $type: 'akash.provider.v1.ClusterStatus' as const, + + encode( + message: ClusterStatus, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leases !== undefined) { + Leases.encode(message.leases, writer.uint32(10).fork()).ldelim(); + } + if (message.inventory !== undefined) { + Inventory.encode(message.inventory, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClusterStatus { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClusterStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.leases = Leases.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.inventory = Inventory.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ClusterStatus { + return { + $type: ClusterStatus.$type, + leases: isSet(object.leases) ? Leases.fromJSON(object.leases) : undefined, + inventory: isSet(object.inventory) + ? Inventory.fromJSON(object.inventory) + : undefined, + }; + }, + + toJSON(message: ClusterStatus): unknown { + const obj: any = {}; + if (message.leases !== undefined) { + obj.leases = Leases.toJSON(message.leases); + } + if (message.inventory !== undefined) { + obj.inventory = Inventory.toJSON(message.inventory); + } + return obj; + }, + + create, I>>( + base?: I, + ): ClusterStatus { + return ClusterStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ClusterStatus { + const message = createBaseClusterStatus(); + message.leases = + object.leases !== undefined && object.leases !== null + ? Leases.fromPartial(object.leases) + : undefined; + message.inventory = + object.inventory !== undefined && object.inventory !== null + ? Inventory.fromPartial(object.inventory) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ClusterStatus.$type, ClusterStatus); + +function createBaseBidEngineStatus(): BidEngineStatus { + return { $type: 'akash.provider.v1.BidEngineStatus', orders: 0 }; +} + +export const BidEngineStatus = { + $type: 'akash.provider.v1.BidEngineStatus' as const, + + encode( + message: BidEngineStatus, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.orders !== 0) { + writer.uint32(8).uint32(message.orders); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BidEngineStatus { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBidEngineStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.orders = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BidEngineStatus { + return { + $type: BidEngineStatus.$type, + orders: isSet(object.orders) ? globalThis.Number(object.orders) : 0, + }; + }, + + toJSON(message: BidEngineStatus): unknown { + const obj: any = {}; + if (message.orders !== 0) { + obj.orders = Math.round(message.orders); + } + return obj; + }, + + create, I>>( + base?: I, + ): BidEngineStatus { + return BidEngineStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): BidEngineStatus { + const message = createBaseBidEngineStatus(); + message.orders = object.orders ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(BidEngineStatus.$type, BidEngineStatus); + +function createBaseManifestStatus(): ManifestStatus { + return { $type: 'akash.provider.v1.ManifestStatus', deployments: 0 }; +} + +export const ManifestStatus = { + $type: 'akash.provider.v1.ManifestStatus' as const, + + encode( + message: ManifestStatus, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deployments !== 0) { + writer.uint32(8).uint32(message.deployments); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ManifestStatus { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseManifestStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.deployments = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ManifestStatus { + return { + $type: ManifestStatus.$type, + deployments: isSet(object.deployments) + ? globalThis.Number(object.deployments) + : 0, + }; + }, + + toJSON(message: ManifestStatus): unknown { + const obj: any = {}; + if (message.deployments !== 0) { + obj.deployments = Math.round(message.deployments); + } + return obj; + }, + + create, I>>( + base?: I, + ): ManifestStatus { + return ManifestStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ManifestStatus { + const message = createBaseManifestStatus(); + message.deployments = object.deployments ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ManifestStatus.$type, ManifestStatus); + +function createBaseStatus(): Status { + return { + $type: 'akash.provider.v1.Status', + errors: [], + cluster: undefined, + bidEngine: undefined, + manifest: undefined, + publicHostnames: [], + timestamp: undefined, + }; +} + +export const Status = { + $type: 'akash.provider.v1.Status' as const, + + encode( + message: Status, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.errors) { + writer.uint32(10).string(v!); + } + if (message.cluster !== undefined) { + ClusterStatus.encode(message.cluster, writer.uint32(18).fork()).ldelim(); + } + if (message.bidEngine !== undefined) { + BidEngineStatus.encode( + message.bidEngine, + writer.uint32(26).fork(), + ).ldelim(); + } + if (message.manifest !== undefined) { + ManifestStatus.encode( + message.manifest, + writer.uint32(34).fork(), + ).ldelim(); + } + for (const v of message.publicHostnames) { + writer.uint32(42).string(v!); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(50).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Status { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.errors.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.cluster = ClusterStatus.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.bidEngine = BidEngineStatus.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.manifest = ManifestStatus.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.publicHostnames.push(reader.string()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Status { + return { + $type: Status.$type, + errors: globalThis.Array.isArray(object?.errors) + ? object.errors.map((e: any) => globalThis.String(e)) + : [], + cluster: isSet(object.cluster) + ? ClusterStatus.fromJSON(object.cluster) + : undefined, + bidEngine: isSet(object.bidEngine) + ? BidEngineStatus.fromJSON(object.bidEngine) + : undefined, + manifest: isSet(object.manifest) + ? ManifestStatus.fromJSON(object.manifest) + : undefined, + publicHostnames: globalThis.Array.isArray(object?.publicHostnames) + ? object.publicHostnames.map((e: any) => globalThis.String(e)) + : [], + timestamp: isSet(object.timestamp) + ? fromJsonTimestamp(object.timestamp) + : undefined, + }; + }, + + toJSON(message: Status): unknown { + const obj: any = {}; + if (message.errors?.length) { + obj.errors = message.errors; + } + if (message.cluster !== undefined) { + obj.cluster = ClusterStatus.toJSON(message.cluster); + } + if (message.bidEngine !== undefined) { + obj.bidEngine = BidEngineStatus.toJSON(message.bidEngine); + } + if (message.manifest !== undefined) { + obj.manifest = ManifestStatus.toJSON(message.manifest); + } + if (message.publicHostnames?.length) { + obj.publicHostnames = message.publicHostnames; + } + if (message.timestamp !== undefined) { + obj.timestamp = message.timestamp.toISOString(); + } + return obj; + }, + + create, I>>(base?: I): Status { + return Status.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Status { + const message = createBaseStatus(); + message.errors = object.errors?.map((e) => e) || []; + message.cluster = + object.cluster !== undefined && object.cluster !== null + ? ClusterStatus.fromPartial(object.cluster) + : undefined; + message.bidEngine = + object.bidEngine !== undefined && object.bidEngine !== null + ? BidEngineStatus.fromPartial(object.bidEngine) + : undefined; + message.manifest = + object.manifest !== undefined && object.manifest !== null + ? ManifestStatus.fromPartial(object.manifest) + : undefined; + message.publicHostnames = object.publicHostnames?.map((e) => e) || []; + message.timestamp = object.timestamp ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Status.$type, Status); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(Math.trunc(date.getTime() / 1_000)); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: 'google.protobuf.Timestamp', seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds.toNumber() || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new globalThis.Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof globalThis.Date) { + return o; + } else if (typeof o === 'string') { + return new globalThis.Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isObject(value: any): boolean { + return typeof value === 'object' && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/provider/v1beta1/provider.ts b/ts/src/generated/akash/provider/v1beta1/provider.ts new file mode 100644 index 00000000..cfde284b --- /dev/null +++ b/ts/src/generated/akash/provider/v1beta1/provider.ts @@ -0,0 +1,894 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from '../../base/v1beta1/attribute'; + +export const protobufPackage = 'akash.provider.v1beta1'; + +/** ProviderInfo */ +export interface ProviderInfo { + $type: 'akash.provider.v1beta1.ProviderInfo'; + email: string; + website: string; +} + +/** MsgCreateProvider defines an SDK message for creating a provider */ +export interface MsgCreateProvider { + $type: 'akash.provider.v1beta1.MsgCreateProvider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +/** MsgCreateProviderResponse defines the Msg/CreateProvider response type. */ +export interface MsgCreateProviderResponse { + $type: 'akash.provider.v1beta1.MsgCreateProviderResponse'; +} + +/** MsgUpdateProvider defines an SDK message for updating a provider */ +export interface MsgUpdateProvider { + $type: 'akash.provider.v1beta1.MsgUpdateProvider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +/** MsgUpdateProviderResponse defines the Msg/UpdateProvider response type. */ +export interface MsgUpdateProviderResponse { + $type: 'akash.provider.v1beta1.MsgUpdateProviderResponse'; +} + +/** MsgDeleteProvider defines an SDK message for deleting a provider */ +export interface MsgDeleteProvider { + $type: 'akash.provider.v1beta1.MsgDeleteProvider'; + owner: string; +} + +/** MsgDeleteProviderResponse defines the Msg/DeleteProvider response type. */ +export interface MsgDeleteProviderResponse { + $type: 'akash.provider.v1beta1.MsgDeleteProviderResponse'; +} + +/** Provider stores owner and host details */ +export interface Provider { + $type: 'akash.provider.v1beta1.Provider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +function createBaseProviderInfo(): ProviderInfo { + return { + $type: 'akash.provider.v1beta1.ProviderInfo', + email: '', + website: '', + }; +} + +export const ProviderInfo = { + $type: 'akash.provider.v1beta1.ProviderInfo' as const, + + encode( + message: ProviderInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.email !== '') { + writer.uint32(10).string(message.email); + } + if (message.website !== '') { + writer.uint32(18).string(message.website); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProviderInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.email = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.website = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProviderInfo { + return { + $type: ProviderInfo.$type, + email: isSet(object.email) ? globalThis.String(object.email) : '', + website: isSet(object.website) ? globalThis.String(object.website) : '', + }; + }, + + toJSON(message: ProviderInfo): unknown { + const obj: any = {}; + if (message.email !== '') { + obj.email = message.email; + } + if (message.website !== '') { + obj.website = message.website; + } + return obj; + }, + + create, I>>( + base?: I, + ): ProviderInfo { + return ProviderInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ProviderInfo { + const message = createBaseProviderInfo(); + message.email = object.email ?? ''; + message.website = object.website ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(ProviderInfo.$type, ProviderInfo); + +function createBaseMsgCreateProvider(): MsgCreateProvider { + return { + $type: 'akash.provider.v1beta1.MsgCreateProvider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const MsgCreateProvider = { + $type: 'akash.provider.v1beta1.MsgCreateProvider' as const, + + encode( + message: MsgCreateProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateProvider { + return { + $type: MsgCreateProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: MsgCreateProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateProvider { + return MsgCreateProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateProvider { + const message = createBaseMsgCreateProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateProvider.$type, MsgCreateProvider); + +function createBaseMsgCreateProviderResponse(): MsgCreateProviderResponse { + return { $type: 'akash.provider.v1beta1.MsgCreateProviderResponse' }; +} + +export const MsgCreateProviderResponse = { + $type: 'akash.provider.v1beta1.MsgCreateProviderResponse' as const, + + encode( + _: MsgCreateProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateProviderResponse { + return { $type: MsgCreateProviderResponse.$type }; + }, + + toJSON(_: MsgCreateProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateProviderResponse { + return MsgCreateProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateProviderResponse { + const message = createBaseMsgCreateProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateProviderResponse.$type, + MsgCreateProviderResponse, +); + +function createBaseMsgUpdateProvider(): MsgUpdateProvider { + return { + $type: 'akash.provider.v1beta1.MsgUpdateProvider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const MsgUpdateProvider = { + $type: 'akash.provider.v1beta1.MsgUpdateProvider' as const, + + encode( + message: MsgUpdateProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateProvider { + return { + $type: MsgUpdateProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: MsgUpdateProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateProvider { + return MsgUpdateProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgUpdateProvider { + const message = createBaseMsgUpdateProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgUpdateProvider.$type, MsgUpdateProvider); + +function createBaseMsgUpdateProviderResponse(): MsgUpdateProviderResponse { + return { $type: 'akash.provider.v1beta1.MsgUpdateProviderResponse' }; +} + +export const MsgUpdateProviderResponse = { + $type: 'akash.provider.v1beta1.MsgUpdateProviderResponse' as const, + + encode( + _: MsgUpdateProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdateProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateProviderResponse { + return { $type: MsgUpdateProviderResponse.$type }; + }, + + toJSON(_: MsgUpdateProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateProviderResponse { + return MsgUpdateProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateProviderResponse { + const message = createBaseMsgUpdateProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgUpdateProviderResponse.$type, + MsgUpdateProviderResponse, +); + +function createBaseMsgDeleteProvider(): MsgDeleteProvider { + return { $type: 'akash.provider.v1beta1.MsgDeleteProvider', owner: '' }; +} + +export const MsgDeleteProvider = { + $type: 'akash.provider.v1beta1.MsgDeleteProvider' as const, + + encode( + message: MsgDeleteProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDeleteProvider { + return { + $type: MsgDeleteProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: MsgDeleteProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProvider { + return MsgDeleteProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDeleteProvider { + const message = createBaseMsgDeleteProvider(); + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MsgDeleteProvider.$type, MsgDeleteProvider); + +function createBaseMsgDeleteProviderResponse(): MsgDeleteProviderResponse { + return { $type: 'akash.provider.v1beta1.MsgDeleteProviderResponse' }; +} + +export const MsgDeleteProviderResponse = { + $type: 'akash.provider.v1beta1.MsgDeleteProviderResponse' as const, + + encode( + _: MsgDeleteProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDeleteProviderResponse { + return { $type: MsgDeleteProviderResponse.$type }; + }, + + toJSON(_: MsgDeleteProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderResponse { + return MsgDeleteProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgDeleteProviderResponse { + const message = createBaseMsgDeleteProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderResponse.$type, + MsgDeleteProviderResponse, +); + +function createBaseProvider(): Provider { + return { + $type: 'akash.provider.v1beta1.Provider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const Provider = { + $type: 'akash.provider.v1beta1.Provider' as const, + + encode( + message: Provider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Provider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Provider { + return { + $type: Provider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: Provider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>(base?: I): Provider { + return Provider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Provider { + const message = createBaseProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Provider.$type, Provider); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** CreateProvider defines a method that creates a provider given the proper inputs */ + CreateProvider( + request: MsgCreateProvider, + ): Promise; + /** UpdateProvider defines a method that updates a provider given the proper inputs */ + UpdateProvider( + request: MsgUpdateProvider, + ): Promise; + /** DeleteProvider defines a method that deletes a provider given the proper inputs */ + DeleteProvider( + request: MsgDeleteProvider, + ): Promise; +} + +export const MsgServiceName = 'akash.provider.v1beta1.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateProvider = this.CreateProvider.bind(this); + this.UpdateProvider = this.UpdateProvider.bind(this); + this.DeleteProvider = this.DeleteProvider.bind(this); + } + CreateProvider( + request: MsgCreateProvider, + ): Promise { + const data = MsgCreateProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateProvider', data); + return promise.then((data) => + MsgCreateProviderResponse.decode(_m0.Reader.create(data)), + ); + } + + UpdateProvider( + request: MsgUpdateProvider, + ): Promise { + const data = MsgUpdateProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'UpdateProvider', data); + return promise.then((data) => + MsgUpdateProviderResponse.decode(_m0.Reader.create(data)), + ); + } + + DeleteProvider( + request: MsgDeleteProvider, + ): Promise { + const data = MsgDeleteProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'DeleteProvider', data); + return promise.then((data) => + MsgDeleteProviderResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/provider/v1beta2/genesis.ts b/ts/src/generated/akash/provider/v1beta2/genesis.ts new file mode 100644 index 00000000..3fa0dcba --- /dev/null +++ b/ts/src/generated/akash/provider/v1beta2/genesis.ts @@ -0,0 +1,121 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Provider } from './provider'; + +export const protobufPackage = 'akash.provider.v1beta2'; + +/** GenesisState defines the basic genesis state used by provider module */ +export interface GenesisState { + $type: 'akash.provider.v1beta2.GenesisState'; + providers: Provider[]; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.provider.v1beta2.GenesisState', providers: [] }; +} + +export const GenesisState = { + $type: 'akash.provider.v1beta2.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.providers) { + Provider.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.providers.push(Provider.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + providers: globalThis.Array.isArray(object?.providers) + ? object.providers.map((e: any) => Provider.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.providers?.length) { + obj.providers = message.providers.map((e) => Provider.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.providers = + object.providers?.map((e) => Provider.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/provider/v1beta2/provider.ts b/ts/src/generated/akash/provider/v1beta2/provider.ts new file mode 100644 index 00000000..b2cb5bc5 --- /dev/null +++ b/ts/src/generated/akash/provider/v1beta2/provider.ts @@ -0,0 +1,894 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from '../../base/v1beta2/attribute'; + +export const protobufPackage = 'akash.provider.v1beta2'; + +/** ProviderInfo */ +export interface ProviderInfo { + $type: 'akash.provider.v1beta2.ProviderInfo'; + email: string; + website: string; +} + +/** MsgCreateProvider defines an SDK message for creating a provider */ +export interface MsgCreateProvider { + $type: 'akash.provider.v1beta2.MsgCreateProvider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +/** MsgCreateProviderResponse defines the Msg/CreateProvider response type. */ +export interface MsgCreateProviderResponse { + $type: 'akash.provider.v1beta2.MsgCreateProviderResponse'; +} + +/** MsgUpdateProvider defines an SDK message for updating a provider */ +export interface MsgUpdateProvider { + $type: 'akash.provider.v1beta2.MsgUpdateProvider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +/** MsgUpdateProviderResponse defines the Msg/UpdateProvider response type. */ +export interface MsgUpdateProviderResponse { + $type: 'akash.provider.v1beta2.MsgUpdateProviderResponse'; +} + +/** MsgDeleteProvider defines an SDK message for deleting a provider */ +export interface MsgDeleteProvider { + $type: 'akash.provider.v1beta2.MsgDeleteProvider'; + owner: string; +} + +/** MsgDeleteProviderResponse defines the Msg/DeleteProvider response type. */ +export interface MsgDeleteProviderResponse { + $type: 'akash.provider.v1beta2.MsgDeleteProviderResponse'; +} + +/** Provider stores owner and host details */ +export interface Provider { + $type: 'akash.provider.v1beta2.Provider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +function createBaseProviderInfo(): ProviderInfo { + return { + $type: 'akash.provider.v1beta2.ProviderInfo', + email: '', + website: '', + }; +} + +export const ProviderInfo = { + $type: 'akash.provider.v1beta2.ProviderInfo' as const, + + encode( + message: ProviderInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.email !== '') { + writer.uint32(10).string(message.email); + } + if (message.website !== '') { + writer.uint32(18).string(message.website); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProviderInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.email = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.website = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProviderInfo { + return { + $type: ProviderInfo.$type, + email: isSet(object.email) ? globalThis.String(object.email) : '', + website: isSet(object.website) ? globalThis.String(object.website) : '', + }; + }, + + toJSON(message: ProviderInfo): unknown { + const obj: any = {}; + if (message.email !== '') { + obj.email = message.email; + } + if (message.website !== '') { + obj.website = message.website; + } + return obj; + }, + + create, I>>( + base?: I, + ): ProviderInfo { + return ProviderInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ProviderInfo { + const message = createBaseProviderInfo(); + message.email = object.email ?? ''; + message.website = object.website ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(ProviderInfo.$type, ProviderInfo); + +function createBaseMsgCreateProvider(): MsgCreateProvider { + return { + $type: 'akash.provider.v1beta2.MsgCreateProvider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const MsgCreateProvider = { + $type: 'akash.provider.v1beta2.MsgCreateProvider' as const, + + encode( + message: MsgCreateProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateProvider { + return { + $type: MsgCreateProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: MsgCreateProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateProvider { + return MsgCreateProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateProvider { + const message = createBaseMsgCreateProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateProvider.$type, MsgCreateProvider); + +function createBaseMsgCreateProviderResponse(): MsgCreateProviderResponse { + return { $type: 'akash.provider.v1beta2.MsgCreateProviderResponse' }; +} + +export const MsgCreateProviderResponse = { + $type: 'akash.provider.v1beta2.MsgCreateProviderResponse' as const, + + encode( + _: MsgCreateProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateProviderResponse { + return { $type: MsgCreateProviderResponse.$type }; + }, + + toJSON(_: MsgCreateProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateProviderResponse { + return MsgCreateProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateProviderResponse { + const message = createBaseMsgCreateProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateProviderResponse.$type, + MsgCreateProviderResponse, +); + +function createBaseMsgUpdateProvider(): MsgUpdateProvider { + return { + $type: 'akash.provider.v1beta2.MsgUpdateProvider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const MsgUpdateProvider = { + $type: 'akash.provider.v1beta2.MsgUpdateProvider' as const, + + encode( + message: MsgUpdateProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateProvider { + return { + $type: MsgUpdateProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: MsgUpdateProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateProvider { + return MsgUpdateProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgUpdateProvider { + const message = createBaseMsgUpdateProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgUpdateProvider.$type, MsgUpdateProvider); + +function createBaseMsgUpdateProviderResponse(): MsgUpdateProviderResponse { + return { $type: 'akash.provider.v1beta2.MsgUpdateProviderResponse' }; +} + +export const MsgUpdateProviderResponse = { + $type: 'akash.provider.v1beta2.MsgUpdateProviderResponse' as const, + + encode( + _: MsgUpdateProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdateProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateProviderResponse { + return { $type: MsgUpdateProviderResponse.$type }; + }, + + toJSON(_: MsgUpdateProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateProviderResponse { + return MsgUpdateProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateProviderResponse { + const message = createBaseMsgUpdateProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgUpdateProviderResponse.$type, + MsgUpdateProviderResponse, +); + +function createBaseMsgDeleteProvider(): MsgDeleteProvider { + return { $type: 'akash.provider.v1beta2.MsgDeleteProvider', owner: '' }; +} + +export const MsgDeleteProvider = { + $type: 'akash.provider.v1beta2.MsgDeleteProvider' as const, + + encode( + message: MsgDeleteProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDeleteProvider { + return { + $type: MsgDeleteProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: MsgDeleteProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProvider { + return MsgDeleteProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDeleteProvider { + const message = createBaseMsgDeleteProvider(); + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MsgDeleteProvider.$type, MsgDeleteProvider); + +function createBaseMsgDeleteProviderResponse(): MsgDeleteProviderResponse { + return { $type: 'akash.provider.v1beta2.MsgDeleteProviderResponse' }; +} + +export const MsgDeleteProviderResponse = { + $type: 'akash.provider.v1beta2.MsgDeleteProviderResponse' as const, + + encode( + _: MsgDeleteProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDeleteProviderResponse { + return { $type: MsgDeleteProviderResponse.$type }; + }, + + toJSON(_: MsgDeleteProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderResponse { + return MsgDeleteProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgDeleteProviderResponse { + const message = createBaseMsgDeleteProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderResponse.$type, + MsgDeleteProviderResponse, +); + +function createBaseProvider(): Provider { + return { + $type: 'akash.provider.v1beta2.Provider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const Provider = { + $type: 'akash.provider.v1beta2.Provider' as const, + + encode( + message: Provider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Provider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Provider { + return { + $type: Provider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: Provider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>(base?: I): Provider { + return Provider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Provider { + const message = createBaseProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Provider.$type, Provider); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** CreateProvider defines a method that creates a provider given the proper inputs */ + CreateProvider( + request: MsgCreateProvider, + ): Promise; + /** UpdateProvider defines a method that updates a provider given the proper inputs */ + UpdateProvider( + request: MsgUpdateProvider, + ): Promise; + /** DeleteProvider defines a method that deletes a provider given the proper inputs */ + DeleteProvider( + request: MsgDeleteProvider, + ): Promise; +} + +export const MsgServiceName = 'akash.provider.v1beta2.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateProvider = this.CreateProvider.bind(this); + this.UpdateProvider = this.UpdateProvider.bind(this); + this.DeleteProvider = this.DeleteProvider.bind(this); + } + CreateProvider( + request: MsgCreateProvider, + ): Promise { + const data = MsgCreateProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateProvider', data); + return promise.then((data) => + MsgCreateProviderResponse.decode(_m0.Reader.create(data)), + ); + } + + UpdateProvider( + request: MsgUpdateProvider, + ): Promise { + const data = MsgUpdateProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'UpdateProvider', data); + return promise.then((data) => + MsgUpdateProviderResponse.decode(_m0.Reader.create(data)), + ); + } + + DeleteProvider( + request: MsgDeleteProvider, + ): Promise { + const data = MsgDeleteProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'DeleteProvider', data); + return promise.then((data) => + MsgDeleteProviderResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/provider/v1beta2/query.ts b/ts/src/generated/akash/provider/v1beta2/query.ts new file mode 100644 index 00000000..372e170b --- /dev/null +++ b/ts/src/generated/akash/provider/v1beta2/query.ts @@ -0,0 +1,462 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Provider } from './provider'; + +export const protobufPackage = 'akash.provider.v1beta2'; + +/** QueryProvidersRequest is request type for the Query/Providers RPC method */ +export interface QueryProvidersRequest { + $type: 'akash.provider.v1beta2.QueryProvidersRequest'; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryProvidersResponse { + $type: 'akash.provider.v1beta2.QueryProvidersResponse'; + providers: Provider[]; + pagination: PageResponse | undefined; +} + +/** QueryProviderRequest is request type for the Query/Provider RPC method */ +export interface QueryProviderRequest { + $type: 'akash.provider.v1beta2.QueryProviderRequest'; + owner: string; +} + +/** QueryProviderResponse is response type for the Query/Provider RPC method */ +export interface QueryProviderResponse { + $type: 'akash.provider.v1beta2.QueryProviderResponse'; + provider: Provider | undefined; +} + +function createBaseQueryProvidersRequest(): QueryProvidersRequest { + return { + $type: 'akash.provider.v1beta2.QueryProvidersRequest', + pagination: undefined, + }; +} + +export const QueryProvidersRequest = { + $type: 'akash.provider.v1beta2.QueryProvidersRequest' as const, + + encode( + message: QueryProvidersRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProvidersRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProvidersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProvidersRequest { + return { + $type: QueryProvidersRequest.$type, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProvidersRequest): unknown { + const obj: any = {}; + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProvidersRequest { + return QueryProvidersRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProvidersRequest { + const message = createBaseQueryProvidersRequest(); + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProvidersRequest.$type, QueryProvidersRequest); + +function createBaseQueryProvidersResponse(): QueryProvidersResponse { + return { + $type: 'akash.provider.v1beta2.QueryProvidersResponse', + providers: [], + pagination: undefined, + }; +} + +export const QueryProvidersResponse = { + $type: 'akash.provider.v1beta2.QueryProvidersResponse' as const, + + encode( + message: QueryProvidersResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.providers) { + Provider.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProvidersResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProvidersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.providers.push(Provider.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProvidersResponse { + return { + $type: QueryProvidersResponse.$type, + providers: globalThis.Array.isArray(object?.providers) + ? object.providers.map((e: any) => Provider.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProvidersResponse): unknown { + const obj: any = {}; + if (message.providers?.length) { + obj.providers = message.providers.map((e) => Provider.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProvidersResponse { + const message = createBaseQueryProvidersResponse(); + message.providers = + object.providers?.map((e) => Provider.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProvidersResponse.$type, QueryProvidersResponse); + +function createBaseQueryProviderRequest(): QueryProviderRequest { + return { $type: 'akash.provider.v1beta2.QueryProviderRequest', owner: '' }; +} + +export const QueryProviderRequest = { + $type: 'akash.provider.v1beta2.QueryProviderRequest' as const, + + encode( + message: QueryProviderRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderRequest { + return { + $type: QueryProviderRequest.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: QueryProviderRequest): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderRequest { + const message = createBaseQueryProviderRequest(); + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(QueryProviderRequest.$type, QueryProviderRequest); + +function createBaseQueryProviderResponse(): QueryProviderResponse { + return { + $type: 'akash.provider.v1beta2.QueryProviderResponse', + provider: undefined, + }; +} + +export const QueryProviderResponse = { + $type: 'akash.provider.v1beta2.QueryProviderResponse' as const, + + encode( + message: QueryProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.provider !== undefined) { + Provider.encode(message.provider, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.provider = Provider.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderResponse { + return { + $type: QueryProviderResponse.$type, + provider: isSet(object.provider) + ? Provider.fromJSON(object.provider) + : undefined, + }; + }, + + toJSON(message: QueryProviderResponse): unknown { + const obj: any = {}; + if (message.provider !== undefined) { + obj.provider = Provider.toJSON(message.provider); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderResponse { + return QueryProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderResponse { + const message = createBaseQueryProviderResponse(); + message.provider = + object.provider !== undefined && object.provider !== null + ? Provider.fromPartial(object.provider) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProviderResponse.$type, QueryProviderResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Providers queries providers */ + Providers(request: QueryProvidersRequest): Promise; + /** Provider queries provider details */ + Provider(request: QueryProviderRequest): Promise; +} + +export const QueryServiceName = 'akash.provider.v1beta2.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Providers = this.Providers.bind(this); + this.Provider = this.Provider.bind(this); + } + Providers(request: QueryProvidersRequest): Promise { + const data = QueryProvidersRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Providers', data); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + Provider(request: QueryProviderRequest): Promise { + const data = QueryProviderRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Provider', data); + return promise.then((data) => + QueryProviderResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/provider/v1beta3/genesis.ts b/ts/src/generated/akash/provider/v1beta3/genesis.ts new file mode 100644 index 00000000..8d793174 --- /dev/null +++ b/ts/src/generated/akash/provider/v1beta3/genesis.ts @@ -0,0 +1,121 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Provider } from './provider'; + +export const protobufPackage = 'akash.provider.v1beta3'; + +/** GenesisState defines the basic genesis state used by provider module */ +export interface GenesisState { + $type: 'akash.provider.v1beta3.GenesisState'; + providers: Provider[]; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.provider.v1beta3.GenesisState', providers: [] }; +} + +export const GenesisState = { + $type: 'akash.provider.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.providers) { + Provider.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.providers.push(Provider.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + providers: globalThis.Array.isArray(object?.providers) + ? object.providers.map((e: any) => Provider.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.providers?.length) { + obj.providers = message.providers.map((e) => Provider.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.providers = + object.providers?.map((e) => Provider.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/akash/provider/v1beta3/provider.ts b/ts/src/generated/akash/provider/v1beta3/provider.ts new file mode 100644 index 00000000..7d703298 --- /dev/null +++ b/ts/src/generated/akash/provider/v1beta3/provider.ts @@ -0,0 +1,894 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Attribute } from '../../base/v1beta3/attribute'; + +export const protobufPackage = 'akash.provider.v1beta3'; + +/** ProviderInfo */ +export interface ProviderInfo { + $type: 'akash.provider.v1beta3.ProviderInfo'; + email: string; + website: string; +} + +/** MsgCreateProvider defines an SDK message for creating a provider */ +export interface MsgCreateProvider { + $type: 'akash.provider.v1beta3.MsgCreateProvider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +/** MsgCreateProviderResponse defines the Msg/CreateProvider response type. */ +export interface MsgCreateProviderResponse { + $type: 'akash.provider.v1beta3.MsgCreateProviderResponse'; +} + +/** MsgUpdateProvider defines an SDK message for updating a provider */ +export interface MsgUpdateProvider { + $type: 'akash.provider.v1beta3.MsgUpdateProvider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +/** MsgUpdateProviderResponse defines the Msg/UpdateProvider response type. */ +export interface MsgUpdateProviderResponse { + $type: 'akash.provider.v1beta3.MsgUpdateProviderResponse'; +} + +/** MsgDeleteProvider defines an SDK message for deleting a provider */ +export interface MsgDeleteProvider { + $type: 'akash.provider.v1beta3.MsgDeleteProvider'; + owner: string; +} + +/** MsgDeleteProviderResponse defines the Msg/DeleteProvider response type. */ +export interface MsgDeleteProviderResponse { + $type: 'akash.provider.v1beta3.MsgDeleteProviderResponse'; +} + +/** Provider stores owner and host details */ +export interface Provider { + $type: 'akash.provider.v1beta3.Provider'; + owner: string; + hostUri: string; + attributes: Attribute[]; + info: ProviderInfo | undefined; +} + +function createBaseProviderInfo(): ProviderInfo { + return { + $type: 'akash.provider.v1beta3.ProviderInfo', + email: '', + website: '', + }; +} + +export const ProviderInfo = { + $type: 'akash.provider.v1beta3.ProviderInfo' as const, + + encode( + message: ProviderInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.email !== '') { + writer.uint32(10).string(message.email); + } + if (message.website !== '') { + writer.uint32(18).string(message.website); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProviderInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.email = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.website = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProviderInfo { + return { + $type: ProviderInfo.$type, + email: isSet(object.email) ? globalThis.String(object.email) : '', + website: isSet(object.website) ? globalThis.String(object.website) : '', + }; + }, + + toJSON(message: ProviderInfo): unknown { + const obj: any = {}; + if (message.email !== '') { + obj.email = message.email; + } + if (message.website !== '') { + obj.website = message.website; + } + return obj; + }, + + create, I>>( + base?: I, + ): ProviderInfo { + return ProviderInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ProviderInfo { + const message = createBaseProviderInfo(); + message.email = object.email ?? ''; + message.website = object.website ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(ProviderInfo.$type, ProviderInfo); + +function createBaseMsgCreateProvider(): MsgCreateProvider { + return { + $type: 'akash.provider.v1beta3.MsgCreateProvider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const MsgCreateProvider = { + $type: 'akash.provider.v1beta3.MsgCreateProvider' as const, + + encode( + message: MsgCreateProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgCreateProvider { + return { + $type: MsgCreateProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: MsgCreateProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateProvider { + return MsgCreateProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgCreateProvider { + const message = createBaseMsgCreateProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgCreateProvider.$type, MsgCreateProvider); + +function createBaseMsgCreateProviderResponse(): MsgCreateProviderResponse { + return { $type: 'akash.provider.v1beta3.MsgCreateProviderResponse' }; +} + +export const MsgCreateProviderResponse = { + $type: 'akash.provider.v1beta3.MsgCreateProviderResponse' as const, + + encode( + _: MsgCreateProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgCreateProviderResponse { + return { $type: MsgCreateProviderResponse.$type }; + }, + + toJSON(_: MsgCreateProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgCreateProviderResponse { + return MsgCreateProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgCreateProviderResponse { + const message = createBaseMsgCreateProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgCreateProviderResponse.$type, + MsgCreateProviderResponse, +); + +function createBaseMsgUpdateProvider(): MsgUpdateProvider { + return { + $type: 'akash.provider.v1beta3.MsgUpdateProvider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const MsgUpdateProvider = { + $type: 'akash.provider.v1beta3.MsgUpdateProvider' as const, + + encode( + message: MsgUpdateProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateProvider { + return { + $type: MsgUpdateProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: MsgUpdateProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateProvider { + return MsgUpdateProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgUpdateProvider { + const message = createBaseMsgUpdateProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MsgUpdateProvider.$type, MsgUpdateProvider); + +function createBaseMsgUpdateProviderResponse(): MsgUpdateProviderResponse { + return { $type: 'akash.provider.v1beta3.MsgUpdateProviderResponse' }; +} + +export const MsgUpdateProviderResponse = { + $type: 'akash.provider.v1beta3.MsgUpdateProviderResponse' as const, + + encode( + _: MsgUpdateProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdateProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateProviderResponse { + return { $type: MsgUpdateProviderResponse.$type }; + }, + + toJSON(_: MsgUpdateProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateProviderResponse { + return MsgUpdateProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateProviderResponse { + const message = createBaseMsgUpdateProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgUpdateProviderResponse.$type, + MsgUpdateProviderResponse, +); + +function createBaseMsgDeleteProvider(): MsgDeleteProvider { + return { $type: 'akash.provider.v1beta3.MsgDeleteProvider', owner: '' }; +} + +export const MsgDeleteProvider = { + $type: 'akash.provider.v1beta3.MsgDeleteProvider' as const, + + encode( + message: MsgDeleteProvider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteProvider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDeleteProvider { + return { + $type: MsgDeleteProvider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: MsgDeleteProvider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProvider { + return MsgDeleteProvider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDeleteProvider { + const message = createBaseMsgDeleteProvider(); + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(MsgDeleteProvider.$type, MsgDeleteProvider); + +function createBaseMsgDeleteProviderResponse(): MsgDeleteProviderResponse { + return { $type: 'akash.provider.v1beta3.MsgDeleteProviderResponse' }; +} + +export const MsgDeleteProviderResponse = { + $type: 'akash.provider.v1beta3.MsgDeleteProviderResponse' as const, + + encode( + _: MsgDeleteProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDeleteProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDeleteProviderResponse { + return { $type: MsgDeleteProviderResponse.$type }; + }, + + toJSON(_: MsgDeleteProviderResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgDeleteProviderResponse { + return MsgDeleteProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgDeleteProviderResponse { + const message = createBaseMsgDeleteProviderResponse(); + return message; + }, +}; + +messageTypeRegistry.set( + MsgDeleteProviderResponse.$type, + MsgDeleteProviderResponse, +); + +function createBaseProvider(): Provider { + return { + $type: 'akash.provider.v1beta3.Provider', + owner: '', + hostUri: '', + attributes: [], + info: undefined, + }; +} + +export const Provider = { + $type: 'akash.provider.v1beta3.Provider' as const, + + encode( + message: Provider, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.hostUri !== '') { + writer.uint32(18).string(message.hostUri); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ProviderInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Provider { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.hostUri = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.info = ProviderInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Provider { + return { + $type: Provider.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + hostUri: isSet(object.hostUri) ? globalThis.String(object.hostUri) : '', + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + info: isSet(object.info) ? ProviderInfo.fromJSON(object.info) : undefined, + }; + }, + + toJSON(message: Provider): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + if (message.hostUri !== '') { + obj.hostUri = message.hostUri; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.info !== undefined) { + obj.info = ProviderInfo.toJSON(message.info); + } + return obj; + }, + + create, I>>(base?: I): Provider { + return Provider.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Provider { + const message = createBaseProvider(); + message.owner = object.owner ?? ''; + message.hostUri = object.hostUri ?? ''; + message.attributes = + object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.info = + object.info !== undefined && object.info !== null + ? ProviderInfo.fromPartial(object.info) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Provider.$type, Provider); + +/** Msg defines the provider Msg service */ +export interface Msg { + /** CreateProvider defines a method that creates a provider given the proper inputs */ + CreateProvider( + request: MsgCreateProvider, + ): Promise; + /** UpdateProvider defines a method that updates a provider given the proper inputs */ + UpdateProvider( + request: MsgUpdateProvider, + ): Promise; + /** DeleteProvider defines a method that deletes a provider given the proper inputs */ + DeleteProvider( + request: MsgDeleteProvider, + ): Promise; +} + +export const MsgServiceName = 'akash.provider.v1beta3.Msg'; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.CreateProvider = this.CreateProvider.bind(this); + this.UpdateProvider = this.UpdateProvider.bind(this); + this.DeleteProvider = this.DeleteProvider.bind(this); + } + CreateProvider( + request: MsgCreateProvider, + ): Promise { + const data = MsgCreateProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'CreateProvider', data); + return promise.then((data) => + MsgCreateProviderResponse.decode(_m0.Reader.create(data)), + ); + } + + UpdateProvider( + request: MsgUpdateProvider, + ): Promise { + const data = MsgUpdateProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'UpdateProvider', data); + return promise.then((data) => + MsgUpdateProviderResponse.decode(_m0.Reader.create(data)), + ); + } + + DeleteProvider( + request: MsgDeleteProvider, + ): Promise { + const data = MsgDeleteProvider.encode(request).finish(); + const promise = this.rpc.request(this.service, 'DeleteProvider', data); + return promise.then((data) => + MsgDeleteProviderResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/provider/v1beta3/query.ts b/ts/src/generated/akash/provider/v1beta3/query.ts new file mode 100644 index 00000000..eebe16f9 --- /dev/null +++ b/ts/src/generated/akash/provider/v1beta3/query.ts @@ -0,0 +1,462 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { + PageRequest, + PageResponse, +} from '../../../cosmos/base/query/v1beta1/pagination'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Provider } from './provider'; + +export const protobufPackage = 'akash.provider.v1beta3'; + +/** QueryProvidersRequest is request type for the Query/Providers RPC method */ +export interface QueryProvidersRequest { + $type: 'akash.provider.v1beta3.QueryProvidersRequest'; + pagination: PageRequest | undefined; +} + +/** QueryProvidersResponse is response type for the Query/Providers RPC method */ +export interface QueryProvidersResponse { + $type: 'akash.provider.v1beta3.QueryProvidersResponse'; + providers: Provider[]; + pagination: PageResponse | undefined; +} + +/** QueryProviderRequest is request type for the Query/Provider RPC method */ +export interface QueryProviderRequest { + $type: 'akash.provider.v1beta3.QueryProviderRequest'; + owner: string; +} + +/** QueryProviderResponse is response type for the Query/Provider RPC method */ +export interface QueryProviderResponse { + $type: 'akash.provider.v1beta3.QueryProviderResponse'; + provider: Provider | undefined; +} + +function createBaseQueryProvidersRequest(): QueryProvidersRequest { + return { + $type: 'akash.provider.v1beta3.QueryProvidersRequest', + pagination: undefined, + }; +} + +export const QueryProvidersRequest = { + $type: 'akash.provider.v1beta3.QueryProvidersRequest' as const, + + encode( + message: QueryProvidersRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProvidersRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProvidersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.pagination = PageRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProvidersRequest { + return { + $type: QueryProvidersRequest.$type, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProvidersRequest): unknown { + const obj: any = {}; + if (message.pagination !== undefined) { + obj.pagination = PageRequest.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProvidersRequest { + return QueryProvidersRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProvidersRequest { + const message = createBaseQueryProvidersRequest(); + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProvidersRequest.$type, QueryProvidersRequest); + +function createBaseQueryProvidersResponse(): QueryProvidersResponse { + return { + $type: 'akash.provider.v1beta3.QueryProvidersResponse', + providers: [], + pagination: undefined, + }; +} + +export const QueryProvidersResponse = { + $type: 'akash.provider.v1beta3.QueryProvidersResponse' as const, + + encode( + message: QueryProvidersResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.providers) { + Provider.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProvidersResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProvidersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.providers.push(Provider.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.pagination = PageResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProvidersResponse { + return { + $type: QueryProvidersResponse.$type, + providers: globalThis.Array.isArray(object?.providers) + ? object.providers.map((e: any) => Provider.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: QueryProvidersResponse): unknown { + const obj: any = {}; + if (message.providers?.length) { + obj.providers = message.providers.map((e) => Provider.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PageResponse.toJSON(message.pagination); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProvidersResponse { + const message = createBaseQueryProvidersResponse(); + message.providers = + object.providers?.map((e) => Provider.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProvidersResponse.$type, QueryProvidersResponse); + +function createBaseQueryProviderRequest(): QueryProviderRequest { + return { $type: 'akash.provider.v1beta3.QueryProviderRequest', owner: '' }; +} + +export const QueryProviderRequest = { + $type: 'akash.provider.v1beta3.QueryProviderRequest' as const, + + encode( + message: QueryProviderRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.owner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderRequest { + return { + $type: QueryProviderRequest.$type, + owner: isSet(object.owner) ? globalThis.String(object.owner) : '', + }; + }, + + toJSON(message: QueryProviderRequest): unknown { + const obj: any = {}; + if (message.owner !== '') { + obj.owner = message.owner; + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderRequest { + const message = createBaseQueryProviderRequest(); + message.owner = object.owner ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(QueryProviderRequest.$type, QueryProviderRequest); + +function createBaseQueryProviderResponse(): QueryProviderResponse { + return { + $type: 'akash.provider.v1beta3.QueryProviderResponse', + provider: undefined, + }; +} + +export const QueryProviderResponse = { + $type: 'akash.provider.v1beta3.QueryProviderResponse' as const, + + encode( + message: QueryProviderResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.provider !== undefined) { + Provider.encode(message.provider, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryProviderResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.provider = Provider.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryProviderResponse { + return { + $type: QueryProviderResponse.$type, + provider: isSet(object.provider) + ? Provider.fromJSON(object.provider) + : undefined, + }; + }, + + toJSON(message: QueryProviderResponse): unknown { + const obj: any = {}; + if (message.provider !== undefined) { + obj.provider = Provider.toJSON(message.provider); + } + return obj; + }, + + create, I>>( + base?: I, + ): QueryProviderResponse { + return QueryProviderResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QueryProviderResponse { + const message = createBaseQueryProviderResponse(); + message.provider = + object.provider !== undefined && object.provider !== null + ? Provider.fromPartial(object.provider) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryProviderResponse.$type, QueryProviderResponse); + +/** Query defines the gRPC querier service */ +export interface Query { + /** Providers queries providers */ + Providers(request: QueryProvidersRequest): Promise; + /** Provider queries provider details */ + Provider(request: QueryProviderRequest): Promise; +} + +export const QueryServiceName = 'akash.provider.v1beta3.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + this.Providers = this.Providers.bind(this); + this.Provider = this.Provider.bind(this); + } + Providers(request: QueryProvidersRequest): Promise { + const data = QueryProvidersRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Providers', data); + return promise.then((data) => + QueryProvidersResponse.decode(_m0.Reader.create(data)), + ); + } + + Provider(request: QueryProviderRequest): Promise { + const data = QueryProviderRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, 'Provider', data); + return promise.then((data) => + QueryProviderResponse.decode(_m0.Reader.create(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/staking/v1beta3/genesis.ts b/ts/src/generated/akash/staking/v1beta3/genesis.ts new file mode 100644 index 00000000..9c68912e --- /dev/null +++ b/ts/src/generated/akash/staking/v1beta3/genesis.ts @@ -0,0 +1,125 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Params } from './params'; + +export const protobufPackage = 'akash.staking.v1beta3'; + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.staking.v1beta3.GenesisState'; + params: Params | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.staking.v1beta3.GenesisState', params: undefined }; +} + +export const GenesisState = { + $type: 'akash.staking.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/staking/v1beta3/params.ts b/ts/src/generated/akash/staking/v1beta3/params.ts new file mode 100644 index 00000000..8eb8c375 --- /dev/null +++ b/ts/src/generated/akash/staking/v1beta3/params.ts @@ -0,0 +1,120 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.staking.v1beta3'; + +/** Params extends the parameters for the x/staking module */ +export interface Params { + $type: 'akash.staking.v1beta3.Params'; + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + minCommissionRate: string; +} + +function createBaseParams(): Params { + return { $type: 'akash.staking.v1beta3.Params', minCommissionRate: '' }; +} + +export const Params = { + $type: 'akash.staking.v1beta3.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.minCommissionRate !== '') { + writer.uint32(10).string(message.minCommissionRate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.minCommissionRate = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + minCommissionRate: isSet(object.minCommissionRate) + ? globalThis.String(object.minCommissionRate) + : '', + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.minCommissionRate !== '') { + obj.minCommissionRate = message.minCommissionRate; + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.minCommissionRate = object.minCommissionRate ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/take/v1beta3/genesis.ts b/ts/src/generated/akash/take/v1beta3/genesis.ts new file mode 100644 index 00000000..a09705e9 --- /dev/null +++ b/ts/src/generated/akash/take/v1beta3/genesis.ts @@ -0,0 +1,125 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; +import { Params } from './params'; + +export const protobufPackage = 'akash.take.v1beta3'; + +/** GenesisState stores slice of genesis deployment instance */ +export interface GenesisState { + $type: 'akash.take.v1beta3.GenesisState'; + params: Params | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { $type: 'akash.take.v1beta3.GenesisState', params: undefined }; +} + +export const GenesisState = { + $type: 'akash.take.v1beta3.GenesisState' as const, + + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.params = Params.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + $type: GenesisState.$type, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.params !== undefined) { + obj.params = Params.toJSON(message.params); + } + return obj; + }, + + create, I>>( + base?: I, + ): GenesisState { + return GenesisState.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GenesisState.$type, GenesisState); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/take/v1beta3/params.ts b/ts/src/generated/akash/take/v1beta3/params.ts new file mode 100644 index 00000000..d9fedca6 --- /dev/null +++ b/ts/src/generated/akash/take/v1beta3/params.ts @@ -0,0 +1,241 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'akash.take.v1beta3'; + +/** DenomTakeRate describes take rate for specified denom */ +export interface DenomTakeRate { + $type: 'akash.take.v1beta3.DenomTakeRate'; + denom: string; + rate: number; +} + +/** Params defines the parameters for the x/take package */ +export interface Params { + $type: 'akash.take.v1beta3.Params'; + /** denom -> % take rate */ + denomTakeRates: DenomTakeRate[]; + defaultTakeRate: number; +} + +function createBaseDenomTakeRate(): DenomTakeRate { + return { $type: 'akash.take.v1beta3.DenomTakeRate', denom: '', rate: 0 }; +} + +export const DenomTakeRate = { + $type: 'akash.take.v1beta3.DenomTakeRate' as const, + + encode( + message: DenomTakeRate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.rate !== 0) { + writer.uint32(16).uint32(message.rate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DenomTakeRate { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomTakeRate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.denom = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.rate = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DenomTakeRate { + return { + $type: DenomTakeRate.$type, + denom: isSet(object.denom) ? globalThis.String(object.denom) : '', + rate: isSet(object.rate) ? globalThis.Number(object.rate) : 0, + }; + }, + + toJSON(message: DenomTakeRate): unknown { + const obj: any = {}; + if (message.denom !== '') { + obj.denom = message.denom; + } + if (message.rate !== 0) { + obj.rate = Math.round(message.rate); + } + return obj; + }, + + create, I>>( + base?: I, + ): DenomTakeRate { + return DenomTakeRate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DenomTakeRate { + const message = createBaseDenomTakeRate(); + message.denom = object.denom ?? ''; + message.rate = object.rate ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(DenomTakeRate.$type, DenomTakeRate); + +function createBaseParams(): Params { + return { + $type: 'akash.take.v1beta3.Params', + denomTakeRates: [], + defaultTakeRate: 0, + }; +} + +export const Params = { + $type: 'akash.take.v1beta3.Params' as const, + + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.denomTakeRates) { + DenomTakeRate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultTakeRate !== 0) { + writer.uint32(16).uint32(message.defaultTakeRate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.denomTakeRates.push( + DenomTakeRate.decode(reader, reader.uint32()), + ); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.defaultTakeRate = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Params { + return { + $type: Params.$type, + denomTakeRates: globalThis.Array.isArray(object?.denomTakeRates) + ? object.denomTakeRates.map((e: any) => DenomTakeRate.fromJSON(e)) + : [], + defaultTakeRate: isSet(object.defaultTakeRate) + ? globalThis.Number(object.defaultTakeRate) + : 0, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.denomTakeRates?.length) { + obj.denomTakeRates = message.denomTakeRates.map((e) => + DenomTakeRate.toJSON(e), + ); + } + if (message.defaultTakeRate !== 0) { + obj.defaultTakeRate = Math.round(message.defaultTakeRate); + } + return obj; + }, + + create, I>>(base?: I): Params { + return Params.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.denomTakeRates = + object.denomTakeRates?.map((e) => DenomTakeRate.fromPartial(e)) || []; + message.defaultTakeRate = object.defaultTakeRate ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Params.$type, Params); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/akash/take/v1beta3/query.ts b/ts/src/generated/akash/take/v1beta3/query.ts new file mode 100644 index 00000000..5151ad12 --- /dev/null +++ b/ts/src/generated/akash/take/v1beta3/query.ts @@ -0,0 +1,24 @@ +/* eslint-disable */ + +export const protobufPackage = 'akash.take.v1beta3'; + +/** Query defines the gRPC querier service */ +export interface Query {} + +export const QueryServiceName = 'akash.take.v1beta3.Query'; +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || QueryServiceName; + this.rpc = rpc; + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} diff --git a/ts/src/generated/cosmos/base/query/v1beta1/pagination.ts b/ts/src/generated/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..20b15f49 --- /dev/null +++ b/ts/src/generated/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,377 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../../typeRegistry'; + +export const protobufPackage = 'cosmos.base.query.v1beta1'; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + $type: 'cosmos.base.query.v1beta1.PageRequest'; + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: Uint8Array; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: Long; + /** + * limit is the total number of results to be returned in the result page. + * If left empty it will default to a value to be set by each app. + */ + limit: Long; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + countTotal: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} + +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponse { + $type: 'cosmos.base.query.v1beta1.PageResponse'; + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + nextKey: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: Long; +} + +function createBasePageRequest(): PageRequest { + return { + $type: 'cosmos.base.query.v1beta1.PageRequest', + key: new Uint8Array(0), + offset: Long.UZERO, + limit: Long.UZERO, + countTotal: false, + reverse: false, + }; +} + +export const PageRequest = { + $type: 'cosmos.base.query.v1beta1.PageRequest' as const, + + encode( + message: PageRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (!message.offset.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.offset); + } + if (!message.limit.equals(Long.UZERO)) { + writer.uint32(24).uint64(message.limit); + } + if (message.countTotal !== false) { + writer.uint32(32).bool(message.countTotal); + } + if (message.reverse !== false) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.bytes(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.offset = reader.uint64() as Long; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.limit = reader.uint64() as Long; + continue; + case 4: + if (tag !== 32) { + break; + } + + message.countTotal = reader.bool(); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.reverse = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): PageRequest { + return { + $type: PageRequest.$type, + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0), + offset: isSet(object.offset) ? Long.fromValue(object.offset) : Long.UZERO, + limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO, + countTotal: isSet(object.countTotal) + ? globalThis.Boolean(object.countTotal) + : false, + reverse: isSet(object.reverse) + ? globalThis.Boolean(object.reverse) + : false, + }; + }, + + toJSON(message: PageRequest): unknown { + const obj: any = {}; + if (message.key.length !== 0) { + obj.key = base64FromBytes(message.key); + } + if (!message.offset.equals(Long.UZERO)) { + obj.offset = (message.offset || Long.UZERO).toString(); + } + if (!message.limit.equals(Long.UZERO)) { + obj.limit = (message.limit || Long.UZERO).toString(); + } + if (message.countTotal !== false) { + obj.countTotal = message.countTotal; + } + if (message.reverse !== false) { + obj.reverse = message.reverse; + } + return obj; + }, + + create, I>>(base?: I): PageRequest { + return PageRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(0); + message.offset = + object.offset !== undefined && object.offset !== null + ? Long.fromValue(object.offset) + : Long.UZERO; + message.limit = + object.limit !== undefined && object.limit !== null + ? Long.fromValue(object.limit) + : Long.UZERO; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +messageTypeRegistry.set(PageRequest.$type, PageRequest); + +function createBasePageResponse(): PageResponse { + return { + $type: 'cosmos.base.query.v1beta1.PageResponse', + nextKey: new Uint8Array(0), + total: Long.UZERO, + }; +} + +export const PageResponse = { + $type: 'cosmos.base.query.v1beta1.PageResponse' as const, + + encode( + message: PageResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.nextKey.length !== 0) { + writer.uint32(10).bytes(message.nextKey); + } + if (!message.total.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.nextKey = reader.bytes(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.total = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): PageResponse { + return { + $type: PageResponse.$type, + nextKey: isSet(object.nextKey) + ? bytesFromBase64(object.nextKey) + : new Uint8Array(0), + total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO, + }; + }, + + toJSON(message: PageResponse): unknown { + const obj: any = {}; + if (message.nextKey.length !== 0) { + obj.nextKey = base64FromBytes(message.nextKey); + } + if (!message.total.equals(Long.UZERO)) { + obj.total = (message.total || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>( + base?: I, + ): PageResponse { + return PageResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(0); + message.total = + object.total !== undefined && object.total !== null + ? Long.fromValue(object.total) + : Long.UZERO; + return message; + }, +}; + +messageTypeRegistry.set(PageResponse.$type, PageResponse); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/cosmos/base/v1beta1/coin.ts b/ts/src/generated/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..1a0acc7e --- /dev/null +++ b/ts/src/generated/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,378 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../typeRegistry'; + +export const protobufPackage = 'cosmos.base.v1beta1'; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + $type: 'cosmos.base.v1beta1.Coin'; + denom: string; + amount: string; +} + +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + $type: 'cosmos.base.v1beta1.DecCoin'; + denom: string; + amount: string; +} + +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + $type: 'cosmos.base.v1beta1.IntProto'; + int: string; +} + +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + $type: 'cosmos.base.v1beta1.DecProto'; + dec: string; +} + +function createBaseCoin(): Coin { + return { $type: 'cosmos.base.v1beta1.Coin', denom: '', amount: '' }; +} + +export const Coin = { + $type: 'cosmos.base.v1beta1.Coin' as const, + + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.amount !== '') { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Coin { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.denom = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.amount = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Coin { + return { + $type: Coin.$type, + denom: isSet(object.denom) ? globalThis.String(object.denom) : '', + amount: isSet(object.amount) ? globalThis.String(object.amount) : '', + }; + }, + + toJSON(message: Coin): unknown { + const obj: any = {}; + if (message.denom !== '') { + obj.denom = message.denom; + } + if (message.amount !== '') { + obj.amount = message.amount; + } + return obj; + }, + + create, I>>(base?: I): Coin { + return Coin.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ''; + message.amount = object.amount ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Coin.$type, Coin); + +function createBaseDecCoin(): DecCoin { + return { $type: 'cosmos.base.v1beta1.DecCoin', denom: '', amount: '' }; +} + +export const DecCoin = { + $type: 'cosmos.base.v1beta1.DecCoin' as const, + + encode( + message: DecCoin, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.amount !== '') { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.denom = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.amount = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DecCoin { + return { + $type: DecCoin.$type, + denom: isSet(object.denom) ? globalThis.String(object.denom) : '', + amount: isSet(object.amount) ? globalThis.String(object.amount) : '', + }; + }, + + toJSON(message: DecCoin): unknown { + const obj: any = {}; + if (message.denom !== '') { + obj.denom = message.denom; + } + if (message.amount !== '') { + obj.amount = message.amount; + } + return obj; + }, + + create, I>>(base?: I): DecCoin { + return DecCoin.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ''; + message.amount = object.amount ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(DecCoin.$type, DecCoin); + +function createBaseIntProto(): IntProto { + return { $type: 'cosmos.base.v1beta1.IntProto', int: '' }; +} + +export const IntProto = { + $type: 'cosmos.base.v1beta1.IntProto' as const, + + encode( + message: IntProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.int !== '') { + writer.uint32(10).string(message.int); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IntProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.int = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): IntProto { + return { + $type: IntProto.$type, + int: isSet(object.int) ? globalThis.String(object.int) : '', + }; + }, + + toJSON(message: IntProto): unknown { + const obj: any = {}; + if (message.int !== '') { + obj.int = message.int; + } + return obj; + }, + + create, I>>(base?: I): IntProto { + return IntProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(IntProto.$type, IntProto); + +function createBaseDecProto(): DecProto { + return { $type: 'cosmos.base.v1beta1.DecProto', dec: '' }; +} + +export const DecProto = { + $type: 'cosmos.base.v1beta1.DecProto' as const, + + encode( + message: DecProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.dec !== '') { + writer.uint32(10).string(message.dec); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DecProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.dec = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DecProto { + return { + $type: DecProto.$type, + dec: isSet(object.dec) ? globalThis.String(object.dec) : '', + }; + }, + + toJSON(message: DecProto): unknown { + const obj: any = {}; + if (message.dec !== '') { + obj.dec = message.dec; + } + return obj; + }, + + create, I>>(base?: I): DecProto { + return DecProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(DecProto.$type, DecProto); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/cosmos_proto/cosmos.ts b/ts/src/generated/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..ad518378 --- /dev/null +++ b/ts/src/generated/cosmos_proto/cosmos.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = 'cosmos_proto'; diff --git a/ts/src/generated/gogoproto/gogo.ts b/ts/src/generated/gogoproto/gogo.ts new file mode 100644 index 00000000..e5086381 --- /dev/null +++ b/ts/src/generated/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = 'gogoproto'; diff --git a/ts/src/generated/google/api/annotations.ts b/ts/src/generated/google/api/annotations.ts new file mode 100644 index 00000000..82128510 --- /dev/null +++ b/ts/src/generated/google/api/annotations.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = 'google.api'; diff --git a/ts/src/generated/google/api/http.ts b/ts/src/generated/google/api/http.ts new file mode 100644 index 00000000..591aed1e --- /dev/null +++ b/ts/src/generated/google/api/http.ts @@ -0,0 +1,746 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../typeRegistry'; + +export const protobufPackage = 'google.api'; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + $type: 'google.api.Http'; + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} + +/** + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. + * + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } + * + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. + * + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. + * + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. + * + * For HTTP method kinds which allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice of + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * + * # Rules for HTTP mapping + * + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: + * + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. + * + * The syntax of the path template is as follows: + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ +export interface HttpRule { + $type: 'google.api.HttpRule'; + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** Used for listing and getting information about resources. */ + get?: string | undefined; + /** Used for updating a resource. */ + put?: string | undefined; + /** Used for creating a resource. */ + post?: string | undefined; + /** Used for deleting a resource. */ + delete?: string | undefined; + /** Used for updating a resource. */ + patch?: string | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPattern | undefined; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + $type: 'google.api.CustomHttpPattern'; + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +function createBaseHttp(): Http { + return { + $type: 'google.api.Http', + rules: [], + fullyDecodeReservedExpansion: false, + }; +} + +export const Http = { + $type: 'google.api.Http' as const, + + encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion !== false) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Http { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.rules.push(HttpRule.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.fullyDecodeReservedExpansion = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Http { + return { + $type: Http.$type, + rules: globalThis.Array.isArray(object?.rules) + ? object.rules.map((e: any) => HttpRule.fromJSON(e)) + : [], + fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion) + ? globalThis.Boolean(object.fullyDecodeReservedExpansion) + : false, + }; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules?.length) { + obj.rules = message.rules.map((e) => HttpRule.toJSON(e)); + } + if (message.fullyDecodeReservedExpansion !== false) { + obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + } + return obj; + }, + + create, I>>(base?: I): Http { + return Http.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = + object.fullyDecodeReservedExpansion ?? false; + return message; + }, +}; + +messageTypeRegistry.set(Http.$type, Http); + +function createBaseHttpRule(): HttpRule { + return { + $type: 'google.api.HttpRule', + selector: '', + get: undefined, + put: undefined, + post: undefined, + delete: undefined, + patch: undefined, + custom: undefined, + body: '', + responseBody: '', + additionalBindings: [], + }; +} + +export const HttpRule = { + $type: 'google.api.HttpRule' as const, + + encode( + message: HttpRule, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.selector !== '') { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode( + message.custom, + writer.uint32(66).fork(), + ).ldelim(); + } + if (message.body !== '') { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== '') { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.selector = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.get = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.put = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.post = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.delete = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.patch = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.body = reader.string(); + continue; + case 12: + if (tag !== 98) { + break; + } + + message.responseBody = reader.string(); + continue; + case 11: + if (tag !== 90) { + break; + } + + message.additionalBindings.push( + HttpRule.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpRule { + return { + $type: HttpRule.$type, + selector: isSet(object.selector) + ? globalThis.String(object.selector) + : '', + get: isSet(object.get) ? globalThis.String(object.get) : undefined, + put: isSet(object.put) ? globalThis.String(object.put) : undefined, + post: isSet(object.post) ? globalThis.String(object.post) : undefined, + delete: isSet(object.delete) + ? globalThis.String(object.delete) + : undefined, + patch: isSet(object.patch) ? globalThis.String(object.patch) : undefined, + custom: isSet(object.custom) + ? CustomHttpPattern.fromJSON(object.custom) + : undefined, + body: isSet(object.body) ? globalThis.String(object.body) : '', + responseBody: isSet(object.responseBody) + ? globalThis.String(object.responseBody) + : '', + additionalBindings: globalThis.Array.isArray(object?.additionalBindings) + ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e)) + : [], + }; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + if (message.selector !== '') { + obj.selector = message.selector; + } + if (message.get !== undefined) { + obj.get = message.get; + } + if (message.put !== undefined) { + obj.put = message.put; + } + if (message.post !== undefined) { + obj.post = message.post; + } + if (message.delete !== undefined) { + obj.delete = message.delete; + } + if (message.patch !== undefined) { + obj.patch = message.patch; + } + if (message.custom !== undefined) { + obj.custom = CustomHttpPattern.toJSON(message.custom); + } + if (message.body !== '') { + obj.body = message.body; + } + if (message.responseBody !== '') { + obj.responseBody = message.responseBody; + } + if (message.additionalBindings?.length) { + obj.additionalBindings = message.additionalBindings.map((e) => + HttpRule.toJSON(e), + ); + } + return obj; + }, + + create, I>>(base?: I): HttpRule { + return HttpRule.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ''; + message.get = object.get ?? undefined; + message.put = object.put ?? undefined; + message.post = object.post ?? undefined; + message.delete = object.delete ?? undefined; + message.patch = object.patch ?? undefined; + message.custom = + object.custom !== undefined && object.custom !== null + ? CustomHttpPattern.fromPartial(object.custom) + : undefined; + message.body = object.body ?? ''; + message.responseBody = object.responseBody ?? ''; + message.additionalBindings = + object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(HttpRule.$type, HttpRule); + +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { $type: 'google.api.CustomHttpPattern', kind: '', path: '' }; +} + +export const CustomHttpPattern = { + $type: 'google.api.CustomHttpPattern' as const, + + encode( + message: CustomHttpPattern, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.kind !== '') { + writer.uint32(10).string(message.kind); + } + if (message.path !== '') { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.kind = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.path = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + return { + $type: CustomHttpPattern.$type, + kind: isSet(object.kind) ? globalThis.String(object.kind) : '', + path: isSet(object.path) ? globalThis.String(object.path) : '', + }; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + if (message.kind !== '') { + obj.kind = message.kind; + } + if (message.path !== '') { + obj.path = message.path; + } + return obj; + }, + + create, I>>( + base?: I, + ): CustomHttpPattern { + return CustomHttpPattern.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ''; + message.path = object.path ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(CustomHttpPattern.$type, CustomHttpPattern); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/google/protobuf/descriptor.ts b/ts/src/generated/google/protobuf/descriptor.ts new file mode 100644 index 00000000..68825d8e --- /dev/null +++ b/ts/src/generated/google/protobuf/descriptor.ts @@ -0,0 +1,5544 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../typeRegistry'; + +export const protobufPackage = 'google.protobuf'; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + $type: 'google.protobuf.FileDescriptorSet'; + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + $type: 'google.protobuf.FileDescriptorProto'; + /** file name, relative to root of source tree */ + name?: string | undefined; + /** e.g. "foo", "foo.bar", etc. */ + package?: string | undefined; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax?: string | undefined; +} + +/** Describes a message type. */ +export interface DescriptorProto { + $type: 'google.protobuf.DescriptorProto'; + name?: string | undefined; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions | undefined; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} + +export interface DescriptorProto_ExtensionRange { + $type: 'google.protobuf.DescriptorProto.ExtensionRange'; + /** Inclusive. */ + start?: number | undefined; + /** Exclusive. */ + end?: number | undefined; + options?: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + $type: 'google.protobuf.DescriptorProto.ReservedRange'; + /** Inclusive. */ + start?: number | undefined; + /** Exclusive. */ + end?: number | undefined; +} + +export interface ExtensionRangeOptions { + $type: 'google.protobuf.ExtensionRangeOptions'; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + $type: 'google.protobuf.FieldDescriptorProto'; + name?: string | undefined; + number?: number | undefined; + label?: FieldDescriptorProto_Label | undefined; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type?: FieldDescriptorProto_Type | undefined; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName?: string | undefined; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee?: string | undefined; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + */ + defaultValue?: string | undefined; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex?: number | undefined; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName?: string | undefined; + options?: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional?: boolean | undefined; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON( + object: any, +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case 'TYPE_DOUBLE': + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case 'TYPE_FLOAT': + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case 'TYPE_INT64': + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case 'TYPE_UINT64': + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case 'TYPE_INT32': + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case 'TYPE_FIXED64': + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case 'TYPE_FIXED32': + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case 'TYPE_BOOL': + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case 'TYPE_STRING': + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case 'TYPE_GROUP': + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case 'TYPE_MESSAGE': + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case 'TYPE_BYTES': + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case 'TYPE_UINT32': + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case 'TYPE_ENUM': + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case 'TYPE_SFIXED32': + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case 'TYPE_SFIXED64': + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case 'TYPE_SINT32': + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case 'TYPE_SINT64': + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case 'UNRECOGNIZED': + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type, +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return 'TYPE_DOUBLE'; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return 'TYPE_FLOAT'; + case FieldDescriptorProto_Type.TYPE_INT64: + return 'TYPE_INT64'; + case FieldDescriptorProto_Type.TYPE_UINT64: + return 'TYPE_UINT64'; + case FieldDescriptorProto_Type.TYPE_INT32: + return 'TYPE_INT32'; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return 'TYPE_FIXED64'; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return 'TYPE_FIXED32'; + case FieldDescriptorProto_Type.TYPE_BOOL: + return 'TYPE_BOOL'; + case FieldDescriptorProto_Type.TYPE_STRING: + return 'TYPE_STRING'; + case FieldDescriptorProto_Type.TYPE_GROUP: + return 'TYPE_GROUP'; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return 'TYPE_MESSAGE'; + case FieldDescriptorProto_Type.TYPE_BYTES: + return 'TYPE_BYTES'; + case FieldDescriptorProto_Type.TYPE_UINT32: + return 'TYPE_UINT32'; + case FieldDescriptorProto_Type.TYPE_ENUM: + return 'TYPE_ENUM'; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return 'TYPE_SFIXED32'; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return 'TYPE_SFIXED64'; + case FieldDescriptorProto_Type.TYPE_SINT32: + return 'TYPE_SINT32'; + case FieldDescriptorProto_Type.TYPE_SINT64: + return 'TYPE_SINT64'; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON( + object: any, +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case 'LABEL_OPTIONAL': + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case 'LABEL_REQUIRED': + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case 'LABEL_REPEATED': + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case 'UNRECOGNIZED': + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label, +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return 'LABEL_OPTIONAL'; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return 'LABEL_REQUIRED'; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return 'LABEL_REPEATED'; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + $type: 'google.protobuf.OneofDescriptorProto'; + name?: string | undefined; + options?: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + $type: 'google.protobuf.EnumDescriptorProto'; + name?: string | undefined; + value: EnumValueDescriptorProto[]; + options?: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + $type: 'google.protobuf.EnumDescriptorProto.EnumReservedRange'; + /** Inclusive. */ + start?: number | undefined; + /** Inclusive. */ + end?: number | undefined; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + $type: 'google.protobuf.EnumValueDescriptorProto'; + name?: string | undefined; + number?: number | undefined; + options?: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + $type: 'google.protobuf.ServiceDescriptorProto'; + name?: string | undefined; + method: MethodDescriptorProto[]; + options?: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + $type: 'google.protobuf.MethodDescriptorProto'; + name?: string | undefined; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType?: string | undefined; + outputType?: string | undefined; + options?: MethodOptions | undefined; + /** Identifies if client streams multiple client messages */ + clientStreaming?: boolean | undefined; + /** Identifies if server streams multiple server messages */ + serverStreaming?: boolean | undefined; +} + +export interface FileOptions { + $type: 'google.protobuf.FileOptions'; + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage?: string | undefined; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + javaOuterClassname?: string | undefined; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles?: boolean | undefined; + /** + * This option does nothing. + * + * @deprecated + */ + javaGenerateEqualsAndHash?: boolean | undefined; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8?: boolean | undefined; + optimizeFor?: FileOptions_OptimizeMode | undefined; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage?: string | undefined; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices?: boolean | undefined; + javaGenericServices?: boolean | undefined; + pyGenericServices?: boolean | undefined; + phpGenericServices?: boolean | undefined; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated?: boolean | undefined; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas?: boolean | undefined; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix?: string | undefined; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace?: string | undefined; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix?: string | undefined; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix?: string | undefined; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace?: string | undefined; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace?: string | undefined; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage?: string | undefined; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON( + object: any, +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case 'SPEED': + return FileOptions_OptimizeMode.SPEED; + case 2: + case 'CODE_SIZE': + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case 'LITE_RUNTIME': + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case 'UNRECOGNIZED': + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode, +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return 'SPEED'; + case FileOptions_OptimizeMode.CODE_SIZE: + return 'CODE_SIZE'; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return 'LITE_RUNTIME'; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +export interface MessageOptions { + $type: 'google.protobuf.MessageOptions'; + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat?: boolean | undefined; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor?: boolean | undefined; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated?: boolean | undefined; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry?: boolean | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface FieldOptions { + $type: 'google.protobuf.FieldOptions'; + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype?: FieldOptions_CType | undefined; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed?: boolean | undefined; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype?: FieldOptions_JSType | undefined; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * + * As of 2021, lazy does no correctness checks on the byte stream during + * parsing. This may lead to crashes if and when an invalid byte stream is + * finally parsed upon access. + * + * TODO(b/211906113): Enable validation on lazy fields. + */ + lazy?: boolean | undefined; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverifiedLazy?: boolean | undefined; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated?: boolean | undefined; + /** For Google-internal migration only. Do not use. */ + weak?: boolean | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case 'STRING': + return FieldOptions_CType.STRING; + case 1: + case 'CORD': + return FieldOptions_CType.CORD; + case 2: + case 'STRING_PIECE': + return FieldOptions_CType.STRING_PIECE; + case -1: + case 'UNRECOGNIZED': + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return 'STRING'; + case FieldOptions_CType.CORD: + return 'CORD'; + case FieldOptions_CType.STRING_PIECE: + return 'STRING_PIECE'; + case FieldOptions_CType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case 'JS_NORMAL': + return FieldOptions_JSType.JS_NORMAL; + case 1: + case 'JS_STRING': + return FieldOptions_JSType.JS_STRING; + case 2: + case 'JS_NUMBER': + return FieldOptions_JSType.JS_NUMBER; + case -1: + case 'UNRECOGNIZED': + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return 'JS_NORMAL'; + case FieldOptions_JSType.JS_STRING: + return 'JS_STRING'; + case FieldOptions_JSType.JS_NUMBER: + return 'JS_NUMBER'; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +export interface OneofOptions { + $type: 'google.protobuf.OneofOptions'; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumOptions { + $type: 'google.protobuf.EnumOptions'; + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias?: boolean | undefined; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated?: boolean | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumValueOptions { + $type: 'google.protobuf.EnumValueOptions'; + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated?: boolean | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface ServiceOptions { + $type: 'google.protobuf.ServiceOptions'; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated?: boolean | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MethodOptions { + $type: 'google.protobuf.MethodOptions'; + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated?: boolean | undefined; + idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON( + object: any, +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case 'IDEMPOTENCY_UNKNOWN': + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case 'NO_SIDE_EFFECTS': + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case 'IDEMPOTENT': + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case 'UNRECOGNIZED': + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel, +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return 'IDEMPOTENCY_UNKNOWN'; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return 'NO_SIDE_EFFECTS'; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return 'IDEMPOTENT'; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + $type: 'google.protobuf.UninterpretedOption'; + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue?: string | undefined; + positiveIntValue?: Long | undefined; + negativeIntValue?: Long | undefined; + doubleValue?: number | undefined; + stringValue?: Uint8Array | undefined; + aggregateValue?: string | undefined; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + */ +export interface UninterpretedOption_NamePart { + $type: 'google.protobuf.UninterpretedOption.NamePart'; + namePart: string; + isExtension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + $type: 'google.protobuf.SourceCodeInfo'; + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + $type: 'google.protobuf.SourceCodeInfo.Location'; + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments?: string | undefined; + trailingComments?: string | undefined; + leadingDetachedComments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + $type: 'google.protobuf.GeneratedCodeInfo'; + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + $type: 'google.protobuf.GeneratedCodeInfo.Annotation'; + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile?: string | undefined; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin?: number | undefined; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end?: number | undefined; +} + +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { $type: 'google.protobuf.FileDescriptorSet', file: [] }; +} + +export const FileDescriptorSet = { + $type: 'google.protobuf.FileDescriptorSet' as const, + + encode( + message: FileDescriptorSet, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + return { + $type: FileDescriptorSet.$type, + file: globalThis.Array.isArray(object?.file) + ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file?.length) { + obj.file = message.file.map((e) => FileDescriptorProto.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): FileDescriptorSet { + return FileDescriptorSet.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = + object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(FileDescriptorSet.$type, FileDescriptorSet); + +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + $type: 'google.protobuf.FileDescriptorProto', + name: '', + package: '', + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: '', + }; +} + +export const FileDescriptorProto = { + $type: 'google.protobuf.FileDescriptorProto' as const, + + encode( + message: FileDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.package !== undefined && message.package !== '') { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode( + message.sourceCodeInfo, + writer.uint32(74).fork(), + ).ldelim(); + } + if (message.syntax !== undefined && message.syntax !== '') { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.package = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.dependency.push(reader.string()); + continue; + case 10: + if (tag === 80) { + message.publicDependency.push(reader.int32()); + + continue; + } + + if (tag === 82) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + + continue; + } + + break; + case 11: + if (tag === 88) { + message.weakDependency.push(reader.int32()); + + continue; + } + + if (tag === 90) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + + continue; + } + + break; + case 4: + if (tag !== 34) { + break; + } + + message.messageType.push( + DescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.enumType.push( + EnumDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.options = FileOptions.decode(reader, reader.uint32()); + continue; + case 9: + if (tag !== 74) { + break; + } + + message.sourceCodeInfo = SourceCodeInfo.decode( + reader, + reader.uint32(), + ); + continue; + case 12: + if (tag !== 98) { + break; + } + + message.syntax = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + return { + $type: FileDescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + package: isSet(object.package) ? globalThis.String(object.package) : '', + dependency: globalThis.Array.isArray(object?.dependency) + ? object.dependency.map((e: any) => globalThis.String(e)) + : [], + publicDependency: globalThis.Array.isArray(object?.publicDependency) + ? object.publicDependency.map((e: any) => globalThis.Number(e)) + : [], + weakDependency: globalThis.Array.isArray(object?.weakDependency) + ? object.weakDependency.map((e: any) => globalThis.Number(e)) + : [], + messageType: globalThis.Array.isArray(object?.messageType) + ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: globalThis.Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + service: globalThis.Array.isArray(object?.service) + ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) + : [], + extension: globalThis.Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? FileOptions.fromJSON(object.options) + : undefined, + sourceCodeInfo: isSet(object.sourceCodeInfo) + ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) + : undefined, + syntax: isSet(object.syntax) ? globalThis.String(object.syntax) : '', + }; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.package !== undefined && message.package !== '') { + obj.package = message.package; + } + if (message.dependency?.length) { + obj.dependency = message.dependency; + } + if (message.publicDependency?.length) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); + } + if (message.weakDependency?.length) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); + } + if (message.messageType?.length) { + obj.messageType = message.messageType.map((e) => + DescriptorProto.toJSON(e), + ); + } + if (message.enumType?.length) { + obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + } + if (message.service?.length) { + obj.service = message.service.map((e) => + ServiceDescriptorProto.toJSON(e), + ); + } + if (message.extension?.length) { + obj.extension = message.extension.map((e) => + FieldDescriptorProto.toJSON(e), + ); + } + if (message.options !== undefined) { + obj.options = FileOptions.toJSON(message.options); + } + if (message.sourceCodeInfo !== undefined) { + obj.sourceCodeInfo = SourceCodeInfo.toJSON(message.sourceCodeInfo); + } + if (message.syntax !== undefined && message.syntax !== '') { + obj.syntax = message.syntax; + } + return obj; + }, + + create, I>>( + base?: I, + ): FileDescriptorProto { + return FileDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ''; + message.package = object.package ?? ''; + message.dependency = object.dependency?.map((e) => e) || []; + message.publicDependency = object.publicDependency?.map((e) => e) || []; + message.weakDependency = object.weakDependency?.map((e) => e) || []; + message.messageType = + object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.service = + object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? FileOptions.fromPartial(object.options) + : undefined; + message.sourceCodeInfo = + object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null + ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) + : undefined; + message.syntax = object.syntax ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(FileDescriptorProto.$type, FileDescriptorProto); + +function createBaseDescriptorProto(): DescriptorProto { + return { + $type: 'google.protobuf.DescriptorProto', + name: '', + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} + +export const DescriptorProto = { + $type: 'google.protobuf.DescriptorProto' as const, + + encode( + message: DescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork(), + ).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork(), + ).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.nestedType.push( + DescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.enumType.push( + EnumDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.extensionRange.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()), + ); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.oneofDecl.push( + OneofDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.options = MessageOptions.decode(reader, reader.uint32()); + continue; + case 9: + if (tag !== 74) { + break; + } + + message.reservedRange.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()), + ); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + return { + $type: DescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + field: globalThis.Array.isArray(object?.field) + ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + extension: globalThis.Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + nestedType: globalThis.Array.isArray(object?.nestedType) + ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: globalThis.Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + extensionRange: globalThis.Array.isArray(object?.extensionRange) + ? object.extensionRange.map((e: any) => + DescriptorProto_ExtensionRange.fromJSON(e), + ) + : [], + oneofDecl: globalThis.Array.isArray(object?.oneofDecl) + ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? MessageOptions.fromJSON(object.options) + : undefined, + reservedRange: globalThis.Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => + DescriptorProto_ReservedRange.fromJSON(e), + ) + : [], + reservedName: globalThis.Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.field?.length) { + obj.field = message.field.map((e) => FieldDescriptorProto.toJSON(e)); + } + if (message.extension?.length) { + obj.extension = message.extension.map((e) => + FieldDescriptorProto.toJSON(e), + ); + } + if (message.nestedType?.length) { + obj.nestedType = message.nestedType.map((e) => DescriptorProto.toJSON(e)); + } + if (message.enumType?.length) { + obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + } + if (message.extensionRange?.length) { + obj.extensionRange = message.extensionRange.map((e) => + DescriptorProto_ExtensionRange.toJSON(e), + ); + } + if (message.oneofDecl?.length) { + obj.oneofDecl = message.oneofDecl.map((e) => + OneofDescriptorProto.toJSON(e), + ); + } + if (message.options !== undefined) { + obj.options = MessageOptions.toJSON(message.options); + } + if (message.reservedRange?.length) { + obj.reservedRange = message.reservedRange.map((e) => + DescriptorProto_ReservedRange.toJSON(e), + ); + } + if (message.reservedName?.length) { + obj.reservedName = message.reservedName; + } + return obj; + }, + + create, I>>( + base?: I, + ): DescriptorProto { + return DescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ''; + message.field = + object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = + object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = + object.extensionRange?.map((e) => + DescriptorProto_ExtensionRange.fromPartial(e), + ) || []; + message.oneofDecl = + object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? MessageOptions.fromPartial(object.options) + : undefined; + message.reservedRange = + object.reservedRange?.map((e) => + DescriptorProto_ReservedRange.fromPartial(e), + ) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(DescriptorProto.$type, DescriptorProto); + +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { + $type: 'google.protobuf.DescriptorProto.ExtensionRange', + start: 0, + end: 0, + options: undefined, + }; +} + +export const DescriptorProto_ExtensionRange = { + $type: 'google.protobuf.DescriptorProto.ExtensionRange' as const, + + encode( + message: DescriptorProto_ExtensionRange, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): DescriptorProto_ExtensionRange { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32(), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + return { + $type: DescriptorProto_ExtensionRange.$type, + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + options: isSet(object.options) + ? ExtensionRangeOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + if (message.options !== undefined) { + obj.options = ExtensionRangeOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>( + base?: I, + ): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = + object.options !== undefined && object.options !== null + ? ExtensionRangeOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + DescriptorProto_ExtensionRange.$type, + DescriptorProto_ExtensionRange, +); + +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { + $type: 'google.protobuf.DescriptorProto.ReservedRange', + start: 0, + end: 0, + }; +} + +export const DescriptorProto_ReservedRange = { + $type: 'google.protobuf.DescriptorProto.ReservedRange' as const, + + encode( + message: DescriptorProto_ReservedRange, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): DescriptorProto_ReservedRange { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + return { + $type: DescriptorProto_ReservedRange.$type, + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + }; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + return obj; + }, + + create, I>>( + base?: I, + ): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + DescriptorProto_ReservedRange.$type, + DescriptorProto_ReservedRange, +); + +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { + $type: 'google.protobuf.ExtensionRangeOptions', + uninterpretedOption: [], + }; +} + +export const ExtensionRangeOptions = { + $type: 'google.protobuf.ExtensionRangeOptions' as const, + + encode( + message: ExtensionRangeOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ExtensionRangeOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + return { + $type: ExtensionRangeOptions.$type, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): ExtensionRangeOptions { + return ExtensionRangeOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(ExtensionRangeOptions.$type, ExtensionRangeOptions); + +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + $type: 'google.protobuf.FieldDescriptorProto', + name: '', + number: 0, + label: 1, + type: 1, + typeName: '', + extendee: '', + defaultValue: '', + oneofIndex: 0, + jsonName: '', + options: undefined, + proto3Optional: false, + }; +} + +export const FieldDescriptorProto = { + $type: 'google.protobuf.FieldDescriptorProto' as const, + + encode( + message: FieldDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.number !== undefined && message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== undefined && message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== undefined && message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== undefined && message.typeName !== '') { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== undefined && message.extendee !== '') { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== undefined && message.defaultValue !== '') { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== undefined && message.jsonName !== '') { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if ( + message.proto3Optional !== undefined && + message.proto3Optional !== false + ) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): FieldDescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.number = reader.int32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.label = reader.int32() as any; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.type = reader.int32() as any; + continue; + case 6: + if (tag !== 50) { + break; + } + + message.typeName = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.extendee = reader.string(); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.defaultValue = reader.string(); + continue; + case 9: + if (tag !== 72) { + break; + } + + message.oneofIndex = reader.int32(); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.jsonName = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.options = FieldOptions.decode(reader, reader.uint32()); + continue; + case 17: + if (tag !== 136) { + break; + } + + message.proto3Optional = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + return { + $type: FieldDescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + label: isSet(object.label) + ? fieldDescriptorProto_LabelFromJSON(object.label) + : 1, + type: isSet(object.type) + ? fieldDescriptorProto_TypeFromJSON(object.type) + : 1, + typeName: isSet(object.typeName) + ? globalThis.String(object.typeName) + : '', + extendee: isSet(object.extendee) + ? globalThis.String(object.extendee) + : '', + defaultValue: isSet(object.defaultValue) + ? globalThis.String(object.defaultValue) + : '', + oneofIndex: isSet(object.oneofIndex) + ? globalThis.Number(object.oneofIndex) + : 0, + jsonName: isSet(object.jsonName) + ? globalThis.String(object.jsonName) + : '', + options: isSet(object.options) + ? FieldOptions.fromJSON(object.options) + : undefined, + proto3Optional: isSet(object.proto3Optional) + ? globalThis.Boolean(object.proto3Optional) + : false, + }; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.label !== undefined && message.label !== 1) { + obj.label = fieldDescriptorProto_LabelToJSON(message.label); + } + if (message.type !== undefined && message.type !== 1) { + obj.type = fieldDescriptorProto_TypeToJSON(message.type); + } + if (message.typeName !== undefined && message.typeName !== '') { + obj.typeName = message.typeName; + } + if (message.extendee !== undefined && message.extendee !== '') { + obj.extendee = message.extendee; + } + if (message.defaultValue !== undefined && message.defaultValue !== '') { + obj.defaultValue = message.defaultValue; + } + if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { + obj.oneofIndex = Math.round(message.oneofIndex); + } + if (message.jsonName !== undefined && message.jsonName !== '') { + obj.jsonName = message.jsonName; + } + if (message.options !== undefined) { + obj.options = FieldOptions.toJSON(message.options); + } + if ( + message.proto3Optional !== undefined && + message.proto3Optional !== false + ) { + obj.proto3Optional = message.proto3Optional; + } + return obj; + }, + + create, I>>( + base?: I, + ): FieldDescriptorProto { + return FieldDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ''; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ''; + message.extendee = object.extendee ?? ''; + message.defaultValue = object.defaultValue ?? ''; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ''; + message.options = + object.options !== undefined && object.options !== null + ? FieldOptions.fromPartial(object.options) + : undefined; + message.proto3Optional = object.proto3Optional ?? false; + return message; + }, +}; + +messageTypeRegistry.set(FieldDescriptorProto.$type, FieldDescriptorProto); + +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { + $type: 'google.protobuf.OneofDescriptorProto', + name: '', + options: undefined, + }; +} + +export const OneofDescriptorProto = { + $type: 'google.protobuf.OneofDescriptorProto' as const, + + encode( + message: OneofDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): OneofDescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.options = OneofOptions.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + return { + $type: OneofDescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + options: isSet(object.options) + ? OneofOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.options !== undefined) { + obj.options = OneofOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>( + base?: I, + ): OneofDescriptorProto { + return OneofDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ''; + message.options = + object.options !== undefined && object.options !== null + ? OneofOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(OneofDescriptorProto.$type, OneofDescriptorProto); + +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { + $type: 'google.protobuf.EnumDescriptorProto', + name: '', + value: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} + +export const EnumDescriptorProto = { + $type: 'google.protobuf.EnumDescriptorProto' as const, + + encode( + message: EnumDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork(), + ).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = EnumOptions.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.reservedRange.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32(), + ), + ); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + return { + $type: EnumDescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + value: globalThis.Array.isArray(object?.value) + ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? EnumOptions.fromJSON(object.options) + : undefined, + reservedRange: globalThis.Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => + EnumDescriptorProto_EnumReservedRange.fromJSON(e), + ) + : [], + reservedName: globalThis.Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.value?.length) { + obj.value = message.value.map((e) => EnumValueDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = EnumOptions.toJSON(message.options); + } + if (message.reservedRange?.length) { + obj.reservedRange = message.reservedRange.map((e) => + EnumDescriptorProto_EnumReservedRange.toJSON(e), + ); + } + if (message.reservedName?.length) { + obj.reservedName = message.reservedName; + } + return obj; + }, + + create, I>>( + base?: I, + ): EnumDescriptorProto { + return EnumDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ''; + message.value = + object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? EnumOptions.fromPartial(object.options) + : undefined; + message.reservedRange = + object.reservedRange?.map((e) => + EnumDescriptorProto_EnumReservedRange.fromPartial(e), + ) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(EnumDescriptorProto.$type, EnumDescriptorProto); + +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { + $type: 'google.protobuf.EnumDescriptorProto.EnumReservedRange', + start: 0, + end: 0, + }; +} + +export const EnumDescriptorProto_EnumReservedRange = { + $type: 'google.protobuf.EnumDescriptorProto.EnumReservedRange' as const, + + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): EnumDescriptorProto_EnumReservedRange { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + return { + $type: EnumDescriptorProto_EnumReservedRange.$type, + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + }; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + return obj; + }, + + create< + I extends Exact, I>, + >(base?: I): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromPartial( + base ?? ({} as any), + ); + }, + fromPartial< + I extends Exact, I>, + >(object: I): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + EnumDescriptorProto_EnumReservedRange.$type, + EnumDescriptorProto_EnumReservedRange, +); + +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { + $type: 'google.protobuf.EnumValueDescriptorProto', + name: '', + number: 0, + options: undefined, + }; +} + +export const EnumValueDescriptorProto = { + $type: 'google.protobuf.EnumValueDescriptorProto' as const, + + encode( + message: EnumValueDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.number !== undefined && message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): EnumValueDescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.number = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = EnumValueOptions.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + return { + $type: EnumValueDescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + options: isSet(object.options) + ? EnumValueOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.options !== undefined) { + obj.options = EnumValueOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>( + base?: I, + ): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ''; + message.number = object.number ?? 0; + message.options = + object.options !== undefined && object.options !== null + ? EnumValueOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + EnumValueDescriptorProto.$type, + EnumValueDescriptorProto, +); + +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { + $type: 'google.protobuf.ServiceDescriptorProto', + name: '', + method: [], + options: undefined, + }; +} + +export const ServiceDescriptorProto = { + $type: 'google.protobuf.ServiceDescriptorProto' as const, + + encode( + message: ServiceDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ServiceDescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()), + ); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = ServiceOptions.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + return { + $type: ServiceDescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + method: globalThis.Array.isArray(object?.method) + ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? ServiceOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.method?.length) { + obj.method = message.method.map((e) => MethodDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = ServiceOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceDescriptorProto { + return ServiceDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ''; + message.method = + object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? ServiceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ServiceDescriptorProto.$type, ServiceDescriptorProto); + +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + $type: 'google.protobuf.MethodDescriptorProto', + name: '', + inputType: '', + outputType: '', + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} + +export const MethodDescriptorProto = { + $type: 'google.protobuf.MethodDescriptorProto' as const, + + encode( + message: MethodDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.name !== undefined && message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.inputType !== undefined && message.inputType !== '') { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== undefined && message.outputType !== '') { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if ( + message.clientStreaming !== undefined && + message.clientStreaming !== false + ) { + writer.uint32(40).bool(message.clientStreaming); + } + if ( + message.serverStreaming !== undefined && + message.serverStreaming !== false + ) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MethodDescriptorProto { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.inputType = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.outputType = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.options = MethodOptions.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.clientStreaming = reader.bool(); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.serverStreaming = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + return { + $type: MethodDescriptorProto.$type, + name: isSet(object.name) ? globalThis.String(object.name) : '', + inputType: isSet(object.inputType) + ? globalThis.String(object.inputType) + : '', + outputType: isSet(object.outputType) + ? globalThis.String(object.outputType) + : '', + options: isSet(object.options) + ? MethodOptions.fromJSON(object.options) + : undefined, + clientStreaming: isSet(object.clientStreaming) + ? globalThis.Boolean(object.clientStreaming) + : false, + serverStreaming: isSet(object.serverStreaming) + ? globalThis.Boolean(object.serverStreaming) + : false, + }; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== '') { + obj.name = message.name; + } + if (message.inputType !== undefined && message.inputType !== '') { + obj.inputType = message.inputType; + } + if (message.outputType !== undefined && message.outputType !== '') { + obj.outputType = message.outputType; + } + if (message.options !== undefined) { + obj.options = MethodOptions.toJSON(message.options); + } + if ( + message.clientStreaming !== undefined && + message.clientStreaming !== false + ) { + obj.clientStreaming = message.clientStreaming; + } + if ( + message.serverStreaming !== undefined && + message.serverStreaming !== false + ) { + obj.serverStreaming = message.serverStreaming; + } + return obj; + }, + + create, I>>( + base?: I, + ): MethodDescriptorProto { + return MethodDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ''; + message.inputType = object.inputType ?? ''; + message.outputType = object.outputType ?? ''; + message.options = + object.options !== undefined && object.options !== null + ? MethodOptions.fromPartial(object.options) + : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, +}; + +messageTypeRegistry.set(MethodDescriptorProto.$type, MethodDescriptorProto); + +function createBaseFileOptions(): FileOptions { + return { + $type: 'google.protobuf.FileOptions', + javaPackage: '', + javaOuterClassname: '', + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: '', + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: true, + objcClassPrefix: '', + csharpNamespace: '', + swiftPrefix: '', + phpClassPrefix: '', + phpNamespace: '', + phpMetadataNamespace: '', + rubyPackage: '', + uninterpretedOption: [], + }; +} + +export const FileOptions = { + $type: 'google.protobuf.FileOptions' as const, + + encode( + message: FileOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.javaPackage !== undefined && message.javaPackage !== '') { + writer.uint32(10).string(message.javaPackage); + } + if ( + message.javaOuterClassname !== undefined && + message.javaOuterClassname !== '' + ) { + writer.uint32(66).string(message.javaOuterClassname); + } + if ( + message.javaMultipleFiles !== undefined && + message.javaMultipleFiles !== false + ) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if ( + message.javaGenerateEqualsAndHash !== undefined && + message.javaGenerateEqualsAndHash !== false + ) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if ( + message.javaStringCheckUtf8 !== undefined && + message.javaStringCheckUtf8 !== false + ) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== undefined && message.goPackage !== '') { + writer.uint32(90).string(message.goPackage); + } + if ( + message.ccGenericServices !== undefined && + message.ccGenericServices !== false + ) { + writer.uint32(128).bool(message.ccGenericServices); + } + if ( + message.javaGenericServices !== undefined && + message.javaGenericServices !== false + ) { + writer.uint32(136).bool(message.javaGenericServices); + } + if ( + message.pyGenericServices !== undefined && + message.pyGenericServices !== false + ) { + writer.uint32(144).bool(message.pyGenericServices); + } + if ( + message.phpGenericServices !== undefined && + message.phpGenericServices !== false + ) { + writer.uint32(336).bool(message.phpGenericServices); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(184).bool(message.deprecated); + } + if ( + message.ccEnableArenas !== undefined && + message.ccEnableArenas !== true + ) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if ( + message.objcClassPrefix !== undefined && + message.objcClassPrefix !== '' + ) { + writer.uint32(290).string(message.objcClassPrefix); + } + if ( + message.csharpNamespace !== undefined && + message.csharpNamespace !== '' + ) { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== undefined && message.swiftPrefix !== '') { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== '') { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== undefined && message.phpNamespace !== '') { + writer.uint32(330).string(message.phpNamespace); + } + if ( + message.phpMetadataNamespace !== undefined && + message.phpMetadataNamespace !== '' + ) { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== undefined && message.rubyPackage !== '') { + writer.uint32(362).string(message.rubyPackage); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.javaPackage = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.javaOuterClassname = reader.string(); + continue; + case 10: + if (tag !== 80) { + break; + } + + message.javaMultipleFiles = reader.bool(); + continue; + case 20: + if (tag !== 160) { + break; + } + + message.javaGenerateEqualsAndHash = reader.bool(); + continue; + case 27: + if (tag !== 216) { + break; + } + + message.javaStringCheckUtf8 = reader.bool(); + continue; + case 9: + if (tag !== 72) { + break; + } + + message.optimizeFor = reader.int32() as any; + continue; + case 11: + if (tag !== 90) { + break; + } + + message.goPackage = reader.string(); + continue; + case 16: + if (tag !== 128) { + break; + } + + message.ccGenericServices = reader.bool(); + continue; + case 17: + if (tag !== 136) { + break; + } + + message.javaGenericServices = reader.bool(); + continue; + case 18: + if (tag !== 144) { + break; + } + + message.pyGenericServices = reader.bool(); + continue; + case 42: + if (tag !== 336) { + break; + } + + message.phpGenericServices = reader.bool(); + continue; + case 23: + if (tag !== 184) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 31: + if (tag !== 248) { + break; + } + + message.ccEnableArenas = reader.bool(); + continue; + case 36: + if (tag !== 290) { + break; + } + + message.objcClassPrefix = reader.string(); + continue; + case 37: + if (tag !== 298) { + break; + } + + message.csharpNamespace = reader.string(); + continue; + case 39: + if (tag !== 314) { + break; + } + + message.swiftPrefix = reader.string(); + continue; + case 40: + if (tag !== 322) { + break; + } + + message.phpClassPrefix = reader.string(); + continue; + case 41: + if (tag !== 330) { + break; + } + + message.phpNamespace = reader.string(); + continue; + case 44: + if (tag !== 354) { + break; + } + + message.phpMetadataNamespace = reader.string(); + continue; + case 45: + if (tag !== 362) { + break; + } + + message.rubyPackage = reader.string(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileOptions { + return { + $type: FileOptions.$type, + javaPackage: isSet(object.javaPackage) + ? globalThis.String(object.javaPackage) + : '', + javaOuterClassname: isSet(object.javaOuterClassname) + ? globalThis.String(object.javaOuterClassname) + : '', + javaMultipleFiles: isSet(object.javaMultipleFiles) + ? globalThis.Boolean(object.javaMultipleFiles) + : false, + javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) + ? globalThis.Boolean(object.javaGenerateEqualsAndHash) + : false, + javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) + ? globalThis.Boolean(object.javaStringCheckUtf8) + : false, + optimizeFor: isSet(object.optimizeFor) + ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) + : 1, + goPackage: isSet(object.goPackage) + ? globalThis.String(object.goPackage) + : '', + ccGenericServices: isSet(object.ccGenericServices) + ? globalThis.Boolean(object.ccGenericServices) + : false, + javaGenericServices: isSet(object.javaGenericServices) + ? globalThis.Boolean(object.javaGenericServices) + : false, + pyGenericServices: isSet(object.pyGenericServices) + ? globalThis.Boolean(object.pyGenericServices) + : false, + phpGenericServices: isSet(object.phpGenericServices) + ? globalThis.Boolean(object.phpGenericServices) + : false, + deprecated: isSet(object.deprecated) + ? globalThis.Boolean(object.deprecated) + : false, + ccEnableArenas: isSet(object.ccEnableArenas) + ? globalThis.Boolean(object.ccEnableArenas) + : true, + objcClassPrefix: isSet(object.objcClassPrefix) + ? globalThis.String(object.objcClassPrefix) + : '', + csharpNamespace: isSet(object.csharpNamespace) + ? globalThis.String(object.csharpNamespace) + : '', + swiftPrefix: isSet(object.swiftPrefix) + ? globalThis.String(object.swiftPrefix) + : '', + phpClassPrefix: isSet(object.phpClassPrefix) + ? globalThis.String(object.phpClassPrefix) + : '', + phpNamespace: isSet(object.phpNamespace) + ? globalThis.String(object.phpNamespace) + : '', + phpMetadataNamespace: isSet(object.phpMetadataNamespace) + ? globalThis.String(object.phpMetadataNamespace) + : '', + rubyPackage: isSet(object.rubyPackage) + ? globalThis.String(object.rubyPackage) + : '', + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + if (message.javaPackage !== undefined && message.javaPackage !== '') { + obj.javaPackage = message.javaPackage; + } + if ( + message.javaOuterClassname !== undefined && + message.javaOuterClassname !== '' + ) { + obj.javaOuterClassname = message.javaOuterClassname; + } + if ( + message.javaMultipleFiles !== undefined && + message.javaMultipleFiles !== false + ) { + obj.javaMultipleFiles = message.javaMultipleFiles; + } + if ( + message.javaGenerateEqualsAndHash !== undefined && + message.javaGenerateEqualsAndHash !== false + ) { + obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + } + if ( + message.javaStringCheckUtf8 !== undefined && + message.javaStringCheckUtf8 !== false + ) { + obj.javaStringCheckUtf8 = message.javaStringCheckUtf8; + } + if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { + obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor); + } + if (message.goPackage !== undefined && message.goPackage !== '') { + obj.goPackage = message.goPackage; + } + if ( + message.ccGenericServices !== undefined && + message.ccGenericServices !== false + ) { + obj.ccGenericServices = message.ccGenericServices; + } + if ( + message.javaGenericServices !== undefined && + message.javaGenericServices !== false + ) { + obj.javaGenericServices = message.javaGenericServices; + } + if ( + message.pyGenericServices !== undefined && + message.pyGenericServices !== false + ) { + obj.pyGenericServices = message.pyGenericServices; + } + if ( + message.phpGenericServices !== undefined && + message.phpGenericServices !== false + ) { + obj.phpGenericServices = message.phpGenericServices; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if ( + message.ccEnableArenas !== undefined && + message.ccEnableArenas !== true + ) { + obj.ccEnableArenas = message.ccEnableArenas; + } + if ( + message.objcClassPrefix !== undefined && + message.objcClassPrefix !== '' + ) { + obj.objcClassPrefix = message.objcClassPrefix; + } + if ( + message.csharpNamespace !== undefined && + message.csharpNamespace !== '' + ) { + obj.csharpNamespace = message.csharpNamespace; + } + if (message.swiftPrefix !== undefined && message.swiftPrefix !== '') { + obj.swiftPrefix = message.swiftPrefix; + } + if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== '') { + obj.phpClassPrefix = message.phpClassPrefix; + } + if (message.phpNamespace !== undefined && message.phpNamespace !== '') { + obj.phpNamespace = message.phpNamespace; + } + if ( + message.phpMetadataNamespace !== undefined && + message.phpMetadataNamespace !== '' + ) { + obj.phpMetadataNamespace = message.phpMetadataNamespace; + } + if (message.rubyPackage !== undefined && message.rubyPackage !== '') { + obj.rubyPackage = message.rubyPackage; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>(base?: I): FileOptions { + return FileOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ''; + message.javaOuterClassname = object.javaOuterClassname ?? ''; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = + object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ''; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.phpGenericServices = object.phpGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? true; + message.objcClassPrefix = object.objcClassPrefix ?? ''; + message.csharpNamespace = object.csharpNamespace ?? ''; + message.swiftPrefix = object.swiftPrefix ?? ''; + message.phpClassPrefix = object.phpClassPrefix ?? ''; + message.phpNamespace = object.phpNamespace ?? ''; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ''; + message.rubyPackage = object.rubyPackage ?? ''; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(FileOptions.$type, FileOptions); + +function createBaseMessageOptions(): MessageOptions { + return { + $type: 'google.protobuf.MessageOptions', + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} + +export const MessageOptions = { + $type: 'google.protobuf.MessageOptions' as const, + + encode( + message: MessageOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if ( + message.messageSetWireFormat !== undefined && + message.messageSetWireFormat !== false + ) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if ( + message.noStandardDescriptorAccessor !== undefined && + message.noStandardDescriptorAccessor !== false + ) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry !== undefined && message.mapEntry !== false) { + writer.uint32(56).bool(message.mapEntry); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.messageSetWireFormat = reader.bool(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.noStandardDescriptorAccessor = reader.bool(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.mapEntry = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MessageOptions { + return { + $type: MessageOptions.$type, + messageSetWireFormat: isSet(object.messageSetWireFormat) + ? globalThis.Boolean(object.messageSetWireFormat) + : false, + noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) + ? globalThis.Boolean(object.noStandardDescriptorAccessor) + : false, + deprecated: isSet(object.deprecated) + ? globalThis.Boolean(object.deprecated) + : false, + mapEntry: isSet(object.mapEntry) + ? globalThis.Boolean(object.mapEntry) + : false, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + if ( + message.messageSetWireFormat !== undefined && + message.messageSetWireFormat !== false + ) { + obj.messageSetWireFormat = message.messageSetWireFormat; + } + if ( + message.noStandardDescriptorAccessor !== undefined && + message.noStandardDescriptorAccessor !== false + ) { + obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.mapEntry !== undefined && message.mapEntry !== false) { + obj.mapEntry = message.mapEntry; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): MessageOptions { + return MessageOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = + object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(MessageOptions.$type, MessageOptions); + +function createBaseFieldOptions(): FieldOptions { + return { + $type: 'google.protobuf.FieldOptions', + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + uninterpretedOption: [], + }; +} + +export const FieldOptions = { + $type: 'google.protobuf.FieldOptions' as const, + + encode( + message: FieldOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.ctype !== undefined && message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed !== undefined && message.packed !== false) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== undefined && message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy !== undefined && message.lazy !== false) { + writer.uint32(40).bool(message.lazy); + } + if ( + message.unverifiedLazy !== undefined && + message.unverifiedLazy !== false + ) { + writer.uint32(120).bool(message.unverifiedLazy); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak !== undefined && message.weak !== false) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.ctype = reader.int32() as any; + continue; + case 2: + if (tag !== 16) { + break; + } + + message.packed = reader.bool(); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.jstype = reader.int32() as any; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.lazy = reader.bool(); + continue; + case 15: + if (tag !== 120) { + break; + } + + message.unverifiedLazy = reader.bool(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 10: + if (tag !== 80) { + break; + } + + message.weak = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldOptions { + return { + $type: FieldOptions.$type, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + packed: isSet(object.packed) ? globalThis.Boolean(object.packed) : false, + jstype: isSet(object.jstype) + ? fieldOptions_JSTypeFromJSON(object.jstype) + : 0, + lazy: isSet(object.lazy) ? globalThis.Boolean(object.lazy) : false, + unverifiedLazy: isSet(object.unverifiedLazy) + ? globalThis.Boolean(object.unverifiedLazy) + : false, + deprecated: isSet(object.deprecated) + ? globalThis.Boolean(object.deprecated) + : false, + weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + if (message.ctype !== undefined && message.ctype !== 0) { + obj.ctype = fieldOptions_CTypeToJSON(message.ctype); + } + if (message.packed !== undefined && message.packed !== false) { + obj.packed = message.packed; + } + if (message.jstype !== undefined && message.jstype !== 0) { + obj.jstype = fieldOptions_JSTypeToJSON(message.jstype); + } + if (message.lazy !== undefined && message.lazy !== false) { + obj.lazy = message.lazy; + } + if ( + message.unverifiedLazy !== undefined && + message.unverifiedLazy !== false + ) { + obj.unverifiedLazy = message.unverifiedLazy; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.weak !== undefined && message.weak !== false) { + obj.weak = message.weak; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): FieldOptions { + return FieldOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 0; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 0; + message.lazy = object.lazy ?? false; + message.unverifiedLazy = object.unverifiedLazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(FieldOptions.$type, FieldOptions); + +function createBaseOneofOptions(): OneofOptions { + return { $type: 'google.protobuf.OneofOptions', uninterpretedOption: [] }; +} + +export const OneofOptions = { + $type: 'google.protobuf.OneofOptions' as const, + + encode( + message: OneofOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OneofOptions { + return { + $type: OneofOptions.$type, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): OneofOptions { + return OneofOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(OneofOptions.$type, OneofOptions); + +function createBaseEnumOptions(): EnumOptions { + return { + $type: 'google.protobuf.EnumOptions', + allowAlias: false, + deprecated: false, + uninterpretedOption: [], + }; +} + +export const EnumOptions = { + $type: 'google.protobuf.EnumOptions' as const, + + encode( + message: EnumOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.allowAlias !== undefined && message.allowAlias !== false) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 16) { + break; + } + + message.allowAlias = reader.bool(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumOptions { + return { + $type: EnumOptions.$type, + allowAlias: isSet(object.allowAlias) + ? globalThis.Boolean(object.allowAlias) + : false, + deprecated: isSet(object.deprecated) + ? globalThis.Boolean(object.deprecated) + : false, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + if (message.allowAlias !== undefined && message.allowAlias !== false) { + obj.allowAlias = message.allowAlias; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>(base?: I): EnumOptions { + return EnumOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(EnumOptions.$type, EnumOptions); + +function createBaseEnumValueOptions(): EnumValueOptions { + return { + $type: 'google.protobuf.EnumValueOptions', + deprecated: false, + uninterpretedOption: [], + }; +} + +export const EnumValueOptions = { + $type: 'google.protobuf.EnumValueOptions' as const, + + encode( + message: EnumValueOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + return { + $type: EnumValueOptions.$type, + deprecated: isSet(object.deprecated) + ? globalThis.Boolean(object.deprecated) + : false, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): EnumValueOptions { + return EnumValueOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(EnumValueOptions.$type, EnumValueOptions); + +function createBaseServiceOptions(): ServiceOptions { + return { + $type: 'google.protobuf.ServiceOptions', + deprecated: false, + uninterpretedOption: [], + }; +} + +export const ServiceOptions = { + $type: 'google.protobuf.ServiceOptions' as const, + + encode( + message: ServiceOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + return { + $type: ServiceOptions.$type, + deprecated: isSet(object.deprecated) + ? globalThis.Boolean(object.deprecated) + : false, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServiceOptions { + return ServiceOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(ServiceOptions.$type, ServiceOptions); + +function createBaseMethodOptions(): MethodOptions { + return { + $type: 'google.protobuf.MethodOptions', + deprecated: false, + idempotencyLevel: 0, + uninterpretedOption: [], + }; +} + +export const MethodOptions = { + $type: 'google.protobuf.MethodOptions' as const, + + encode( + message: MethodOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(264).bool(message.deprecated); + } + if ( + message.idempotencyLevel !== undefined && + message.idempotencyLevel !== 0 + ) { + writer.uint32(272).int32(message.idempotencyLevel); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 34: + if (tag !== 272) { + break; + } + + message.idempotencyLevel = reader.int32() as any; + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MethodOptions { + return { + $type: MethodOptions.$type, + deprecated: isSet(object.deprecated) + ? globalThis.Boolean(object.deprecated) + : false, + idempotencyLevel: isSet(object.idempotencyLevel) + ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) + : 0, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if ( + message.idempotencyLevel !== undefined && + message.idempotencyLevel !== 0 + ) { + obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON( + message.idempotencyLevel, + ); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + UninterpretedOption.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): MethodOptions { + return MethodOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 0; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(MethodOptions.$type, MethodOptions); + +function createBaseUninterpretedOption(): UninterpretedOption { + return { + $type: 'google.protobuf.UninterpretedOption', + name: [], + identifierValue: '', + positiveIntValue: Long.UZERO, + negativeIntValue: Long.ZERO, + doubleValue: 0, + stringValue: new Uint8Array(0), + aggregateValue: '', + }; +} + +export const UninterpretedOption = { + $type: 'google.protobuf.UninterpretedOption' as const, + + encode( + message: UninterpretedOption, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork(), + ).ldelim(); + } + if ( + message.identifierValue !== undefined && + message.identifierValue !== '' + ) { + writer.uint32(26).string(message.identifierValue); + } + if ( + message.positiveIntValue !== undefined && + !message.positiveIntValue.equals(Long.UZERO) + ) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if ( + message.negativeIntValue !== undefined && + !message.negativeIntValue.equals(Long.ZERO) + ) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== undefined && message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue !== undefined && message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== undefined && message.aggregateValue !== '') { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 18) { + break; + } + + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()), + ); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.identifierValue = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.positiveIntValue = reader.uint64() as Long; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.negativeIntValue = reader.int64() as Long; + continue; + case 6: + if (tag !== 49) { + break; + } + + message.doubleValue = reader.double(); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.stringValue = reader.bytes(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.aggregateValue = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + return { + $type: UninterpretedOption.$type, + name: globalThis.Array.isArray(object?.name) + ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) + : [], + identifierValue: isSet(object.identifierValue) + ? globalThis.String(object.identifierValue) + : '', + positiveIntValue: isSet(object.positiveIntValue) + ? Long.fromValue(object.positiveIntValue) + : Long.UZERO, + negativeIntValue: isSet(object.negativeIntValue) + ? Long.fromValue(object.negativeIntValue) + : Long.ZERO, + doubleValue: isSet(object.doubleValue) + ? globalThis.Number(object.doubleValue) + : 0, + stringValue: isSet(object.stringValue) + ? bytesFromBase64(object.stringValue) + : new Uint8Array(0), + aggregateValue: isSet(object.aggregateValue) + ? globalThis.String(object.aggregateValue) + : '', + }; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name?.length) { + obj.name = message.name.map((e) => + UninterpretedOption_NamePart.toJSON(e), + ); + } + if ( + message.identifierValue !== undefined && + message.identifierValue !== '' + ) { + obj.identifierValue = message.identifierValue; + } + if ( + message.positiveIntValue !== undefined && + !message.positiveIntValue.equals(Long.UZERO) + ) { + obj.positiveIntValue = ( + message.positiveIntValue || Long.UZERO + ).toString(); + } + if ( + message.negativeIntValue !== undefined && + !message.negativeIntValue.equals(Long.ZERO) + ) { + obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString(); + } + if (message.doubleValue !== undefined && message.doubleValue !== 0) { + obj.doubleValue = message.doubleValue; + } + if (message.stringValue !== undefined && message.stringValue.length !== 0) { + obj.stringValue = base64FromBytes(message.stringValue); + } + if (message.aggregateValue !== undefined && message.aggregateValue !== '') { + obj.aggregateValue = message.aggregateValue; + } + return obj; + }, + + create, I>>( + base?: I, + ): UninterpretedOption { + return UninterpretedOption.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = + object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || + []; + message.identifierValue = object.identifierValue ?? ''; + message.positiveIntValue = + object.positiveIntValue !== undefined && object.positiveIntValue !== null + ? Long.fromValue(object.positiveIntValue) + : Long.UZERO; + message.negativeIntValue = + object.negativeIntValue !== undefined && object.negativeIntValue !== null + ? Long.fromValue(object.negativeIntValue) + : Long.ZERO; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(0); + message.aggregateValue = object.aggregateValue ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(UninterpretedOption.$type, UninterpretedOption); + +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { + $type: 'google.protobuf.UninterpretedOption.NamePart', + namePart: '', + isExtension: false, + }; +} + +export const UninterpretedOption_NamePart = { + $type: 'google.protobuf.UninterpretedOption.NamePart' as const, + + encode( + message: UninterpretedOption_NamePart, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.namePart !== '') { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension !== false) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): UninterpretedOption_NamePart { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.namePart = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.isExtension = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + return { + $type: UninterpretedOption_NamePart.$type, + namePart: isSet(object.namePart) + ? globalThis.String(object.namePart) + : '', + isExtension: isSet(object.isExtension) + ? globalThis.Boolean(object.isExtension) + : false, + }; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + if (message.namePart !== '') { + obj.namePart = message.namePart; + } + if (message.isExtension !== false) { + obj.isExtension = message.isExtension; + } + return obj; + }, + + create, I>>( + base?: I, + ): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ''; + message.isExtension = object.isExtension ?? false; + return message; + }, +}; + +messageTypeRegistry.set( + UninterpretedOption_NamePart.$type, + UninterpretedOption_NamePart, +); + +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { $type: 'google.protobuf.SourceCodeInfo', location: [] }; +} + +export const SourceCodeInfo = { + $type: 'google.protobuf.SourceCodeInfo' as const, + + encode( + message: SourceCodeInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + return { + $type: SourceCodeInfo.$type, + location: globalThis.Array.isArray(object?.location) + ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location?.length) { + obj.location = message.location.map((e) => + SourceCodeInfo_Location.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): SourceCodeInfo { + return SourceCodeInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = + object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(SourceCodeInfo.$type, SourceCodeInfo); + +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { + $type: 'google.protobuf.SourceCodeInfo.Location', + path: [], + span: [], + leadingComments: '', + trailingComments: '', + leadingDetachedComments: [], + }; +} + +export const SourceCodeInfo_Location = { + $type: 'google.protobuf.SourceCodeInfo.Location' as const, + + encode( + message: SourceCodeInfo_Location, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if ( + message.leadingComments !== undefined && + message.leadingComments !== '' + ) { + writer.uint32(26).string(message.leadingComments); + } + if ( + message.trailingComments !== undefined && + message.trailingComments !== '' + ) { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): SourceCodeInfo_Location { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + case 2: + if (tag === 16) { + message.span.push(reader.int32()); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + + continue; + } + + break; + case 3: + if (tag !== 26) { + break; + } + + message.leadingComments = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.trailingComments = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.leadingDetachedComments.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + return { + $type: SourceCodeInfo_Location.$type, + path: globalThis.Array.isArray(object?.path) + ? object.path.map((e: any) => globalThis.Number(e)) + : [], + span: globalThis.Array.isArray(object?.span) + ? object.span.map((e: any) => globalThis.Number(e)) + : [], + leadingComments: isSet(object.leadingComments) + ? globalThis.String(object.leadingComments) + : '', + trailingComments: isSet(object.trailingComments) + ? globalThis.String(object.trailingComments) + : '', + leadingDetachedComments: globalThis.Array.isArray( + object?.leadingDetachedComments, + ) + ? object.leadingDetachedComments.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path?.length) { + obj.path = message.path.map((e) => Math.round(e)); + } + if (message.span?.length) { + obj.span = message.span.map((e) => Math.round(e)); + } + if ( + message.leadingComments !== undefined && + message.leadingComments !== '' + ) { + obj.leadingComments = message.leadingComments; + } + if ( + message.trailingComments !== undefined && + message.trailingComments !== '' + ) { + obj.trailingComments = message.trailingComments; + } + if (message.leadingDetachedComments?.length) { + obj.leadingDetachedComments = message.leadingDetachedComments; + } + return obj; + }, + + create, I>>( + base?: I, + ): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map((e) => e) || []; + message.span = object.span?.map((e) => e) || []; + message.leadingComments = object.leadingComments ?? ''; + message.trailingComments = object.trailingComments ?? ''; + message.leadingDetachedComments = + object.leadingDetachedComments?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(SourceCodeInfo_Location.$type, SourceCodeInfo_Location); + +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { $type: 'google.protobuf.GeneratedCodeInfo', annotation: [] }; +} + +export const GeneratedCodeInfo = { + $type: 'google.protobuf.GeneratedCodeInfo' as const, + + encode( + message: GeneratedCodeInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()), + ); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + return { + $type: GeneratedCodeInfo.$type, + annotation: globalThis.Array.isArray(object?.annotation) + ? object.annotation.map((e: any) => + GeneratedCodeInfo_Annotation.fromJSON(e), + ) + : [], + }; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation?.length) { + obj.annotation = message.annotation.map((e) => + GeneratedCodeInfo_Annotation.toJSON(e), + ); + } + return obj; + }, + + create, I>>( + base?: I, + ): GeneratedCodeInfo { + return GeneratedCodeInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = + object.annotation?.map((e) => + GeneratedCodeInfo_Annotation.fromPartial(e), + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(GeneratedCodeInfo.$type, GeneratedCodeInfo); + +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { + $type: 'google.protobuf.GeneratedCodeInfo.Annotation', + path: [], + sourceFile: '', + begin: 0, + end: 0, + }; +} + +export const GeneratedCodeInfo_Annotation = { + $type: 'google.protobuf.GeneratedCodeInfo.Annotation' as const, + + encode( + message: GeneratedCodeInfo_Annotation, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== undefined && message.sourceFile !== '') { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== undefined && message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GeneratedCodeInfo_Annotation { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + case 2: + if (tag !== 18) { + break; + } + + message.sourceFile = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.begin = reader.int32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.end = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + return { + $type: GeneratedCodeInfo_Annotation.$type, + path: globalThis.Array.isArray(object?.path) + ? object.path.map((e: any) => globalThis.Number(e)) + : [], + sourceFile: isSet(object.sourceFile) + ? globalThis.String(object.sourceFile) + : '', + begin: isSet(object.begin) ? globalThis.Number(object.begin) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + }; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path?.length) { + obj.path = message.path.map((e) => Math.round(e)); + } + if (message.sourceFile !== undefined && message.sourceFile !== '') { + obj.sourceFile = message.sourceFile; + } + if (message.begin !== undefined && message.begin !== 0) { + obj.begin = Math.round(message.begin); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + return obj; + }, + + create, I>>( + base?: I, + ): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map((e) => e) || []; + message.sourceFile = object.sourceFile ?? ''; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + GeneratedCodeInfo_Annotation.$type, + GeneratedCodeInfo_Annotation, +); + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, 'base64')); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString('base64'); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join('')); + } +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/google/protobuf/empty.ts b/ts/src/generated/google/protobuf/empty.ts new file mode 100644 index 00000000..fb647157 --- /dev/null +++ b/ts/src/generated/google/protobuf/empty.ts @@ -0,0 +1,100 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../typeRegistry'; + +export const protobufPackage = 'google.protobuf'; + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + */ +export interface Empty { + $type: 'google.protobuf.Empty'; +} + +function createBaseEmpty(): Empty { + return { $type: 'google.protobuf.Empty' }; +} + +export const Empty = { + $type: 'google.protobuf.Empty' as const, + + encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Empty { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmpty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): Empty { + return { $type: Empty.$type }; + }, + + toJSON(_: Empty): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): Empty { + return Empty.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): Empty { + const message = createBaseEmpty(); + return message; + }, +}; + +messageTypeRegistry.set(Empty.$type, Empty); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/ts/src/generated/google/protobuf/timestamp.ts b/ts/src/generated/google/protobuf/timestamp.ts new file mode 100644 index 00000000..780a4066 --- /dev/null +++ b/ts/src/generated/google/protobuf/timestamp.ts @@ -0,0 +1,241 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../typeRegistry'; + +export const protobufPackage = 'google.protobuf'; + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + $type: 'google.protobuf.Timestamp'; + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: Long; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} + +function createBaseTimestamp(): Timestamp { + return { $type: 'google.protobuf.Timestamp', seconds: Long.ZERO, nanos: 0 }; +} + +export const Timestamp = { + $type: 'google.protobuf.Timestamp' as const, + + encode( + message: Timestamp, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (!message.seconds.equals(Long.ZERO)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.seconds = reader.int64() as Long; + continue; + case 2: + if (tag !== 16) { + break; + } + + message.nanos = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Timestamp { + return { + $type: Timestamp.$type, + seconds: isSet(object.seconds) + ? Long.fromValue(object.seconds) + : Long.ZERO, + nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + if (!message.seconds.equals(Long.ZERO)) { + obj.seconds = (message.seconds || Long.ZERO).toString(); + } + if (message.nanos !== 0) { + obj.nanos = Math.round(message.nanos); + } + return obj; + }, + + create, I>>(base?: I): Timestamp { + return Timestamp.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Timestamp { + const message = createBaseTimestamp(); + message.seconds = + object.seconds !== undefined && object.seconds !== null + ? Long.fromValue(object.seconds) + : Long.ZERO; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Timestamp.$type, Timestamp); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts b/ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts new file mode 100644 index 00000000..44a80569 --- /dev/null +++ b/ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts @@ -0,0 +1,277 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; +import { messageTypeRegistry } from '../../../../../typeRegistry'; + +export const protobufPackage = 'k8s.io.apimachinery.pkg.api.resource'; + +/** + * Quantity is a fixed-point representation of a number. + * It provides convenient marshaling/unmarshaling in JSON and YAML, + * in addition to String() and AsInt64() accessors. + * + * The serialization format is: + * + * ``` + * ::= + * + * (Note that may be empty, from the "" case in .) + * + * ::= 0 | 1 | ... | 9 + * ::= | + * ::= | . | . | . + * ::= "+" | "-" + * ::= | + * ::= | | + * ::= Ki | Mi | Gi | Ti | Pi | Ei + * + * (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html) + * + * ::= m | "" | k | M | G | T | P | E + * + * (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.) + * + * ::= "e" | "E" + * ``` + * + * No matter which of the three exponent forms is used, no quantity may represent + * a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal + * places. Numbers larger or more precise will be capped or rounded up. + * (E.g.: 0.1m will rounded up to 1m.) + * This may be extended in the future if we require larger or smaller quantities. + * + * When a Quantity is parsed from a string, it will remember the type of suffix + * it had, and will use the same type again when it is serialized. + * + * Before serializing, Quantity will be put in "canonical form". + * This means that Exponent/suffix will be adjusted up or down (with a + * corresponding increase or decrease in Mantissa) such that: + * + * - No precision is lost + * - No fractional digits will be emitted + * - The exponent (or suffix) is as large as possible. + * + * The sign will be omitted unless the number is negative. + * + * Examples: + * + * - 1.5 will be serialized as "1500m" + * - 1.5Gi will be serialized as "1536Mi" + * + * Note that the quantity will NEVER be internally represented by a + * floating point number. That is the whole point of this exercise. + * + * Non-canonical values will still parse as long as they are well formed, + * but will be re-emitted in their canonical form. (So always use canonical + * form, or don't diff.) + * + * This format is intended to make it difficult to use these numbers without + * writing some sort of special handling code in the hopes that that will + * cause implementors to also use a fixed point implementation. + * + * +protobuf=true + * +protobuf.embed=string + * +protobuf.options.marshal=false + * +protobuf.options.(gogoproto.goproto_stringer)=false + * +k8s:deepcopy-gen=true + * +k8s:openapi-gen=true + */ +export interface Quantity { + $type: 'k8s.io.apimachinery.pkg.api.resource.Quantity'; + string?: string | undefined; +} + +/** + * QuantityValue makes it possible to use a Quantity as value for a command + * line parameter. + * + * +protobuf=true + * +protobuf.embed=string + * +protobuf.options.marshal=false + * +protobuf.options.(gogoproto.goproto_stringer)=false + * +k8s:deepcopy-gen=true + */ +export interface QuantityValue { + $type: 'k8s.io.apimachinery.pkg.api.resource.QuantityValue'; + string?: string | undefined; +} + +function createBaseQuantity(): Quantity { + return { $type: 'k8s.io.apimachinery.pkg.api.resource.Quantity', string: '' }; +} + +export const Quantity = { + $type: 'k8s.io.apimachinery.pkg.api.resource.Quantity' as const, + + encode( + message: Quantity, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.string !== undefined && message.string !== '') { + writer.uint32(10).string(message.string); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Quantity { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuantity(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.string = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Quantity { + return { + $type: Quantity.$type, + string: isSet(object.string) ? globalThis.String(object.string) : '', + }; + }, + + toJSON(message: Quantity): unknown { + const obj: any = {}; + if (message.string !== undefined && message.string !== '') { + obj.string = message.string; + } + return obj; + }, + + create, I>>(base?: I): Quantity { + return Quantity.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Quantity { + const message = createBaseQuantity(); + message.string = object.string ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(Quantity.$type, Quantity); + +function createBaseQuantityValue(): QuantityValue { + return { + $type: 'k8s.io.apimachinery.pkg.api.resource.QuantityValue', + string: '', + }; +} + +export const QuantityValue = { + $type: 'k8s.io.apimachinery.pkg.api.resource.QuantityValue' as const, + + encode( + message: QuantityValue, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.string !== undefined && message.string !== '') { + writer.uint32(10).string(message.string); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuantityValue { + const reader = + input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuantityValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.string = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): QuantityValue { + return { + $type: QuantityValue.$type, + string: isSet(object.string) ? globalThis.String(object.string) : '', + }; + }, + + toJSON(message: QuantityValue): unknown { + const obj: any = {}; + if (message.string !== undefined && message.string !== '') { + obj.string = message.string; + } + return obj; + }, + + create, I>>( + base?: I, + ): QuantityValue { + return QuantityValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): QuantityValue { + const message = createBaseQuantityValue(); + message.string = object.string ?? ''; + return message; + }, +}; + +messageTypeRegistry.set(QuantityValue.$type, QuantityValue); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude | '$type'>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts/src/generated/typeRegistry.ts b/ts/src/generated/typeRegistry.ts new file mode 100644 index 00000000..7c3f50d2 --- /dev/null +++ b/ts/src/generated/typeRegistry.ts @@ -0,0 +1,36 @@ +/* eslint-disable */ +import Long from 'long'; +import _m0 from 'protobufjs/minimal'; + +export interface MessageType { + $type: Message['$type']; + encode(message: Message, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Message; + fromJSON(object: any): Message; + toJSON(message: Message): unknown; + fromPartial(object: DeepPartial): Message; +} + +export type UnknownMessage = { $type: string }; + +export const messageTypeRegistry = new Map(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; From 540593d5cca6757413c9a19b6fea5451c5ca4d2b Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Tue, 2 Apr 2024 18:24:38 +0200 Subject: [PATCH 5/5] refactor(ts): generates files without failing Exact type (#184) --- script/protocgen-legacy.sh | 8 +- script/shellcheck.sh | 2 +- ts/package-lock.json | 385 ++++++++++++++++-- ts/package.json | 3 +- ts/src/generated/akash/audit/v1beta1/audit.ts | 87 ++-- ts/src/generated/akash/audit/v1beta2/audit.ts | 87 ++-- .../generated/akash/audit/v1beta2/genesis.ts | 17 +- ts/src/generated/akash/audit/v1beta2/query.ts | 69 ++-- ts/src/generated/akash/audit/v1beta3/audit.ts | 87 ++-- .../generated/akash/audit/v1beta3/genesis.ts | 17 +- ts/src/generated/akash/audit/v1beta3/query.ts | 69 ++-- .../generated/akash/base/v1beta1/attribute.ts | 31 +- .../generated/akash/base/v1beta1/endpoint.ts | 13 +- .../generated/akash/base/v1beta1/resource.ts | 35 +- .../akash/base/v1beta1/resourcevalue.ts | 17 +- .../generated/akash/base/v1beta2/attribute.ts | 31 +- .../generated/akash/base/v1beta2/endpoint.ts | 13 +- .../generated/akash/base/v1beta2/resource.ts | 25 +- .../akash/base/v1beta2/resourceunits.ts | 17 +- .../akash/base/v1beta2/resourcevalue.ts | 17 +- .../generated/akash/base/v1beta3/attribute.ts | 31 +- ts/src/generated/akash/base/v1beta3/cpu.ts | 13 +- .../generated/akash/base/v1beta3/endpoint.ts | 13 +- ts/src/generated/akash/base/v1beta3/gpu.ts | 13 +- ts/src/generated/akash/base/v1beta3/memory.ts | 13 +- .../generated/akash/base/v1beta3/resources.ts | 15 +- .../akash/base/v1beta3/resourcevalue.ts | 17 +- .../generated/akash/base/v1beta3/storage.ts | 13 +- ts/src/generated/akash/cert/v1beta2/cert.ts | 77 ++-- .../generated/akash/cert/v1beta2/genesis.ts | 27 +- ts/src/generated/akash/cert/v1beta2/query.ts | 37 +- ts/src/generated/akash/cert/v1beta3/cert.ts | 77 ++-- .../generated/akash/cert/v1beta3/genesis.ts | 27 +- ts/src/generated/akash/cert/v1beta3/query.ts | 37 +- .../akash/deployment/v1beta1/authz.ts | 17 +- .../akash/deployment/v1beta1/deployment.ts | 117 ++---- .../akash/deployment/v1beta1/genesis.ts | 27 +- .../akash/deployment/v1beta1/group.ts | 93 ++--- .../akash/deployment/v1beta1/params.ts | 13 +- .../akash/deployment/v1beta1/query.ts | 67 ++- .../akash/deployment/v1beta2/authz.ts | 17 +- .../akash/deployment/v1beta2/deployment.ts | 35 +- .../akash/deployment/v1beta2/deploymentmsg.ts | 89 ++-- .../akash/deployment/v1beta2/genesis.ts | 27 +- .../akash/deployment/v1beta2/group.ts | 13 +- .../akash/deployment/v1beta2/groupid.ts | 13 +- .../akash/deployment/v1beta2/groupmsg.ts | 69 +--- .../akash/deployment/v1beta2/groupspec.ts | 15 +- .../akash/deployment/v1beta2/params.ts | 13 +- .../akash/deployment/v1beta2/query.ts | 67 ++- .../akash/deployment/v1beta2/resource.ts | 13 +- .../akash/deployment/v1beta3/authz.ts | 17 +- .../akash/deployment/v1beta3/deployment.ts | 35 +- .../akash/deployment/v1beta3/deploymentmsg.ts | 89 ++-- .../akash/deployment/v1beta3/genesis.ts | 27 +- .../akash/deployment/v1beta3/group.ts | 13 +- .../akash/deployment/v1beta3/groupid.ts | 13 +- .../akash/deployment/v1beta3/groupmsg.ts | 69 +--- .../akash/deployment/v1beta3/groupspec.ts | 15 +- .../akash/deployment/v1beta3/params.ts | 13 +- .../akash/deployment/v1beta3/query.ts | 67 ++- .../akash/deployment/v1beta3/resourceunit.ts | 17 +- ts/src/generated/akash/discovery/v1/akash.ts | 13 +- .../akash/discovery/v1/client_info.ts | 15 +- .../generated/akash/escrow/v1beta1/genesis.ts | 17 +- .../generated/akash/escrow/v1beta1/query.ts | 47 +-- .../generated/akash/escrow/v1beta1/types.ts | 27 +- .../generated/akash/escrow/v1beta2/genesis.ts | 17 +- .../generated/akash/escrow/v1beta2/query.ts | 47 +-- .../generated/akash/escrow/v1beta2/types.ts | 31 +- .../generated/akash/escrow/v1beta3/genesis.ts | 17 +- .../generated/akash/escrow/v1beta3/query.ts | 47 +-- .../generated/akash/escrow/v1beta3/types.ts | 31 +- ts/src/generated/akash/gov/v1beta3/genesis.ts | 17 +- ts/src/generated/akash/gov/v1beta3/params.ts | 17 +- .../akash/inflation/v1beta2/genesis.ts | 17 +- .../akash/inflation/v1beta2/params.ts | 13 +- .../akash/inflation/v1beta3/genesis.ts | 17 +- .../akash/inflation/v1beta3/params.ts | 13 +- .../generated/akash/inventory/v1/cluster.ts | 13 +- ts/src/generated/akash/inventory/v1/cpu.ts | 19 +- ts/src/generated/akash/inventory/v1/gpu.ts | 19 +- ts/src/generated/akash/inventory/v1/memory.ts | 21 +- ts/src/generated/akash/inventory/v1/node.ts | 23 +- .../akash/inventory/v1/resourcepair.ts | 17 +- .../generated/akash/inventory/v1/resources.ts | 17 +- .../generated/akash/inventory/v1/storage.ts | 21 +- .../generated/akash/manifest/v2beta1/group.ts | 13 +- .../akash/manifest/v2beta1/httpoptions.ts | 17 +- .../akash/manifest/v2beta1/service.ts | 33 +- .../akash/manifest/v2beta1/serviceexpose.ts | 17 +- .../generated/akash/manifest/v2beta2/group.ts | 13 +- .../akash/manifest/v2beta2/httpoptions.ts | 17 +- .../akash/manifest/v2beta2/service.ts | 33 +- .../akash/manifest/v2beta2/serviceexpose.ts | 17 +- ts/src/generated/akash/market/v1beta2/bid.ts | 67 +-- .../generated/akash/market/v1beta2/genesis.ts | 17 +- .../generated/akash/market/v1beta2/lease.ts | 89 ++-- .../generated/akash/market/v1beta2/order.ts | 29 +- .../generated/akash/market/v1beta2/params.ts | 13 +- .../generated/akash/market/v1beta2/query.ts | 129 ++---- ts/src/generated/akash/market/v1beta3/bid.ts | 67 +-- .../generated/akash/market/v1beta3/genesis.ts | 17 +- .../generated/akash/market/v1beta3/lease.ts | 89 ++-- .../generated/akash/market/v1beta3/order.ts | 29 +- .../generated/akash/market/v1beta3/params.ts | 13 +- .../generated/akash/market/v1beta3/query.ts | 129 ++---- ts/src/generated/akash/market/v1beta4/bid.ts | 75 ++-- .../generated/akash/market/v1beta4/genesis.ts | 17 +- .../generated/akash/market/v1beta4/lease.ts | 89 ++-- .../generated/akash/market/v1beta4/order.ts | 29 +- .../generated/akash/market/v1beta4/params.ts | 13 +- .../generated/akash/market/v1beta4/query.ts | 129 ++---- .../akash/provider/lease/v1/service.ts | 127 ++---- ts/src/generated/akash/provider/v1/status.ts | 97 ++--- .../akash/provider/v1beta1/provider.ts | 85 ++-- .../akash/provider/v1beta2/genesis.ts | 17 +- .../akash/provider/v1beta2/provider.ts | 85 ++-- .../generated/akash/provider/v1beta2/query.ts | 47 +-- .../akash/provider/v1beta3/genesis.ts | 17 +- .../akash/provider/v1beta3/provider.ts | 85 ++-- .../generated/akash/provider/v1beta3/query.ts | 47 +-- .../akash/staking/v1beta3/genesis.ts | 17 +- .../generated/akash/staking/v1beta3/params.ts | 13 +- .../generated/akash/take/v1beta3/genesis.ts | 17 +- ts/src/generated/akash/take/v1beta3/params.ts | 23 +- .../cosmos/base/query/v1beta1/pagination.ts | 25 +- ts/src/generated/cosmos/base/v1beta1/coin.ts | 31 +- ts/src/generated/google/api/http.ts | 29 +- .../generated/google/protobuf/descriptor.ts | 281 +++++-------- ts/src/generated/google/protobuf/empty.ts | 13 +- ts/src/generated/google/protobuf/timestamp.ts | 15 +- .../pkg/api/resource/generated.ts | 23 +- ts/tsconfig.build.json | 2 +- 134 files changed, 1871 insertions(+), 3498 deletions(-) diff --git a/script/protocgen-legacy.sh b/script/protocgen-legacy.sh index dbd0be86..54c24f19 100755 --- a/script/protocgen-legacy.sh +++ b/script/protocgen-legacy.sh @@ -37,8 +37,8 @@ for dir in $proto_dirs; do -I "vendor/github.com/cosmos/cosmos-sdk/proto" \ -I "vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ --plugin="${AKASH_TS_NODE_BIN}/protoc-gen-ts_proto" \ - --ts_proto_out=${AKASH_TS_ROOT}/src/generated \ - --ts_proto_opt=esModuleInterop=true,forceLong=long,outputTypeRegistry=true \ + --ts_proto_out="${AKASH_TS_ROOT}/src/generated" \ + --ts_proto_opt=esModuleInterop=true,forceLong=long,outputTypeRegistry=true,useExactTypes=false \ $(find "${dir}" -maxdepth 1 -name '*.proto') done @@ -71,8 +71,8 @@ for dir in $proto_dirs; do -I "vendor/github.com/cosmos/cosmos-sdk/proto" \ -I "vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ --plugin="${AKASH_TS_NODE_BIN}/protoc-gen-ts_proto" \ - --ts_proto_out=${AKASH_TS_ROOT}/src/generated \ - --ts_proto_opt=esModuleInterop=true,forceLong=long,outputTypeRegistry=true \ + --ts_proto_out="${AKASH_TS_ROOT}/src/generated" \ + --ts_proto_opt=esModuleInterop=true,forceLong=long,outputTypeRegistry=true,useExactTypes=false \ $(find "${dir}" -maxdepth 1 -name '*.proto') done diff --git a/script/shellcheck.sh b/script/shellcheck.sh index f0136a36..1b560d3b 100644 --- a/script/shellcheck.sh +++ b/script/shellcheck.sh @@ -2,7 +2,7 @@ unset FAILED -FILES=$(find /shellcheck/ -type f -name "*.sh" ! -path "/shellcheck/vendor/*" ! -path "/shellcheck/.git/*") +FILES=$(find /shellcheck/ -type f -name "*.sh" ! -path "/shellcheck/vendor/*" ! -path "/shellcheck/.git/*" ! -path "/shellcheck/ts/.husky/*") for file in $FILES; do name="$(basename "$file")"; diff --git a/ts/package-lock.json b/ts/package-lock.json index ed56479e..91beb4e9 100644 --- a/ts/package-lock.json +++ b/ts/package-lock.json @@ -14,6 +14,7 @@ "husky": "^9.0.11", "lint-staged": "^15.2.2", "prettier": "^3.2.5", + "rimraf": "^5.0.5", "sort-package-json": "^2.8.0", "ts-proto": "^1.169.1", "typescript": "^5.4.2" @@ -161,6 +162,102 @@ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -196,6 +293,16 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -809,6 +916,12 @@ "detect-libc": "^1.0.3" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/emoji-regex": { "version": "10.3.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", @@ -1129,12 +1242,85 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/flat-cache/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/flat-cache/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flat-cache/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1187,20 +1373,22 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1218,28 +1406,6 @@ "node": ">=10.13.0" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -1445,6 +1611,24 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1754,6 +1938,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1903,6 +2096,31 @@ "node": ">=8" } }, + "node_modules/path-scurry": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -2085,15 +2303,18 @@ "dev": true }, "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", + "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", "dev": true, "dependencies": { - "glob": "^7.1.3" + "glob": "^10.3.7" }, "bin": { - "rimraf": "bin.js" + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2288,6 +2509,36 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/string-width/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", @@ -2327,6 +2578,19 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -2511,6 +2775,53 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", diff --git a/ts/package.json b/ts/package.json index c20671f3..08cbd259 100644 --- a/ts/package.json +++ b/ts/package.json @@ -7,7 +7,7 @@ "author": "Akash Network Team", "main": "dist/index.js", "scripts": { - "build": "tsc -p tsconfig.build.json && npm run format", + "build": "rimraf dist && tsc -p tsconfig.build.json && npm run format", "format": "prettier --write './**/*.{js,jsx,ts,tsx,css,json}' --config ./.prettierrc", "lint": "eslint src", "lint:fix": "npm run lint -- --fix", @@ -28,6 +28,7 @@ "husky": "^9.0.11", "lint-staged": "^15.2.2", "prettier": "^3.2.5", + "rimraf": "^5.0.5", "sort-package-json": "^2.8.0", "ts-proto": "^1.169.1", "typescript": "^5.4.2" diff --git a/ts/src/generated/akash/audit/v1beta1/audit.ts b/ts/src/generated/akash/audit/v1beta1/audit.ts index 8b96669b..51a29e4f 100644 --- a/ts/src/generated/akash/audit/v1beta1/audit.ts +++ b/ts/src/generated/akash/audit/v1beta1/audit.ts @@ -152,10 +152,10 @@ export const Provider = { return obj; }, - create, I>>(base?: I): Provider { - return Provider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Provider { + return Provider.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Provider { + fromPartial(object: DeepPartial): Provider { const message = createBaseProvider(); message.owner = object.owner ?? ''; message.auditor = object.auditor ?? ''; @@ -258,14 +258,10 @@ export const AuditedAttributes = { return obj; }, - create, I>>( - base?: I, - ): AuditedAttributes { - return AuditedAttributes.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AuditedAttributes { + return AuditedAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AuditedAttributes { + fromPartial(object: DeepPartial): AuditedAttributes { const message = createBaseAuditedAttributes(); message.owner = object.owner ?? ''; message.auditor = object.auditor ?? ''; @@ -339,14 +335,10 @@ export const AttributesResponse = { return obj; }, - create, I>>( - base?: I, - ): AttributesResponse { - return AttributesResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AttributesResponse { + return AttributesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AttributesResponse { + fromPartial(object: DeepPartial): AttributesResponse { const message = createBaseAttributesResponse(); message.attributes = object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; @@ -434,14 +426,10 @@ export const AttributesFilters = { return obj; }, - create, I>>( - base?: I, - ): AttributesFilters { - return AttributesFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AttributesFilters { + return AttributesFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AttributesFilters { + fromPartial(object: DeepPartial): AttributesFilters { const message = createBaseAttributesFilters(); message.auditors = object.auditors?.map((e) => e) || []; message.owners = object.owners?.map((e) => e) || []; @@ -545,13 +533,13 @@ export const MsgSignProviderAttributes = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgSignProviderAttributes { - return MsgSignProviderAttributes.fromPartial(base ?? ({} as any)); + return MsgSignProviderAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): MsgSignProviderAttributes { const message = createBaseMsgSignProviderAttributes(); message.owner = object.owner ?? ''; @@ -610,14 +598,14 @@ export const MsgSignProviderAttributesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgSignProviderAttributesResponse { - return MsgSignProviderAttributesResponse.fromPartial(base ?? ({} as any)); + return MsgSignProviderAttributesResponse.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(_: I): MsgSignProviderAttributesResponse { + fromPartial( + _: DeepPartial, + ): MsgSignProviderAttributesResponse { const message = createBaseMsgSignProviderAttributesResponse(); return message; }, @@ -722,13 +710,13 @@ export const MsgDeleteProviderAttributes = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderAttributes { - return MsgDeleteProviderAttributes.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): MsgDeleteProviderAttributes { const message = createBaseMsgDeleteProviderAttributes(); message.owner = object.owner ?? ''; @@ -786,14 +774,14 @@ export const MsgDeleteProviderAttributesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderAttributesResponse { - return MsgDeleteProviderAttributesResponse.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderAttributesResponse.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(_: I): MsgDeleteProviderAttributesResponse { + fromPartial( + _: DeepPartial, + ): MsgDeleteProviderAttributesResponse { const message = createBaseMsgDeleteProviderAttributesResponse(); return message; }, @@ -884,13 +872,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/audit/v1beta2/audit.ts b/ts/src/generated/akash/audit/v1beta2/audit.ts index 1935d33c..d0d07735 100644 --- a/ts/src/generated/akash/audit/v1beta2/audit.ts +++ b/ts/src/generated/akash/audit/v1beta2/audit.ts @@ -152,10 +152,10 @@ export const Provider = { return obj; }, - create, I>>(base?: I): Provider { - return Provider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Provider { + return Provider.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Provider { + fromPartial(object: DeepPartial): Provider { const message = createBaseProvider(); message.owner = object.owner ?? ''; message.auditor = object.auditor ?? ''; @@ -258,14 +258,10 @@ export const AuditedAttributes = { return obj; }, - create, I>>( - base?: I, - ): AuditedAttributes { - return AuditedAttributes.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AuditedAttributes { + return AuditedAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AuditedAttributes { + fromPartial(object: DeepPartial): AuditedAttributes { const message = createBaseAuditedAttributes(); message.owner = object.owner ?? ''; message.auditor = object.auditor ?? ''; @@ -339,14 +335,10 @@ export const AttributesResponse = { return obj; }, - create, I>>( - base?: I, - ): AttributesResponse { - return AttributesResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AttributesResponse { + return AttributesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AttributesResponse { + fromPartial(object: DeepPartial): AttributesResponse { const message = createBaseAttributesResponse(); message.attributes = object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; @@ -434,14 +426,10 @@ export const AttributesFilters = { return obj; }, - create, I>>( - base?: I, - ): AttributesFilters { - return AttributesFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AttributesFilters { + return AttributesFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AttributesFilters { + fromPartial(object: DeepPartial): AttributesFilters { const message = createBaseAttributesFilters(); message.auditors = object.auditors?.map((e) => e) || []; message.owners = object.owners?.map((e) => e) || []; @@ -545,13 +533,13 @@ export const MsgSignProviderAttributes = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgSignProviderAttributes { - return MsgSignProviderAttributes.fromPartial(base ?? ({} as any)); + return MsgSignProviderAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): MsgSignProviderAttributes { const message = createBaseMsgSignProviderAttributes(); message.owner = object.owner ?? ''; @@ -610,14 +598,14 @@ export const MsgSignProviderAttributesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgSignProviderAttributesResponse { - return MsgSignProviderAttributesResponse.fromPartial(base ?? ({} as any)); + return MsgSignProviderAttributesResponse.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(_: I): MsgSignProviderAttributesResponse { + fromPartial( + _: DeepPartial, + ): MsgSignProviderAttributesResponse { const message = createBaseMsgSignProviderAttributesResponse(); return message; }, @@ -722,13 +710,13 @@ export const MsgDeleteProviderAttributes = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderAttributes { - return MsgDeleteProviderAttributes.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): MsgDeleteProviderAttributes { const message = createBaseMsgDeleteProviderAttributes(); message.owner = object.owner ?? ''; @@ -786,14 +774,14 @@ export const MsgDeleteProviderAttributesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderAttributesResponse { - return MsgDeleteProviderAttributesResponse.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderAttributesResponse.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(_: I): MsgDeleteProviderAttributesResponse { + fromPartial( + _: DeepPartial, + ): MsgDeleteProviderAttributesResponse { const message = createBaseMsgDeleteProviderAttributesResponse(); return message; }, @@ -884,13 +872,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/audit/v1beta2/genesis.ts b/ts/src/generated/akash/audit/v1beta2/genesis.ts index 4a2d7825..3e9b305c 100644 --- a/ts/src/generated/akash/audit/v1beta2/genesis.ts +++ b/ts/src/generated/akash/audit/v1beta2/genesis.ts @@ -74,14 +74,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.attributes = object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; @@ -112,13 +108,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/audit/v1beta2/query.ts b/ts/src/generated/akash/audit/v1beta2/query.ts index 26acc6f4..5322d40b 100644 --- a/ts/src/generated/akash/audit/v1beta2/query.ts +++ b/ts/src/generated/akash/audit/v1beta2/query.ts @@ -135,13 +135,11 @@ export const QueryProvidersResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryProvidersResponse { - return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProvidersResponse { const message = createBaseQueryProvidersResponse(); message.providers = @@ -233,14 +231,10 @@ export const QueryProviderRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryProviderRequest { - return QueryProviderRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryProviderRequest { + fromPartial(object: DeepPartial): QueryProviderRequest { const message = createBaseQueryProviderRequest(); message.auditor = object.auditor ?? ''; message.owner = object.owner ?? ''; @@ -314,14 +308,14 @@ export const QueryAllProvidersAttributesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryAllProvidersAttributesRequest { - return QueryAllProvidersAttributesRequest.fromPartial(base ?? ({} as any)); + return QueryAllProvidersAttributesRequest.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(object: I): QueryAllProvidersAttributesRequest { + fromPartial( + object: DeepPartial, + ): QueryAllProvidersAttributesRequest { const message = createBaseQueryAllProvidersAttributesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null @@ -415,13 +409,13 @@ export const QueryProviderAttributesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryProviderAttributesRequest { - return QueryProviderAttributesRequest.fromPartial(base ?? ({} as any)); + return QueryProviderAttributesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProviderAttributesRequest { const message = createBaseQueryProviderAttributesRequest(); message.owner = object.owner ?? ''; @@ -515,13 +509,13 @@ export const QueryProviderAuditorRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryProviderAuditorRequest { - return QueryProviderAuditorRequest.fromPartial(base ?? ({} as any)); + return QueryProviderAuditorRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProviderAuditorRequest { const message = createBaseQueryProviderAuditorRequest(); message.auditor = object.auditor ?? ''; @@ -614,13 +608,13 @@ export const QueryAuditorAttributesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryAuditorAttributesRequest { - return QueryAuditorAttributesRequest.fromPartial(base ?? ({} as any)); + return QueryAuditorAttributesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryAuditorAttributesRequest { const message = createBaseQueryAuditorAttributesRequest(); message.auditor = object.auditor ?? ''; @@ -763,13 +757,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/audit/v1beta3/audit.ts b/ts/src/generated/akash/audit/v1beta3/audit.ts index 641f5fd6..508d7635 100644 --- a/ts/src/generated/akash/audit/v1beta3/audit.ts +++ b/ts/src/generated/akash/audit/v1beta3/audit.ts @@ -152,10 +152,10 @@ export const Provider = { return obj; }, - create, I>>(base?: I): Provider { - return Provider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Provider { + return Provider.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Provider { + fromPartial(object: DeepPartial): Provider { const message = createBaseProvider(); message.owner = object.owner ?? ''; message.auditor = object.auditor ?? ''; @@ -258,14 +258,10 @@ export const AuditedAttributes = { return obj; }, - create, I>>( - base?: I, - ): AuditedAttributes { - return AuditedAttributes.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AuditedAttributes { + return AuditedAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AuditedAttributes { + fromPartial(object: DeepPartial): AuditedAttributes { const message = createBaseAuditedAttributes(); message.owner = object.owner ?? ''; message.auditor = object.auditor ?? ''; @@ -339,14 +335,10 @@ export const AttributesResponse = { return obj; }, - create, I>>( - base?: I, - ): AttributesResponse { - return AttributesResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AttributesResponse { + return AttributesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AttributesResponse { + fromPartial(object: DeepPartial): AttributesResponse { const message = createBaseAttributesResponse(); message.attributes = object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; @@ -434,14 +426,10 @@ export const AttributesFilters = { return obj; }, - create, I>>( - base?: I, - ): AttributesFilters { - return AttributesFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AttributesFilters { + return AttributesFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AttributesFilters { + fromPartial(object: DeepPartial): AttributesFilters { const message = createBaseAttributesFilters(); message.auditors = object.auditors?.map((e) => e) || []; message.owners = object.owners?.map((e) => e) || []; @@ -545,13 +533,13 @@ export const MsgSignProviderAttributes = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgSignProviderAttributes { - return MsgSignProviderAttributes.fromPartial(base ?? ({} as any)); + return MsgSignProviderAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): MsgSignProviderAttributes { const message = createBaseMsgSignProviderAttributes(); message.owner = object.owner ?? ''; @@ -610,14 +598,14 @@ export const MsgSignProviderAttributesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgSignProviderAttributesResponse { - return MsgSignProviderAttributesResponse.fromPartial(base ?? ({} as any)); + return MsgSignProviderAttributesResponse.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(_: I): MsgSignProviderAttributesResponse { + fromPartial( + _: DeepPartial, + ): MsgSignProviderAttributesResponse { const message = createBaseMsgSignProviderAttributesResponse(); return message; }, @@ -722,13 +710,13 @@ export const MsgDeleteProviderAttributes = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderAttributes { - return MsgDeleteProviderAttributes.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderAttributes.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): MsgDeleteProviderAttributes { const message = createBaseMsgDeleteProviderAttributes(); message.owner = object.owner ?? ''; @@ -786,14 +774,14 @@ export const MsgDeleteProviderAttributesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderAttributesResponse { - return MsgDeleteProviderAttributesResponse.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderAttributesResponse.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(_: I): MsgDeleteProviderAttributesResponse { + fromPartial( + _: DeepPartial, + ): MsgDeleteProviderAttributesResponse { const message = createBaseMsgDeleteProviderAttributesResponse(); return message; }, @@ -884,13 +872,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/audit/v1beta3/genesis.ts b/ts/src/generated/akash/audit/v1beta3/genesis.ts index 5593e250..8d366f01 100644 --- a/ts/src/generated/akash/audit/v1beta3/genesis.ts +++ b/ts/src/generated/akash/audit/v1beta3/genesis.ts @@ -74,14 +74,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.attributes = object.attributes?.map((e) => AuditedAttributes.fromPartial(e)) || []; @@ -112,13 +108,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/audit/v1beta3/query.ts b/ts/src/generated/akash/audit/v1beta3/query.ts index c73241fb..1c34e37e 100644 --- a/ts/src/generated/akash/audit/v1beta3/query.ts +++ b/ts/src/generated/akash/audit/v1beta3/query.ts @@ -135,13 +135,11 @@ export const QueryProvidersResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryProvidersResponse { - return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProvidersResponse { const message = createBaseQueryProvidersResponse(); message.providers = @@ -233,14 +231,10 @@ export const QueryProviderRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryProviderRequest { - return QueryProviderRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryProviderRequest { + fromPartial(object: DeepPartial): QueryProviderRequest { const message = createBaseQueryProviderRequest(); message.auditor = object.auditor ?? ''; message.owner = object.owner ?? ''; @@ -314,14 +308,14 @@ export const QueryAllProvidersAttributesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryAllProvidersAttributesRequest { - return QueryAllProvidersAttributesRequest.fromPartial(base ?? ({} as any)); + return QueryAllProvidersAttributesRequest.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(object: I): QueryAllProvidersAttributesRequest { + fromPartial( + object: DeepPartial, + ): QueryAllProvidersAttributesRequest { const message = createBaseQueryAllProvidersAttributesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null @@ -415,13 +409,13 @@ export const QueryProviderAttributesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryProviderAttributesRequest { - return QueryProviderAttributesRequest.fromPartial(base ?? ({} as any)); + return QueryProviderAttributesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProviderAttributesRequest { const message = createBaseQueryProviderAttributesRequest(); message.owner = object.owner ?? ''; @@ -515,13 +509,13 @@ export const QueryProviderAuditorRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryProviderAuditorRequest { - return QueryProviderAuditorRequest.fromPartial(base ?? ({} as any)); + return QueryProviderAuditorRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProviderAuditorRequest { const message = createBaseQueryProviderAuditorRequest(); message.auditor = object.auditor ?? ''; @@ -614,13 +608,13 @@ export const QueryAuditorAttributesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryAuditorAttributesRequest { - return QueryAuditorAttributesRequest.fromPartial(base ?? ({} as any)); + return QueryAuditorAttributesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryAuditorAttributesRequest { const message = createBaseQueryAuditorAttributesRequest(); message.auditor = object.auditor ?? ''; @@ -763,13 +757,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta1/attribute.ts b/ts/src/generated/akash/base/v1beta1/attribute.ts index e99e5c59..4eba2a4d 100644 --- a/ts/src/generated/akash/base/v1beta1/attribute.ts +++ b/ts/src/generated/akash/base/v1beta1/attribute.ts @@ -105,12 +105,10 @@ export const Attribute = { return obj; }, - create, I>>(base?: I): Attribute { - return Attribute.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Attribute { + return Attribute.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Attribute { + fromPartial(object: DeepPartial): Attribute { const message = createBaseAttribute(); message.key = object.key ?? ''; message.value = object.value ?? ''; @@ -194,10 +192,10 @@ export const SignedBy = { return obj; }, - create, I>>(base?: I): SignedBy { - return SignedBy.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): SignedBy { + return SignedBy.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): SignedBy { + fromPartial(object: DeepPartial): SignedBy { const message = createBaseSignedBy(); message.allOf = object.allOf?.map((e) => e) || []; message.anyOf = object.anyOf?.map((e) => e) || []; @@ -288,13 +286,11 @@ export const PlacementRequirements = { return obj; }, - create, I>>( - base?: I, - ): PlacementRequirements { - return PlacementRequirements.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): PlacementRequirements { + return PlacementRequirements.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): PlacementRequirements { const message = createBasePlacementRequirements(); message.signedBy = @@ -330,13 +326,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta1/endpoint.ts b/ts/src/generated/akash/base/v1beta1/endpoint.ts index 49c04f50..2584e3d0 100644 --- a/ts/src/generated/akash/base/v1beta1/endpoint.ts +++ b/ts/src/generated/akash/base/v1beta1/endpoint.ts @@ -103,10 +103,10 @@ export const Endpoint = { return obj; }, - create, I>>(base?: I): Endpoint { - return Endpoint.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Endpoint { + return Endpoint.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Endpoint { + fromPartial(object: DeepPartial): Endpoint { const message = createBaseEndpoint(); message.kind = object.kind ?? 0; return message; @@ -136,13 +136,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta1/resource.ts b/ts/src/generated/akash/base/v1beta1/resource.ts index c9dec621..7419cbe7 100644 --- a/ts/src/generated/akash/base/v1beta1/resource.ts +++ b/ts/src/generated/akash/base/v1beta1/resource.ts @@ -112,10 +112,10 @@ export const CPU = { return obj; }, - create, I>>(base?: I): CPU { - return CPU.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CPU { + return CPU.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): CPU { + fromPartial(object: DeepPartial): CPU { const message = createBaseCPU(); message.units = object.units !== undefined && object.units !== null @@ -207,10 +207,10 @@ export const Memory = { return obj; }, - create, I>>(base?: I): Memory { - return Memory.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Memory { + return Memory.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Memory { + fromPartial(object: DeepPartial): Memory { const message = createBaseMemory(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -302,10 +302,10 @@ export const Storage = { return obj; }, - create, I>>(base?: I): Storage { - return Storage.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Storage { + return Storage.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Storage { + fromPartial(object: DeepPartial): Storage { const message = createBaseStorage(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -427,14 +427,10 @@ export const ResourceUnits = { return obj; }, - create, I>>( - base?: I, - ): ResourceUnits { - return ResourceUnits.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourceUnits { + return ResourceUnits.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourceUnits { + fromPartial(object: DeepPartial): ResourceUnits { const message = createBaseResourceUnits(); message.cpu = object.cpu !== undefined && object.cpu !== null @@ -477,13 +473,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta1/resourcevalue.ts b/ts/src/generated/akash/base/v1beta1/resourcevalue.ts index 2ab2a681..588ae9b4 100644 --- a/ts/src/generated/akash/base/v1beta1/resourcevalue.ts +++ b/ts/src/generated/akash/base/v1beta1/resourcevalue.ts @@ -67,14 +67,10 @@ export const ResourceValue = { return obj; }, - create, I>>( - base?: I, - ): ResourceValue { - return ResourceValue.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourceValue { + return ResourceValue.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourceValue { + fromPartial(object: DeepPartial): ResourceValue { const message = createBaseResourceValue(); message.val = object.val ?? new Uint8Array(0); return message; @@ -129,13 +125,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta2/attribute.ts b/ts/src/generated/akash/base/v1beta2/attribute.ts index 9cf0c10a..e88c7f7a 100644 --- a/ts/src/generated/akash/base/v1beta2/attribute.ts +++ b/ts/src/generated/akash/base/v1beta2/attribute.ts @@ -105,12 +105,10 @@ export const Attribute = { return obj; }, - create, I>>(base?: I): Attribute { - return Attribute.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Attribute { + return Attribute.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Attribute { + fromPartial(object: DeepPartial): Attribute { const message = createBaseAttribute(); message.key = object.key ?? ''; message.value = object.value ?? ''; @@ -194,10 +192,10 @@ export const SignedBy = { return obj; }, - create, I>>(base?: I): SignedBy { - return SignedBy.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): SignedBy { + return SignedBy.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): SignedBy { + fromPartial(object: DeepPartial): SignedBy { const message = createBaseSignedBy(); message.allOf = object.allOf?.map((e) => e) || []; message.anyOf = object.anyOf?.map((e) => e) || []; @@ -288,13 +286,11 @@ export const PlacementRequirements = { return obj; }, - create, I>>( - base?: I, - ): PlacementRequirements { - return PlacementRequirements.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): PlacementRequirements { + return PlacementRequirements.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): PlacementRequirements { const message = createBasePlacementRequirements(); message.signedBy = @@ -330,13 +326,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta2/endpoint.ts b/ts/src/generated/akash/base/v1beta2/endpoint.ts index cb0ef190..392c6bba 100644 --- a/ts/src/generated/akash/base/v1beta2/endpoint.ts +++ b/ts/src/generated/akash/base/v1beta2/endpoint.ts @@ -127,10 +127,10 @@ export const Endpoint = { return obj; }, - create, I>>(base?: I): Endpoint { - return Endpoint.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Endpoint { + return Endpoint.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Endpoint { + fromPartial(object: DeepPartial): Endpoint { const message = createBaseEndpoint(); message.kind = object.kind ?? 0; message.sequenceNumber = object.sequenceNumber ?? 0; @@ -161,13 +161,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta2/resource.ts b/ts/src/generated/akash/base/v1beta2/resource.ts index 2448f8b4..ff93d475 100644 --- a/ts/src/generated/akash/base/v1beta2/resource.ts +++ b/ts/src/generated/akash/base/v1beta2/resource.ts @@ -100,10 +100,10 @@ export const CPU = { return obj; }, - create, I>>(base?: I): CPU { - return CPU.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CPU { + return CPU.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): CPU { + fromPartial(object: DeepPartial): CPU { const message = createBaseCPU(); message.units = object.units !== undefined && object.units !== null @@ -195,10 +195,10 @@ export const Memory = { return obj; }, - create, I>>(base?: I): Memory { - return Memory.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Memory { + return Memory.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Memory { + fromPartial(object: DeepPartial): Memory { const message = createBaseMemory(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -305,10 +305,10 @@ export const Storage = { return obj; }, - create, I>>(base?: I): Storage { - return Storage.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Storage { + return Storage.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Storage { + fromPartial(object: DeepPartial): Storage { const message = createBaseStorage(); message.name = object.name ?? ''; message.quantity = @@ -344,13 +344,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta2/resourceunits.ts b/ts/src/generated/akash/base/v1beta2/resourceunits.ts index 72bb091e..60ad0a61 100644 --- a/ts/src/generated/akash/base/v1beta2/resourceunits.ts +++ b/ts/src/generated/akash/base/v1beta2/resourceunits.ts @@ -127,14 +127,10 @@ export const ResourceUnits = { return obj; }, - create, I>>( - base?: I, - ): ResourceUnits { - return ResourceUnits.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourceUnits { + return ResourceUnits.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourceUnits { + fromPartial(object: DeepPartial): ResourceUnits { const message = createBaseResourceUnits(); message.cpu = object.cpu !== undefined && object.cpu !== null @@ -174,13 +170,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta2/resourcevalue.ts b/ts/src/generated/akash/base/v1beta2/resourcevalue.ts index b719b165..4aefff5f 100644 --- a/ts/src/generated/akash/base/v1beta2/resourcevalue.ts +++ b/ts/src/generated/akash/base/v1beta2/resourcevalue.ts @@ -67,14 +67,10 @@ export const ResourceValue = { return obj; }, - create, I>>( - base?: I, - ): ResourceValue { - return ResourceValue.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourceValue { + return ResourceValue.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourceValue { + fromPartial(object: DeepPartial): ResourceValue { const message = createBaseResourceValue(); message.val = object.val ?? new Uint8Array(0); return message; @@ -129,13 +125,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/attribute.ts b/ts/src/generated/akash/base/v1beta3/attribute.ts index b3ec6baa..30163827 100644 --- a/ts/src/generated/akash/base/v1beta3/attribute.ts +++ b/ts/src/generated/akash/base/v1beta3/attribute.ts @@ -105,12 +105,10 @@ export const Attribute = { return obj; }, - create, I>>(base?: I): Attribute { - return Attribute.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Attribute { + return Attribute.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Attribute { + fromPartial(object: DeepPartial): Attribute { const message = createBaseAttribute(); message.key = object.key ?? ''; message.value = object.value ?? ''; @@ -194,10 +192,10 @@ export const SignedBy = { return obj; }, - create, I>>(base?: I): SignedBy { - return SignedBy.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): SignedBy { + return SignedBy.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): SignedBy { + fromPartial(object: DeepPartial): SignedBy { const message = createBaseSignedBy(); message.allOf = object.allOf?.map((e) => e) || []; message.anyOf = object.anyOf?.map((e) => e) || []; @@ -288,13 +286,11 @@ export const PlacementRequirements = { return obj; }, - create, I>>( - base?: I, - ): PlacementRequirements { - return PlacementRequirements.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): PlacementRequirements { + return PlacementRequirements.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): PlacementRequirements { const message = createBasePlacementRequirements(); message.signedBy = @@ -330,13 +326,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/cpu.ts b/ts/src/generated/akash/base/v1beta3/cpu.ts index 3d31cc49..8f718f1a 100644 --- a/ts/src/generated/akash/base/v1beta3/cpu.ts +++ b/ts/src/generated/akash/base/v1beta3/cpu.ts @@ -85,10 +85,10 @@ export const CPU = { return obj; }, - create, I>>(base?: I): CPU { - return CPU.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CPU { + return CPU.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): CPU { + fromPartial(object: DeepPartial): CPU { const message = createBaseCPU(); message.units = object.units !== undefined && object.units !== null @@ -123,13 +123,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/endpoint.ts b/ts/src/generated/akash/base/v1beta3/endpoint.ts index 1310d2f0..5c97060d 100644 --- a/ts/src/generated/akash/base/v1beta3/endpoint.ts +++ b/ts/src/generated/akash/base/v1beta3/endpoint.ts @@ -127,10 +127,10 @@ export const Endpoint = { return obj; }, - create, I>>(base?: I): Endpoint { - return Endpoint.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Endpoint { + return Endpoint.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Endpoint { + fromPartial(object: DeepPartial): Endpoint { const message = createBaseEndpoint(); message.kind = object.kind ?? 0; message.sequenceNumber = object.sequenceNumber ?? 0; @@ -161,13 +161,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/gpu.ts b/ts/src/generated/akash/base/v1beta3/gpu.ts index c4d9b279..f7ffac01 100644 --- a/ts/src/generated/akash/base/v1beta3/gpu.ts +++ b/ts/src/generated/akash/base/v1beta3/gpu.ts @@ -85,10 +85,10 @@ export const GPU = { return obj; }, - create, I>>(base?: I): GPU { - return GPU.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GPU { + return GPU.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): GPU { + fromPartial(object: DeepPartial): GPU { const message = createBaseGPU(); message.units = object.units !== undefined && object.units !== null @@ -123,13 +123,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/memory.ts b/ts/src/generated/akash/base/v1beta3/memory.ts index 6ee7cc78..df6f7f7f 100644 --- a/ts/src/generated/akash/base/v1beta3/memory.ts +++ b/ts/src/generated/akash/base/v1beta3/memory.ts @@ -92,10 +92,10 @@ export const Memory = { return obj; }, - create, I>>(base?: I): Memory { - return Memory.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Memory { + return Memory.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Memory { + fromPartial(object: DeepPartial): Memory { const message = createBaseMemory(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -130,13 +130,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/resources.ts b/ts/src/generated/akash/base/v1beta3/resources.ts index a470ebfb..55fe6a5e 100644 --- a/ts/src/generated/akash/base/v1beta3/resources.ts +++ b/ts/src/generated/akash/base/v1beta3/resources.ts @@ -162,12 +162,10 @@ export const Resources = { return obj; }, - create, I>>(base?: I): Resources { - return Resources.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Resources { + return Resources.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Resources { + fromPartial(object: DeepPartial): Resources { const message = createBaseResources(); message.id = object.id ?? 0; message.cpu = @@ -212,13 +210,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/resourcevalue.ts b/ts/src/generated/akash/base/v1beta3/resourcevalue.ts index edb83f2e..883063c1 100644 --- a/ts/src/generated/akash/base/v1beta3/resourcevalue.ts +++ b/ts/src/generated/akash/base/v1beta3/resourcevalue.ts @@ -67,14 +67,10 @@ export const ResourceValue = { return obj; }, - create, I>>( - base?: I, - ): ResourceValue { - return ResourceValue.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourceValue { + return ResourceValue.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourceValue { + fromPartial(object: DeepPartial): ResourceValue { const message = createBaseResourceValue(); message.val = object.val ?? new Uint8Array(0); return message; @@ -129,13 +125,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/base/v1beta3/storage.ts b/ts/src/generated/akash/base/v1beta3/storage.ts index 88acdc3e..de85f5d8 100644 --- a/ts/src/generated/akash/base/v1beta3/storage.ts +++ b/ts/src/generated/akash/base/v1beta3/storage.ts @@ -108,10 +108,10 @@ export const Storage = { return obj; }, - create, I>>(base?: I): Storage { - return Storage.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Storage { + return Storage.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Storage { + fromPartial(object: DeepPartial): Storage { const message = createBaseStorage(); message.name = object.name ?? ''; message.quantity = @@ -147,13 +147,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/cert/v1beta2/cert.ts b/ts/src/generated/akash/cert/v1beta2/cert.ts index d336d8a2..fbf7a9db 100644 --- a/ts/src/generated/akash/cert/v1beta2/cert.ts +++ b/ts/src/generated/akash/cert/v1beta2/cert.ts @@ -165,14 +165,10 @@ export const CertificateID = { return obj; }, - create, I>>( - base?: I, - ): CertificateID { - return CertificateID.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): CertificateID { + create(base?: DeepPartial): CertificateID { + return CertificateID.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CertificateID { const message = createBaseCertificateID(); message.owner = object.owner ?? ''; message.serial = object.serial ?? ''; @@ -275,12 +271,10 @@ export const Certificate = { return obj; }, - create, I>>(base?: I): Certificate { - return Certificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Certificate { + return Certificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Certificate { + fromPartial(object: DeepPartial): Certificate { const message = createBaseCertificate(); message.state = object.state ?? 0; message.cert = object.cert ?? new Uint8Array(0); @@ -380,14 +374,10 @@ export const CertificateFilter = { return obj; }, - create, I>>( - base?: I, - ): CertificateFilter { - return CertificateFilter.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CertificateFilter { + return CertificateFilter.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): CertificateFilter { + fromPartial(object: DeepPartial): CertificateFilter { const message = createBaseCertificateFilter(); message.owner = object.owner ?? ''; message.serial = object.serial ?? ''; @@ -494,14 +484,10 @@ export const MsgCreateCertificate = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateCertificate { - return MsgCreateCertificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateCertificate { + return MsgCreateCertificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateCertificate { + fromPartial(object: DeepPartial): MsgCreateCertificate { const message = createBaseMsgCreateCertificate(); message.owner = object.owner ?? ''; message.cert = object.cert ?? new Uint8Array(0); @@ -555,13 +541,13 @@ export const MsgCreateCertificateResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateCertificateResponse { - return MsgCreateCertificateResponse.fromPartial(base ?? ({} as any)); + return MsgCreateCertificateResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateCertificateResponse { const message = createBaseMsgCreateCertificateResponse(); return message; @@ -632,14 +618,10 @@ export const MsgRevokeCertificate = { return obj; }, - create, I>>( - base?: I, - ): MsgRevokeCertificate { - return MsgRevokeCertificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgRevokeCertificate { + return MsgRevokeCertificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgRevokeCertificate { + fromPartial(object: DeepPartial): MsgRevokeCertificate { const message = createBaseMsgRevokeCertificate(); message.id = object.id !== undefined && object.id !== null @@ -694,13 +676,13 @@ export const MsgRevokeCertificateResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgRevokeCertificateResponse { - return MsgRevokeCertificateResponse.fromPartial(base ?? ({} as any)); + return MsgRevokeCertificateResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgRevokeCertificateResponse { const message = createBaseMsgRevokeCertificateResponse(); return message; @@ -809,13 +791,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/cert/v1beta2/genesis.ts b/ts/src/generated/akash/cert/v1beta2/genesis.ts index e33c4799..6d6e4b77 100644 --- a/ts/src/generated/akash/cert/v1beta2/genesis.ts +++ b/ts/src/generated/akash/cert/v1beta2/genesis.ts @@ -98,14 +98,10 @@ export const GenesisCertificate = { return obj; }, - create, I>>( - base?: I, - ): GenesisCertificate { - return GenesisCertificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisCertificate { + return GenesisCertificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisCertificate { + fromPartial(object: DeepPartial): GenesisCertificate { const message = createBaseGenesisCertificate(); message.owner = object.owner ?? ''; message.certificate = @@ -180,14 +176,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.certificates = object.certificates?.map((e) => GenesisCertificate.fromPartial(e)) || []; @@ -218,13 +210,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/cert/v1beta2/query.ts b/ts/src/generated/akash/cert/v1beta2/query.ts index 59d7c9a4..769ada31 100644 --- a/ts/src/generated/akash/cert/v1beta2/query.ts +++ b/ts/src/generated/akash/cert/v1beta2/query.ts @@ -110,14 +110,10 @@ export const CertificateResponse = { return obj; }, - create, I>>( - base?: I, - ): CertificateResponse { - return CertificateResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CertificateResponse { + return CertificateResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): CertificateResponse { + fromPartial(object: DeepPartial): CertificateResponse { const message = createBaseCertificateResponse(); message.certificate = object.certificate !== undefined && object.certificate !== null @@ -214,13 +210,13 @@ export const QueryCertificatesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryCertificatesRequest { - return QueryCertificatesRequest.fromPartial(base ?? ({} as any)); + return QueryCertificatesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryCertificatesRequest { const message = createBaseQueryCertificatesRequest(); message.filter = @@ -328,13 +324,13 @@ export const QueryCertificatesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryCertificatesResponse { - return QueryCertificatesResponse.fromPartial(base ?? ({} as any)); + return QueryCertificatesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryCertificatesResponse { const message = createBaseQueryCertificatesResponse(); message.certificates = @@ -409,13 +405,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/cert/v1beta3/cert.ts b/ts/src/generated/akash/cert/v1beta3/cert.ts index 01de9985..d03a66d2 100644 --- a/ts/src/generated/akash/cert/v1beta3/cert.ts +++ b/ts/src/generated/akash/cert/v1beta3/cert.ts @@ -165,14 +165,10 @@ export const CertificateID = { return obj; }, - create, I>>( - base?: I, - ): CertificateID { - return CertificateID.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): CertificateID { + create(base?: DeepPartial): CertificateID { + return CertificateID.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CertificateID { const message = createBaseCertificateID(); message.owner = object.owner ?? ''; message.serial = object.serial ?? ''; @@ -275,12 +271,10 @@ export const Certificate = { return obj; }, - create, I>>(base?: I): Certificate { - return Certificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Certificate { + return Certificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Certificate { + fromPartial(object: DeepPartial): Certificate { const message = createBaseCertificate(); message.state = object.state ?? 0; message.cert = object.cert ?? new Uint8Array(0); @@ -380,14 +374,10 @@ export const CertificateFilter = { return obj; }, - create, I>>( - base?: I, - ): CertificateFilter { - return CertificateFilter.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CertificateFilter { + return CertificateFilter.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): CertificateFilter { + fromPartial(object: DeepPartial): CertificateFilter { const message = createBaseCertificateFilter(); message.owner = object.owner ?? ''; message.serial = object.serial ?? ''; @@ -494,14 +484,10 @@ export const MsgCreateCertificate = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateCertificate { - return MsgCreateCertificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateCertificate { + return MsgCreateCertificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateCertificate { + fromPartial(object: DeepPartial): MsgCreateCertificate { const message = createBaseMsgCreateCertificate(); message.owner = object.owner ?? ''; message.cert = object.cert ?? new Uint8Array(0); @@ -555,13 +541,13 @@ export const MsgCreateCertificateResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateCertificateResponse { - return MsgCreateCertificateResponse.fromPartial(base ?? ({} as any)); + return MsgCreateCertificateResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateCertificateResponse { const message = createBaseMsgCreateCertificateResponse(); return message; @@ -632,14 +618,10 @@ export const MsgRevokeCertificate = { return obj; }, - create, I>>( - base?: I, - ): MsgRevokeCertificate { - return MsgRevokeCertificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgRevokeCertificate { + return MsgRevokeCertificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgRevokeCertificate { + fromPartial(object: DeepPartial): MsgRevokeCertificate { const message = createBaseMsgRevokeCertificate(); message.id = object.id !== undefined && object.id !== null @@ -694,13 +676,13 @@ export const MsgRevokeCertificateResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgRevokeCertificateResponse { - return MsgRevokeCertificateResponse.fromPartial(base ?? ({} as any)); + return MsgRevokeCertificateResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgRevokeCertificateResponse { const message = createBaseMsgRevokeCertificateResponse(); return message; @@ -809,13 +791,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/cert/v1beta3/genesis.ts b/ts/src/generated/akash/cert/v1beta3/genesis.ts index 1fedc248..7f448628 100644 --- a/ts/src/generated/akash/cert/v1beta3/genesis.ts +++ b/ts/src/generated/akash/cert/v1beta3/genesis.ts @@ -98,14 +98,10 @@ export const GenesisCertificate = { return obj; }, - create, I>>( - base?: I, - ): GenesisCertificate { - return GenesisCertificate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisCertificate { + return GenesisCertificate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisCertificate { + fromPartial(object: DeepPartial): GenesisCertificate { const message = createBaseGenesisCertificate(); message.owner = object.owner ?? ''; message.certificate = @@ -180,14 +176,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.certificates = object.certificates?.map((e) => GenesisCertificate.fromPartial(e)) || []; @@ -218,13 +210,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/cert/v1beta3/query.ts b/ts/src/generated/akash/cert/v1beta3/query.ts index 4dd25116..0fd0e5a0 100644 --- a/ts/src/generated/akash/cert/v1beta3/query.ts +++ b/ts/src/generated/akash/cert/v1beta3/query.ts @@ -110,14 +110,10 @@ export const CertificateResponse = { return obj; }, - create, I>>( - base?: I, - ): CertificateResponse { - return CertificateResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CertificateResponse { + return CertificateResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): CertificateResponse { + fromPartial(object: DeepPartial): CertificateResponse { const message = createBaseCertificateResponse(); message.certificate = object.certificate !== undefined && object.certificate !== null @@ -214,13 +210,13 @@ export const QueryCertificatesRequest = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryCertificatesRequest { - return QueryCertificatesRequest.fromPartial(base ?? ({} as any)); + return QueryCertificatesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryCertificatesRequest { const message = createBaseQueryCertificatesRequest(); message.filter = @@ -328,13 +324,13 @@ export const QueryCertificatesResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryCertificatesResponse { - return QueryCertificatesResponse.fromPartial(base ?? ({} as any)); + return QueryCertificatesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryCertificatesResponse { const message = createBaseQueryCertificatesResponse(); message.certificates = @@ -409,13 +405,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta1/authz.ts b/ts/src/generated/akash/deployment/v1beta1/authz.ts index 304ef2ea..1813eeaa 100644 --- a/ts/src/generated/akash/deployment/v1beta1/authz.ts +++ b/ts/src/generated/akash/deployment/v1beta1/authz.ts @@ -83,13 +83,13 @@ export const DepositDeploymentAuthorization = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): DepositDeploymentAuthorization { - return DepositDeploymentAuthorization.fromPartial(base ?? ({} as any)); + return DepositDeploymentAuthorization.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): DepositDeploymentAuthorization { const message = createBaseDepositDeploymentAuthorization(); message.spendLimit = @@ -126,13 +126,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta1/deployment.ts b/ts/src/generated/akash/deployment/v1beta1/deployment.ts index 9e47d336..0ad3d8d1 100644 --- a/ts/src/generated/akash/deployment/v1beta1/deployment.ts +++ b/ts/src/generated/akash/deployment/v1beta1/deployment.ts @@ -242,14 +242,10 @@ export const MsgCreateDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateDeployment { - return MsgCreateDeployment.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MsgCreateDeployment { + create(base?: DeepPartial): MsgCreateDeployment { + return MsgCreateDeployment.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MsgCreateDeployment { const message = createBaseMsgCreateDeployment(); message.id = object.id !== undefined && object.id !== null @@ -310,13 +306,13 @@ export const MsgCreateDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateDeploymentResponse { - return MsgCreateDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgCreateDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateDeploymentResponse { const message = createBaseMsgCreateDeploymentResponse(); return message; @@ -405,14 +401,10 @@ export const MsgDepositDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgDepositDeployment { - return MsgDepositDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgDepositDeployment { + return MsgDepositDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgDepositDeployment { + fromPartial(object: DeepPartial): MsgDepositDeployment { const message = createBaseMsgDepositDeployment(); message.id = object.id !== undefined && object.id !== null @@ -471,13 +463,13 @@ export const MsgDepositDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDepositDeploymentResponse { - return MsgDepositDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgDepositDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgDepositDeploymentResponse { const message = createBaseMsgDepositDeploymentResponse(); return message; @@ -582,14 +574,10 @@ export const MsgUpdateDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgUpdateDeployment { - return MsgUpdateDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgUpdateDeployment { + return MsgUpdateDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgUpdateDeployment { + fromPartial(object: DeepPartial): MsgUpdateDeployment { const message = createBaseMsgUpdateDeployment(); message.id = object.id !== undefined && object.id !== null @@ -646,13 +634,13 @@ export const MsgUpdateDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgUpdateDeploymentResponse { - return MsgUpdateDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgUpdateDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgUpdateDeploymentResponse { const message = createBaseMsgUpdateDeploymentResponse(); return message; @@ -723,14 +711,10 @@ export const MsgCloseDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseDeployment { - return MsgCloseDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseDeployment { + return MsgCloseDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseDeployment { + fromPartial(object: DeepPartial): MsgCloseDeployment { const message = createBaseMsgCloseDeployment(); message.id = object.id !== undefined && object.id !== null @@ -785,13 +769,13 @@ export const MsgCloseDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCloseDeploymentResponse { - return MsgCloseDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgCloseDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCloseDeploymentResponse { const message = createBaseMsgCloseDeploymentResponse(); return message; @@ -877,14 +861,10 @@ export const DeploymentID = { return obj; }, - create, I>>( - base?: I, - ): DeploymentID { - return DeploymentID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DeploymentID { + return DeploymentID.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DeploymentID { + fromPartial(object: DeepPartial): DeploymentID { const message = createBaseDeploymentID(); message.owner = object.owner ?? ''; message.dseq = @@ -1010,12 +990,10 @@ export const Deployment = { return obj; }, - create, I>>(base?: I): Deployment { - return Deployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Deployment { + return Deployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Deployment { + fromPartial(object: DeepPartial): Deployment { const message = createBaseDeployment(); message.deploymentId = object.deploymentId !== undefined && object.deploymentId !== null @@ -1122,14 +1100,10 @@ export const DeploymentFilters = { return obj; }, - create, I>>( - base?: I, - ): DeploymentFilters { - return DeploymentFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DeploymentFilters { + return DeploymentFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DeploymentFilters { + fromPartial(object: DeepPartial): DeploymentFilters { const message = createBaseDeploymentFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -1303,13 +1277,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta1/genesis.ts b/ts/src/generated/akash/deployment/v1beta1/genesis.ts index e3db59eb..b5fb849d 100644 --- a/ts/src/generated/akash/deployment/v1beta1/genesis.ts +++ b/ts/src/generated/akash/deployment/v1beta1/genesis.ts @@ -100,14 +100,10 @@ export const GenesisDeployment = { return obj; }, - create, I>>( - base?: I, - ): GenesisDeployment { - return GenesisDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisDeployment { + return GenesisDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisDeployment { + fromPartial(object: DeepPartial): GenesisDeployment { const message = createBaseGenesisDeployment(); message.deployment = object.deployment !== undefined && object.deployment !== null @@ -200,14 +196,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.deployments = object.deployments?.map((e) => GenesisDeployment.fromPartial(e)) || []; @@ -242,13 +234,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta1/group.ts b/ts/src/generated/akash/deployment/v1beta1/group.ts index 3ecf25d8..5dd643a0 100644 --- a/ts/src/generated/akash/deployment/v1beta1/group.ts +++ b/ts/src/generated/akash/deployment/v1beta1/group.ts @@ -187,14 +187,10 @@ export const MsgCloseGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseGroup { - return MsgCloseGroup.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseGroup { + return MsgCloseGroup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseGroup { + fromPartial(object: DeepPartial): MsgCloseGroup { const message = createBaseMsgCloseGroup(); message.id = object.id !== undefined && object.id !== null @@ -249,14 +245,10 @@ export const MsgCloseGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseGroupResponse { - return MsgCloseGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseGroupResponse { + return MsgCloseGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseGroupResponse { + fromPartial(_: DeepPartial): MsgCloseGroupResponse { const message = createBaseMsgCloseGroupResponse(); return message; }, @@ -320,14 +312,10 @@ export const MsgPauseGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgPauseGroup { - return MsgPauseGroup.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgPauseGroup { + return MsgPauseGroup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgPauseGroup { + fromPartial(object: DeepPartial): MsgPauseGroup { const message = createBaseMsgPauseGroup(); message.id = object.id !== undefined && object.id !== null @@ -382,14 +370,10 @@ export const MsgPauseGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgPauseGroupResponse { - return MsgPauseGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgPauseGroupResponse { + return MsgPauseGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgPauseGroupResponse { + fromPartial(_: DeepPartial): MsgPauseGroupResponse { const message = createBaseMsgPauseGroupResponse(); return message; }, @@ -453,14 +437,10 @@ export const MsgStartGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgStartGroup { - return MsgStartGroup.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgStartGroup { + return MsgStartGroup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgStartGroup { + fromPartial(object: DeepPartial): MsgStartGroup { const message = createBaseMsgStartGroup(); message.id = object.id !== undefined && object.id !== null @@ -515,14 +495,10 @@ export const MsgStartGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgStartGroupResponse { - return MsgStartGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgStartGroupResponse { + return MsgStartGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgStartGroupResponse { + fromPartial(_: DeepPartial): MsgStartGroupResponse { const message = createBaseMsgStartGroupResponse(); return message; }, @@ -619,10 +595,10 @@ export const GroupID = { return obj; }, - create, I>>(base?: I): GroupID { - return GroupID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GroupID { + return GroupID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): GroupID { + fromPartial(object: DeepPartial): GroupID { const message = createBaseGroupID(); message.owner = object.owner ?? ''; message.dseq = @@ -735,12 +711,10 @@ export const GroupSpec = { return obj; }, - create, I>>(base?: I): GroupSpec { - return GroupSpec.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GroupSpec { + return GroupSpec.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GroupSpec { + fromPartial(object: DeepPartial): GroupSpec { const message = createBaseGroupSpec(); message.name = object.name ?? ''; message.requirements = @@ -862,10 +836,10 @@ export const Group = { return obj; }, - create, I>>(base?: I): Group { - return Group.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Group { + return Group.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Group { + fromPartial(object: DeepPartial): Group { const message = createBaseGroup(); message.groupId = object.groupId !== undefined && object.groupId !== null @@ -980,10 +954,10 @@ export const Resource = { return obj; }, - create, I>>(base?: I): Resource { - return Resource.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Resource { + return Resource.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Resource { + fromPartial(object: DeepPartial): Resource { const message = createBaseResource(); message.resources = object.resources !== undefined && object.resources !== null @@ -1021,13 +995,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta1/params.ts b/ts/src/generated/akash/deployment/v1beta1/params.ts index 45cb63e5..8493e970 100644 --- a/ts/src/generated/akash/deployment/v1beta1/params.ts +++ b/ts/src/generated/akash/deployment/v1beta1/params.ts @@ -76,10 +76,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.deploymentMinDeposit = object.deploymentMinDeposit !== undefined && @@ -113,13 +113,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta1/query.ts b/ts/src/generated/akash/deployment/v1beta1/query.ts index b5f1a7f4..d6bc5bf9 100644 --- a/ts/src/generated/akash/deployment/v1beta1/query.ts +++ b/ts/src/generated/akash/deployment/v1beta1/query.ts @@ -136,13 +136,11 @@ export const QueryDeploymentsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentsRequest { - return QueryDeploymentsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentsRequest { + return QueryDeploymentsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentsRequest { const message = createBaseQueryDeploymentsRequest(); message.filters = @@ -249,13 +247,13 @@ export const QueryDeploymentsResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryDeploymentsResponse { - return QueryDeploymentsResponse.fromPartial(base ?? ({} as any)); + return QueryDeploymentsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentsResponse { const message = createBaseQueryDeploymentsResponse(); message.deployments = @@ -336,13 +334,11 @@ export const QueryDeploymentRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentRequest { - return QueryDeploymentRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentRequest { + return QueryDeploymentRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentRequest { const message = createBaseQueryDeploymentRequest(); message.id = @@ -453,13 +449,11 @@ export const QueryDeploymentResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentResponse { - return QueryDeploymentResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentResponse { + return QueryDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentResponse { const message = createBaseQueryDeploymentResponse(); message.deployment = @@ -533,14 +527,10 @@ export const QueryGroupRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryGroupRequest { - return QueryGroupRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryGroupRequest { + return QueryGroupRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryGroupRequest { + fromPartial(object: DeepPartial): QueryGroupRequest { const message = createBaseQueryGroupRequest(); message.id = object.id !== undefined && object.id !== null @@ -611,14 +601,10 @@ export const QueryGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryGroupResponse { - return QueryGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryGroupResponse { + return QueryGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryGroupResponse { + fromPartial(object: DeepPartial): QueryGroupResponse { const message = createBaseQueryGroupResponse(); message.group = object.group !== undefined && object.group !== null @@ -711,13 +697,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/authz.ts b/ts/src/generated/akash/deployment/v1beta2/authz.ts index 7160b026..58a5e760 100644 --- a/ts/src/generated/akash/deployment/v1beta2/authz.ts +++ b/ts/src/generated/akash/deployment/v1beta2/authz.ts @@ -83,13 +83,13 @@ export const DepositDeploymentAuthorization = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): DepositDeploymentAuthorization { - return DepositDeploymentAuthorization.fromPartial(base ?? ({} as any)); + return DepositDeploymentAuthorization.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): DepositDeploymentAuthorization { const message = createBaseDepositDeploymentAuthorization(); message.spendLimit = @@ -126,13 +126,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/deployment.ts b/ts/src/generated/akash/deployment/v1beta2/deployment.ts index 556ff843..e46584bf 100644 --- a/ts/src/generated/akash/deployment/v1beta2/deployment.ts +++ b/ts/src/generated/akash/deployment/v1beta2/deployment.ts @@ -146,14 +146,10 @@ export const DeploymentID = { return obj; }, - create, I>>( - base?: I, - ): DeploymentID { - return DeploymentID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DeploymentID { + return DeploymentID.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DeploymentID { + fromPartial(object: DeepPartial): DeploymentID { const message = createBaseDeploymentID(); message.owner = object.owner ?? ''; message.dseq = @@ -279,12 +275,10 @@ export const Deployment = { return obj; }, - create, I>>(base?: I): Deployment { - return Deployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Deployment { + return Deployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Deployment { + fromPartial(object: DeepPartial): Deployment { const message = createBaseDeployment(); message.deploymentId = object.deploymentId !== undefined && object.deploymentId !== null @@ -391,14 +385,10 @@ export const DeploymentFilters = { return obj; }, - create, I>>( - base?: I, - ): DeploymentFilters { - return DeploymentFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DeploymentFilters { + return DeploymentFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DeploymentFilters { + fromPartial(object: DeepPartial): DeploymentFilters { const message = createBaseDeploymentFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -458,13 +448,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts b/ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts index ac7cf0ea..6f5526cf 100644 --- a/ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts +++ b/ts/src/generated/akash/deployment/v1beta2/deploymentmsg.ts @@ -188,14 +188,10 @@ export const MsgCreateDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateDeployment { - return MsgCreateDeployment.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MsgCreateDeployment { + create(base?: DeepPartial): MsgCreateDeployment { + return MsgCreateDeployment.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MsgCreateDeployment { const message = createBaseMsgCreateDeployment(); message.id = object.id !== undefined && object.id !== null @@ -257,13 +253,13 @@ export const MsgCreateDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateDeploymentResponse { - return MsgCreateDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgCreateDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateDeploymentResponse { const message = createBaseMsgCreateDeploymentResponse(); return message; @@ -369,14 +365,10 @@ export const MsgDepositDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgDepositDeployment { - return MsgDepositDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgDepositDeployment { + return MsgDepositDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgDepositDeployment { + fromPartial(object: DeepPartial): MsgDepositDeployment { const message = createBaseMsgDepositDeployment(); message.id = object.id !== undefined && object.id !== null @@ -436,13 +428,13 @@ export const MsgDepositDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDepositDeploymentResponse { - return MsgDepositDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgDepositDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgDepositDeploymentResponse { const message = createBaseMsgDepositDeploymentResponse(); return message; @@ -530,14 +522,10 @@ export const MsgUpdateDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgUpdateDeployment { - return MsgUpdateDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgUpdateDeployment { + return MsgUpdateDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgUpdateDeployment { + fromPartial(object: DeepPartial): MsgUpdateDeployment { const message = createBaseMsgUpdateDeployment(); message.id = object.id !== undefined && object.id !== null @@ -593,13 +581,13 @@ export const MsgUpdateDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgUpdateDeploymentResponse { - return MsgUpdateDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgUpdateDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgUpdateDeploymentResponse { const message = createBaseMsgUpdateDeploymentResponse(); return message; @@ -670,14 +658,10 @@ export const MsgCloseDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseDeployment { - return MsgCloseDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseDeployment { + return MsgCloseDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseDeployment { + fromPartial(object: DeepPartial): MsgCloseDeployment { const message = createBaseMsgCloseDeployment(); message.id = object.id !== undefined && object.id !== null @@ -732,13 +716,13 @@ export const MsgCloseDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCloseDeploymentResponse { - return MsgCloseDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgCloseDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCloseDeploymentResponse { const message = createBaseMsgCloseDeploymentResponse(); return message; @@ -796,13 +780,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/genesis.ts b/ts/src/generated/akash/deployment/v1beta2/genesis.ts index 8e52c5b5..2415ca4a 100644 --- a/ts/src/generated/akash/deployment/v1beta2/genesis.ts +++ b/ts/src/generated/akash/deployment/v1beta2/genesis.ts @@ -100,14 +100,10 @@ export const GenesisDeployment = { return obj; }, - create, I>>( - base?: I, - ): GenesisDeployment { - return GenesisDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisDeployment { + return GenesisDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisDeployment { + fromPartial(object: DeepPartial): GenesisDeployment { const message = createBaseGenesisDeployment(); message.deployment = object.deployment !== undefined && object.deployment !== null @@ -200,14 +196,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.deployments = object.deployments?.map((e) => GenesisDeployment.fromPartial(e)) || []; @@ -242,13 +234,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/group.ts b/ts/src/generated/akash/deployment/v1beta2/group.ts index 51868672..fcb7aedf 100644 --- a/ts/src/generated/akash/deployment/v1beta2/group.ts +++ b/ts/src/generated/akash/deployment/v1beta2/group.ts @@ -180,10 +180,10 @@ export const Group = { return obj; }, - create, I>>(base?: I): Group { - return Group.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Group { + return Group.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Group { + fromPartial(object: DeepPartial): Group { const message = createBaseGroup(); message.groupId = object.groupId !== undefined && object.groupId !== null @@ -225,13 +225,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/groupid.ts b/ts/src/generated/akash/deployment/v1beta2/groupid.ts index 7d93a9fb..74230212 100644 --- a/ts/src/generated/akash/deployment/v1beta2/groupid.ts +++ b/ts/src/generated/akash/deployment/v1beta2/groupid.ts @@ -102,10 +102,10 @@ export const GroupID = { return obj; }, - create, I>>(base?: I): GroupID { - return GroupID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GroupID { + return GroupID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): GroupID { + fromPartial(object: DeepPartial): GroupID { const message = createBaseGroupID(); message.owner = object.owner ?? ''; message.dseq = @@ -140,13 +140,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/groupmsg.ts b/ts/src/generated/akash/deployment/v1beta2/groupmsg.ts index 24e88544..7ae24839 100644 --- a/ts/src/generated/akash/deployment/v1beta2/groupmsg.ts +++ b/ts/src/generated/akash/deployment/v1beta2/groupmsg.ts @@ -95,14 +95,10 @@ export const MsgCloseGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseGroup { - return MsgCloseGroup.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MsgCloseGroup { + create(base?: DeepPartial): MsgCloseGroup { + return MsgCloseGroup.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MsgCloseGroup { const message = createBaseMsgCloseGroup(); message.id = object.id !== undefined && object.id !== null @@ -157,14 +153,10 @@ export const MsgCloseGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseGroupResponse { - return MsgCloseGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseGroupResponse { + return MsgCloseGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseGroupResponse { + fromPartial(_: DeepPartial): MsgCloseGroupResponse { const message = createBaseMsgCloseGroupResponse(); return message; }, @@ -228,14 +220,10 @@ export const MsgPauseGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgPauseGroup { - return MsgPauseGroup.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgPauseGroup { + return MsgPauseGroup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgPauseGroup { + fromPartial(object: DeepPartial): MsgPauseGroup { const message = createBaseMsgPauseGroup(); message.id = object.id !== undefined && object.id !== null @@ -290,14 +278,10 @@ export const MsgPauseGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgPauseGroupResponse { - return MsgPauseGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgPauseGroupResponse { + return MsgPauseGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgPauseGroupResponse { + fromPartial(_: DeepPartial): MsgPauseGroupResponse { const message = createBaseMsgPauseGroupResponse(); return message; }, @@ -361,14 +345,10 @@ export const MsgStartGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgStartGroup { - return MsgStartGroup.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgStartGroup { + return MsgStartGroup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgStartGroup { + fromPartial(object: DeepPartial): MsgStartGroup { const message = createBaseMsgStartGroup(); message.id = object.id !== undefined && object.id !== null @@ -423,14 +403,10 @@ export const MsgStartGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgStartGroupResponse { - return MsgStartGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgStartGroupResponse { + return MsgStartGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgStartGroupResponse { + fromPartial(_: DeepPartial): MsgStartGroupResponse { const message = createBaseMsgStartGroupResponse(); return message; }, @@ -459,13 +435,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/groupspec.ts b/ts/src/generated/akash/deployment/v1beta2/groupspec.ts index d9d49b1e..f2094b23 100644 --- a/ts/src/generated/akash/deployment/v1beta2/groupspec.ts +++ b/ts/src/generated/akash/deployment/v1beta2/groupspec.ts @@ -114,12 +114,10 @@ export const GroupSpec = { return obj; }, - create, I>>(base?: I): GroupSpec { - return GroupSpec.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GroupSpec { + return GroupSpec.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GroupSpec { + fromPartial(object: DeepPartial): GroupSpec { const message = createBaseGroupSpec(); message.name = object.name ?? ''; message.requirements = @@ -155,13 +153,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/params.ts b/ts/src/generated/akash/deployment/v1beta2/params.ts index 999e9128..2f6cc13e 100644 --- a/ts/src/generated/akash/deployment/v1beta2/params.ts +++ b/ts/src/generated/akash/deployment/v1beta2/params.ts @@ -76,10 +76,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.deploymentMinDeposit = object.deploymentMinDeposit !== undefined && @@ -113,13 +113,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/query.ts b/ts/src/generated/akash/deployment/v1beta2/query.ts index dd08bfaa..f7e37b2d 100644 --- a/ts/src/generated/akash/deployment/v1beta2/query.ts +++ b/ts/src/generated/akash/deployment/v1beta2/query.ts @@ -137,13 +137,11 @@ export const QueryDeploymentsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentsRequest { - return QueryDeploymentsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentsRequest { + return QueryDeploymentsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentsRequest { const message = createBaseQueryDeploymentsRequest(); message.filters = @@ -250,13 +248,13 @@ export const QueryDeploymentsResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryDeploymentsResponse { - return QueryDeploymentsResponse.fromPartial(base ?? ({} as any)); + return QueryDeploymentsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentsResponse { const message = createBaseQueryDeploymentsResponse(); message.deployments = @@ -337,13 +335,11 @@ export const QueryDeploymentRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentRequest { - return QueryDeploymentRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentRequest { + return QueryDeploymentRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentRequest { const message = createBaseQueryDeploymentRequest(); message.id = @@ -454,13 +450,11 @@ export const QueryDeploymentResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentResponse { - return QueryDeploymentResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentResponse { + return QueryDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentResponse { const message = createBaseQueryDeploymentResponse(); message.deployment = @@ -534,14 +528,10 @@ export const QueryGroupRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryGroupRequest { - return QueryGroupRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryGroupRequest { + return QueryGroupRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryGroupRequest { + fromPartial(object: DeepPartial): QueryGroupRequest { const message = createBaseQueryGroupRequest(); message.id = object.id !== undefined && object.id !== null @@ -612,14 +602,10 @@ export const QueryGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryGroupResponse { - return QueryGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryGroupResponse { + return QueryGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryGroupResponse { + fromPartial(object: DeepPartial): QueryGroupResponse { const message = createBaseQueryGroupResponse(); message.group = object.group !== undefined && object.group !== null @@ -712,13 +698,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta2/resource.ts b/ts/src/generated/akash/deployment/v1beta2/resource.ts index 06dc3d08..91e0195b 100644 --- a/ts/src/generated/akash/deployment/v1beta2/resource.ts +++ b/ts/src/generated/akash/deployment/v1beta2/resource.ts @@ -109,10 +109,10 @@ export const Resource = { return obj; }, - create, I>>(base?: I): Resource { - return Resource.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Resource { + return Resource.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Resource { + fromPartial(object: DeepPartial): Resource { const message = createBaseResource(); message.resources = object.resources !== undefined && object.resources !== null @@ -150,13 +150,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/authz.ts b/ts/src/generated/akash/deployment/v1beta3/authz.ts index fb401a29..1fd98494 100644 --- a/ts/src/generated/akash/deployment/v1beta3/authz.ts +++ b/ts/src/generated/akash/deployment/v1beta3/authz.ts @@ -83,13 +83,13 @@ export const DepositDeploymentAuthorization = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): DepositDeploymentAuthorization { - return DepositDeploymentAuthorization.fromPartial(base ?? ({} as any)); + return DepositDeploymentAuthorization.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): DepositDeploymentAuthorization { const message = createBaseDepositDeploymentAuthorization(); message.spendLimit = @@ -126,13 +126,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/deployment.ts b/ts/src/generated/akash/deployment/v1beta3/deployment.ts index 2778ef37..12cf15bf 100644 --- a/ts/src/generated/akash/deployment/v1beta3/deployment.ts +++ b/ts/src/generated/akash/deployment/v1beta3/deployment.ts @@ -146,14 +146,10 @@ export const DeploymentID = { return obj; }, - create, I>>( - base?: I, - ): DeploymentID { - return DeploymentID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DeploymentID { + return DeploymentID.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DeploymentID { + fromPartial(object: DeepPartial): DeploymentID { const message = createBaseDeploymentID(); message.owner = object.owner ?? ''; message.dseq = @@ -279,12 +275,10 @@ export const Deployment = { return obj; }, - create, I>>(base?: I): Deployment { - return Deployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Deployment { + return Deployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Deployment { + fromPartial(object: DeepPartial): Deployment { const message = createBaseDeployment(); message.deploymentId = object.deploymentId !== undefined && object.deploymentId !== null @@ -391,14 +385,10 @@ export const DeploymentFilters = { return obj; }, - create, I>>( - base?: I, - ): DeploymentFilters { - return DeploymentFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DeploymentFilters { + return DeploymentFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DeploymentFilters { + fromPartial(object: DeepPartial): DeploymentFilters { const message = createBaseDeploymentFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -458,13 +448,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts b/ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts index 1775cbe9..d0e18c2b 100644 --- a/ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts +++ b/ts/src/generated/akash/deployment/v1beta3/deploymentmsg.ts @@ -188,14 +188,10 @@ export const MsgCreateDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateDeployment { - return MsgCreateDeployment.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MsgCreateDeployment { + create(base?: DeepPartial): MsgCreateDeployment { + return MsgCreateDeployment.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MsgCreateDeployment { const message = createBaseMsgCreateDeployment(); message.id = object.id !== undefined && object.id !== null @@ -257,13 +253,13 @@ export const MsgCreateDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateDeploymentResponse { - return MsgCreateDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgCreateDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateDeploymentResponse { const message = createBaseMsgCreateDeploymentResponse(); return message; @@ -369,14 +365,10 @@ export const MsgDepositDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgDepositDeployment { - return MsgDepositDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgDepositDeployment { + return MsgDepositDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgDepositDeployment { + fromPartial(object: DeepPartial): MsgDepositDeployment { const message = createBaseMsgDepositDeployment(); message.id = object.id !== undefined && object.id !== null @@ -436,13 +428,13 @@ export const MsgDepositDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDepositDeploymentResponse { - return MsgDepositDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgDepositDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgDepositDeploymentResponse { const message = createBaseMsgDepositDeploymentResponse(); return message; @@ -530,14 +522,10 @@ export const MsgUpdateDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgUpdateDeployment { - return MsgUpdateDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgUpdateDeployment { + return MsgUpdateDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgUpdateDeployment { + fromPartial(object: DeepPartial): MsgUpdateDeployment { const message = createBaseMsgUpdateDeployment(); message.id = object.id !== undefined && object.id !== null @@ -593,13 +581,13 @@ export const MsgUpdateDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgUpdateDeploymentResponse { - return MsgUpdateDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgUpdateDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgUpdateDeploymentResponse { const message = createBaseMsgUpdateDeploymentResponse(); return message; @@ -670,14 +658,10 @@ export const MsgCloseDeployment = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseDeployment { - return MsgCloseDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseDeployment { + return MsgCloseDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseDeployment { + fromPartial(object: DeepPartial): MsgCloseDeployment { const message = createBaseMsgCloseDeployment(); message.id = object.id !== undefined && object.id !== null @@ -732,13 +716,13 @@ export const MsgCloseDeploymentResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCloseDeploymentResponse { - return MsgCloseDeploymentResponse.fromPartial(base ?? ({} as any)); + return MsgCloseDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCloseDeploymentResponse { const message = createBaseMsgCloseDeploymentResponse(); return message; @@ -796,13 +780,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/genesis.ts b/ts/src/generated/akash/deployment/v1beta3/genesis.ts index 925add51..bea9dce1 100644 --- a/ts/src/generated/akash/deployment/v1beta3/genesis.ts +++ b/ts/src/generated/akash/deployment/v1beta3/genesis.ts @@ -100,14 +100,10 @@ export const GenesisDeployment = { return obj; }, - create, I>>( - base?: I, - ): GenesisDeployment { - return GenesisDeployment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisDeployment { + return GenesisDeployment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisDeployment { + fromPartial(object: DeepPartial): GenesisDeployment { const message = createBaseGenesisDeployment(); message.deployment = object.deployment !== undefined && object.deployment !== null @@ -200,14 +196,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.deployments = object.deployments?.map((e) => GenesisDeployment.fromPartial(e)) || []; @@ -242,13 +234,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/group.ts b/ts/src/generated/akash/deployment/v1beta3/group.ts index d744379f..7f9a087c 100644 --- a/ts/src/generated/akash/deployment/v1beta3/group.ts +++ b/ts/src/generated/akash/deployment/v1beta3/group.ts @@ -180,10 +180,10 @@ export const Group = { return obj; }, - create, I>>(base?: I): Group { - return Group.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Group { + return Group.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Group { + fromPartial(object: DeepPartial): Group { const message = createBaseGroup(); message.groupId = object.groupId !== undefined && object.groupId !== null @@ -225,13 +225,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/groupid.ts b/ts/src/generated/akash/deployment/v1beta3/groupid.ts index 5cf0baf4..ba6d1657 100644 --- a/ts/src/generated/akash/deployment/v1beta3/groupid.ts +++ b/ts/src/generated/akash/deployment/v1beta3/groupid.ts @@ -102,10 +102,10 @@ export const GroupID = { return obj; }, - create, I>>(base?: I): GroupID { - return GroupID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GroupID { + return GroupID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): GroupID { + fromPartial(object: DeepPartial): GroupID { const message = createBaseGroupID(); message.owner = object.owner ?? ''; message.dseq = @@ -140,13 +140,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/groupmsg.ts b/ts/src/generated/akash/deployment/v1beta3/groupmsg.ts index 4cd8f18e..e7c8a149 100644 --- a/ts/src/generated/akash/deployment/v1beta3/groupmsg.ts +++ b/ts/src/generated/akash/deployment/v1beta3/groupmsg.ts @@ -95,14 +95,10 @@ export const MsgCloseGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseGroup { - return MsgCloseGroup.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MsgCloseGroup { + create(base?: DeepPartial): MsgCloseGroup { + return MsgCloseGroup.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MsgCloseGroup { const message = createBaseMsgCloseGroup(); message.id = object.id !== undefined && object.id !== null @@ -157,14 +153,10 @@ export const MsgCloseGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseGroupResponse { - return MsgCloseGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseGroupResponse { + return MsgCloseGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseGroupResponse { + fromPartial(_: DeepPartial): MsgCloseGroupResponse { const message = createBaseMsgCloseGroupResponse(); return message; }, @@ -228,14 +220,10 @@ export const MsgPauseGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgPauseGroup { - return MsgPauseGroup.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgPauseGroup { + return MsgPauseGroup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgPauseGroup { + fromPartial(object: DeepPartial): MsgPauseGroup { const message = createBaseMsgPauseGroup(); message.id = object.id !== undefined && object.id !== null @@ -290,14 +278,10 @@ export const MsgPauseGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgPauseGroupResponse { - return MsgPauseGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgPauseGroupResponse { + return MsgPauseGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgPauseGroupResponse { + fromPartial(_: DeepPartial): MsgPauseGroupResponse { const message = createBaseMsgPauseGroupResponse(); return message; }, @@ -361,14 +345,10 @@ export const MsgStartGroup = { return obj; }, - create, I>>( - base?: I, - ): MsgStartGroup { - return MsgStartGroup.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgStartGroup { + return MsgStartGroup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgStartGroup { + fromPartial(object: DeepPartial): MsgStartGroup { const message = createBaseMsgStartGroup(); message.id = object.id !== undefined && object.id !== null @@ -423,14 +403,10 @@ export const MsgStartGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgStartGroupResponse { - return MsgStartGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgStartGroupResponse { + return MsgStartGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgStartGroupResponse { + fromPartial(_: DeepPartial): MsgStartGroupResponse { const message = createBaseMsgStartGroupResponse(); return message; }, @@ -459,13 +435,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/groupspec.ts b/ts/src/generated/akash/deployment/v1beta3/groupspec.ts index 43747a0c..8302313f 100644 --- a/ts/src/generated/akash/deployment/v1beta3/groupspec.ts +++ b/ts/src/generated/akash/deployment/v1beta3/groupspec.ts @@ -114,12 +114,10 @@ export const GroupSpec = { return obj; }, - create, I>>(base?: I): GroupSpec { - return GroupSpec.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GroupSpec { + return GroupSpec.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GroupSpec { + fromPartial(object: DeepPartial): GroupSpec { const message = createBaseGroupSpec(); message.name = object.name ?? ''; message.requirements = @@ -155,13 +153,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/params.ts b/ts/src/generated/akash/deployment/v1beta3/params.ts index 91e888d0..146566ef 100644 --- a/ts/src/generated/akash/deployment/v1beta3/params.ts +++ b/ts/src/generated/akash/deployment/v1beta3/params.ts @@ -70,10 +70,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.minDeposits = object.minDeposits?.map((e) => Coin.fromPartial(e)) || []; @@ -104,13 +104,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/query.ts b/ts/src/generated/akash/deployment/v1beta3/query.ts index 44bbc6e7..6d812e58 100644 --- a/ts/src/generated/akash/deployment/v1beta3/query.ts +++ b/ts/src/generated/akash/deployment/v1beta3/query.ts @@ -137,13 +137,11 @@ export const QueryDeploymentsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentsRequest { - return QueryDeploymentsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentsRequest { + return QueryDeploymentsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentsRequest { const message = createBaseQueryDeploymentsRequest(); message.filters = @@ -250,13 +248,13 @@ export const QueryDeploymentsResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): QueryDeploymentsResponse { - return QueryDeploymentsResponse.fromPartial(base ?? ({} as any)); + return QueryDeploymentsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentsResponse { const message = createBaseQueryDeploymentsResponse(); message.deployments = @@ -337,13 +335,11 @@ export const QueryDeploymentRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentRequest { - return QueryDeploymentRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentRequest { + return QueryDeploymentRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentRequest { const message = createBaseQueryDeploymentRequest(); message.id = @@ -454,13 +450,11 @@ export const QueryDeploymentResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryDeploymentResponse { - return QueryDeploymentResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryDeploymentResponse { + return QueryDeploymentResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryDeploymentResponse { const message = createBaseQueryDeploymentResponse(); message.deployment = @@ -534,14 +528,10 @@ export const QueryGroupRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryGroupRequest { - return QueryGroupRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryGroupRequest { + return QueryGroupRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryGroupRequest { + fromPartial(object: DeepPartial): QueryGroupRequest { const message = createBaseQueryGroupRequest(); message.id = object.id !== undefined && object.id !== null @@ -612,14 +602,10 @@ export const QueryGroupResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryGroupResponse { - return QueryGroupResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryGroupResponse { + return QueryGroupResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryGroupResponse { + fromPartial(object: DeepPartial): QueryGroupResponse { const message = createBaseQueryGroupResponse(); message.group = object.group !== undefined && object.group !== null @@ -712,13 +698,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/deployment/v1beta3/resourceunit.ts b/ts/src/generated/akash/deployment/v1beta3/resourceunit.ts index 6bab1922..d0e47f29 100644 --- a/ts/src/generated/akash/deployment/v1beta3/resourceunit.ts +++ b/ts/src/generated/akash/deployment/v1beta3/resourceunit.ts @@ -106,14 +106,10 @@ export const ResourceUnit = { return obj; }, - create, I>>( - base?: I, - ): ResourceUnit { - return ResourceUnit.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourceUnit { + return ResourceUnit.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourceUnit { + fromPartial(object: DeepPartial): ResourceUnit { const message = createBaseResourceUnit(); message.resource = object.resource !== undefined && object.resource !== null @@ -151,13 +147,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/discovery/v1/akash.ts b/ts/src/generated/akash/discovery/v1/akash.ts index 325aba5c..20e7c4ed 100644 --- a/ts/src/generated/akash/discovery/v1/akash.ts +++ b/ts/src/generated/akash/discovery/v1/akash.ts @@ -67,10 +67,10 @@ export const Akash = { return obj; }, - create, I>>(base?: I): Akash { - return Akash.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Akash { + return Akash.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Akash { + fromPartial(object: DeepPartial): Akash { const message = createBaseAkash(); message.clientInfo = object.clientInfo !== undefined && object.clientInfo !== null @@ -103,13 +103,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/discovery/v1/client_info.ts b/ts/src/generated/akash/discovery/v1/client_info.ts index f7be020e..de20559f 100644 --- a/ts/src/generated/akash/discovery/v1/client_info.ts +++ b/ts/src/generated/akash/discovery/v1/client_info.ts @@ -69,12 +69,10 @@ export const ClientInfo = { return obj; }, - create, I>>(base?: I): ClientInfo { - return ClientInfo.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ClientInfo { + return ClientInfo.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ClientInfo { + fromPartial(object: DeepPartial): ClientInfo { const message = createBaseClientInfo(); message.apiVersion = object.apiVersion ?? ''; return message; @@ -104,13 +102,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta1/genesis.ts b/ts/src/generated/akash/escrow/v1beta1/genesis.ts index 8628a1b7..4eb4badb 100644 --- a/ts/src/generated/akash/escrow/v1beta1/genesis.ts +++ b/ts/src/generated/akash/escrow/v1beta1/genesis.ts @@ -91,14 +91,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.accounts = object.accounts?.map((e) => Account.fromPartial(e)) || []; @@ -131,13 +127,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta1/query.ts b/ts/src/generated/akash/escrow/v1beta1/query.ts index 030e7695..b3666ea5 100644 --- a/ts/src/generated/akash/escrow/v1beta1/query.ts +++ b/ts/src/generated/akash/escrow/v1beta1/query.ts @@ -169,14 +169,10 @@ export const QueryAccountsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryAccountsRequest { - return QueryAccountsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryAccountsRequest { + return QueryAccountsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryAccountsRequest { + fromPartial(object: DeepPartial): QueryAccountsRequest { const message = createBaseQueryAccountsRequest(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -276,13 +272,11 @@ export const QueryAccountsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryAccountsResponse { - return QueryAccountsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryAccountsResponse { + return QueryAccountsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryAccountsResponse { const message = createBaseQueryAccountsResponse(); message.accounts = @@ -436,14 +430,10 @@ export const QueryPaymentsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryPaymentsRequest { - return QueryPaymentsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryPaymentsRequest { + return QueryPaymentsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryPaymentsRequest { + fromPartial(object: DeepPartial): QueryPaymentsRequest { const message = createBaseQueryPaymentsRequest(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -544,13 +534,11 @@ export const QueryPaymentsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryPaymentsResponse { - return QueryPaymentsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryPaymentsResponse { + return QueryPaymentsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryPaymentsResponse { const message = createBaseQueryPaymentsResponse(); message.payments = @@ -637,13 +625,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta1/types.ts b/ts/src/generated/akash/escrow/v1beta1/types.ts index 00cc2862..ee04e21a 100644 --- a/ts/src/generated/akash/escrow/v1beta1/types.ts +++ b/ts/src/generated/akash/escrow/v1beta1/types.ts @@ -212,12 +212,10 @@ export const AccountID = { return obj; }, - create, I>>(base?: I): AccountID { - return AccountID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AccountID { + return AccountID.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AccountID { + fromPartial(object: DeepPartial): AccountID { const message = createBaseAccountID(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -367,10 +365,10 @@ export const Account = { return obj; }, - create, I>>(base?: I): Account { - return Account.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Account { + return Account.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Account { + fromPartial(object: DeepPartial): Account { const message = createBaseAccount(); message.id = object.id !== undefined && object.id !== null @@ -553,10 +551,10 @@ export const Payment = { return obj; }, - create, I>>(base?: I): Payment { - return Payment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Payment { + return Payment.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Payment { + fromPartial(object: DeepPartial): Payment { const message = createBasePayment(); message.accountId = object.accountId !== undefined && object.accountId !== null @@ -604,13 +602,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta2/genesis.ts b/ts/src/generated/akash/escrow/v1beta2/genesis.ts index 99ee67f3..6d420654 100644 --- a/ts/src/generated/akash/escrow/v1beta2/genesis.ts +++ b/ts/src/generated/akash/escrow/v1beta2/genesis.ts @@ -93,14 +93,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.accounts = object.accounts?.map((e) => Account.fromPartial(e)) || []; @@ -133,13 +129,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta2/query.ts b/ts/src/generated/akash/escrow/v1beta2/query.ts index dba8c198..4c8ee966 100644 --- a/ts/src/generated/akash/escrow/v1beta2/query.ts +++ b/ts/src/generated/akash/escrow/v1beta2/query.ts @@ -169,14 +169,10 @@ export const QueryAccountsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryAccountsRequest { - return QueryAccountsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryAccountsRequest { + return QueryAccountsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryAccountsRequest { + fromPartial(object: DeepPartial): QueryAccountsRequest { const message = createBaseQueryAccountsRequest(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -276,13 +272,11 @@ export const QueryAccountsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryAccountsResponse { - return QueryAccountsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryAccountsResponse { + return QueryAccountsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryAccountsResponse { const message = createBaseQueryAccountsResponse(); message.accounts = @@ -436,14 +430,10 @@ export const QueryPaymentsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryPaymentsRequest { - return QueryPaymentsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryPaymentsRequest { + return QueryPaymentsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryPaymentsRequest { + fromPartial(object: DeepPartial): QueryPaymentsRequest { const message = createBaseQueryPaymentsRequest(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -546,13 +536,11 @@ export const QueryPaymentsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryPaymentsResponse { - return QueryPaymentsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryPaymentsResponse { + return QueryPaymentsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryPaymentsResponse { const message = createBaseQueryPaymentsResponse(); message.payments = @@ -639,13 +627,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta2/types.ts b/ts/src/generated/akash/escrow/v1beta2/types.ts index 22c8a32e..0461522d 100644 --- a/ts/src/generated/akash/escrow/v1beta2/types.ts +++ b/ts/src/generated/akash/escrow/v1beta2/types.ts @@ -227,12 +227,10 @@ export const AccountID = { return obj; }, - create, I>>(base?: I): AccountID { - return AccountID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AccountID { + return AccountID.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AccountID { + fromPartial(object: DeepPartial): AccountID { const message = createBaseAccountID(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -414,10 +412,10 @@ export const Account = { return obj; }, - create, I>>(base?: I): Account { - return Account.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Account { + return Account.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Account { + fromPartial(object: DeepPartial): Account { const message = createBaseAccount(); message.id = object.id !== undefined && object.id !== null @@ -607,14 +605,10 @@ export const FractionalPayment = { return obj; }, - create, I>>( - base?: I, - ): FractionalPayment { - return FractionalPayment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): FractionalPayment { + return FractionalPayment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): FractionalPayment { + fromPartial(object: DeepPartial): FractionalPayment { const message = createBaseFractionalPayment(); message.accountId = object.accountId !== undefined && object.accountId !== null @@ -662,13 +656,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta3/genesis.ts b/ts/src/generated/akash/escrow/v1beta3/genesis.ts index 140fc9ca..9392b5c0 100644 --- a/ts/src/generated/akash/escrow/v1beta3/genesis.ts +++ b/ts/src/generated/akash/escrow/v1beta3/genesis.ts @@ -93,14 +93,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.accounts = object.accounts?.map((e) => Account.fromPartial(e)) || []; @@ -133,13 +129,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta3/query.ts b/ts/src/generated/akash/escrow/v1beta3/query.ts index b423a71a..18e34850 100644 --- a/ts/src/generated/akash/escrow/v1beta3/query.ts +++ b/ts/src/generated/akash/escrow/v1beta3/query.ts @@ -169,14 +169,10 @@ export const QueryAccountsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryAccountsRequest { - return QueryAccountsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryAccountsRequest { + return QueryAccountsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryAccountsRequest { + fromPartial(object: DeepPartial): QueryAccountsRequest { const message = createBaseQueryAccountsRequest(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -276,13 +272,11 @@ export const QueryAccountsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryAccountsResponse { - return QueryAccountsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryAccountsResponse { + return QueryAccountsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryAccountsResponse { const message = createBaseQueryAccountsResponse(); message.accounts = @@ -436,14 +430,10 @@ export const QueryPaymentsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryPaymentsRequest { - return QueryPaymentsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryPaymentsRequest { + return QueryPaymentsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryPaymentsRequest { + fromPartial(object: DeepPartial): QueryPaymentsRequest { const message = createBaseQueryPaymentsRequest(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -546,13 +536,11 @@ export const QueryPaymentsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryPaymentsResponse { - return QueryPaymentsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryPaymentsResponse { + return QueryPaymentsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryPaymentsResponse { const message = createBaseQueryPaymentsResponse(); message.payments = @@ -639,13 +627,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/escrow/v1beta3/types.ts b/ts/src/generated/akash/escrow/v1beta3/types.ts index bf31521a..f29a7441 100644 --- a/ts/src/generated/akash/escrow/v1beta3/types.ts +++ b/ts/src/generated/akash/escrow/v1beta3/types.ts @@ -227,12 +227,10 @@ export const AccountID = { return obj; }, - create, I>>(base?: I): AccountID { - return AccountID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): AccountID { + return AccountID.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): AccountID { + fromPartial(object: DeepPartial): AccountID { const message = createBaseAccountID(); message.scope = object.scope ?? ''; message.xid = object.xid ?? ''; @@ -414,10 +412,10 @@ export const Account = { return obj; }, - create, I>>(base?: I): Account { - return Account.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Account { + return Account.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Account { + fromPartial(object: DeepPartial): Account { const message = createBaseAccount(); message.id = object.id !== undefined && object.id !== null @@ -607,14 +605,10 @@ export const FractionalPayment = { return obj; }, - create, I>>( - base?: I, - ): FractionalPayment { - return FractionalPayment.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): FractionalPayment { + return FractionalPayment.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): FractionalPayment { + fromPartial(object: DeepPartial): FractionalPayment { const message = createBaseFractionalPayment(); message.accountId = object.accountId !== undefined && object.accountId !== null @@ -662,13 +656,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/gov/v1beta3/genesis.ts b/ts/src/generated/akash/gov/v1beta3/genesis.ts index a95db386..72b9d561 100644 --- a/ts/src/generated/akash/gov/v1beta3/genesis.ts +++ b/ts/src/generated/akash/gov/v1beta3/genesis.ts @@ -73,14 +73,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.depositParams = object.depositParams !== undefined && object.depositParams !== null @@ -113,13 +109,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/gov/v1beta3/params.ts b/ts/src/generated/akash/gov/v1beta3/params.ts index e1c7a60f..07d57909 100644 --- a/ts/src/generated/akash/gov/v1beta3/params.ts +++ b/ts/src/generated/akash/gov/v1beta3/params.ts @@ -78,14 +78,10 @@ export const DepositParams = { return obj; }, - create, I>>( - base?: I, - ): DepositParams { - return DepositParams.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DepositParams { + return DepositParams.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DepositParams { + fromPartial(object: DeepPartial): DepositParams { const message = createBaseDepositParams(); message.minInitialDepositRate = object.minInitialDepositRate ?? new Uint8Array(0); @@ -141,13 +137,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inflation/v1beta2/genesis.ts b/ts/src/generated/akash/inflation/v1beta2/genesis.ts index 8cb2f979..482de675 100644 --- a/ts/src/generated/akash/inflation/v1beta2/genesis.ts +++ b/ts/src/generated/akash/inflation/v1beta2/genesis.ts @@ -68,14 +68,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null @@ -108,13 +104,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inflation/v1beta2/params.ts b/ts/src/generated/akash/inflation/v1beta2/params.ts index fe4d995e..49706e5a 100644 --- a/ts/src/generated/akash/inflation/v1beta2/params.ts +++ b/ts/src/generated/akash/inflation/v1beta2/params.ts @@ -117,10 +117,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.inflationDecayFactor = object.inflationDecayFactor ?? ''; message.initialInflation = object.initialInflation ?? ''; @@ -152,13 +152,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inflation/v1beta3/genesis.ts b/ts/src/generated/akash/inflation/v1beta3/genesis.ts index 3d4af425..ad7572e8 100644 --- a/ts/src/generated/akash/inflation/v1beta3/genesis.ts +++ b/ts/src/generated/akash/inflation/v1beta3/genesis.ts @@ -68,14 +68,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null @@ -108,13 +104,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inflation/v1beta3/params.ts b/ts/src/generated/akash/inflation/v1beta3/params.ts index b203eed4..535ab473 100644 --- a/ts/src/generated/akash/inflation/v1beta3/params.ts +++ b/ts/src/generated/akash/inflation/v1beta3/params.ts @@ -117,10 +117,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.inflationDecayFactor = object.inflationDecayFactor ?? ''; message.initialInflation = object.initialInflation ?? ''; @@ -152,13 +152,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/cluster.ts b/ts/src/generated/akash/inventory/v1/cluster.ts index 2dbf268c..6604afa4 100644 --- a/ts/src/generated/akash/inventory/v1/cluster.ts +++ b/ts/src/generated/akash/inventory/v1/cluster.ts @@ -88,10 +88,10 @@ export const Cluster = { return obj; }, - create, I>>(base?: I): Cluster { - return Cluster.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Cluster { + return Cluster.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Cluster { + fromPartial(object: DeepPartial): Cluster { const message = createBaseCluster(); message.nodes = object.nodes?.map((e) => Node.fromPartial(e)) || []; message.storage = object.storage?.map((e) => Storage.fromPartial(e)) || []; @@ -122,13 +122,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/cpu.ts b/ts/src/generated/akash/inventory/v1/cpu.ts index 13b2f32d..bdbee629 100644 --- a/ts/src/generated/akash/inventory/v1/cpu.ts +++ b/ts/src/generated/akash/inventory/v1/cpu.ts @@ -126,10 +126,10 @@ export const CPUInfo = { return obj; }, - create, I>>(base?: I): CPUInfo { - return CPUInfo.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CPUInfo { + return CPUInfo.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): CPUInfo { + fromPartial(object: DeepPartial): CPUInfo { const message = createBaseCPUInfo(); message.id = object.id ?? ''; message.vendor = object.vendor ?? ''; @@ -212,10 +212,10 @@ export const CPU = { return obj; }, - create, I>>(base?: I): CPU { - return CPU.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CPU { + return CPU.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): CPU { + fromPartial(object: DeepPartial): CPU { const message = createBaseCPU(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -249,13 +249,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/gpu.ts b/ts/src/generated/akash/inventory/v1/gpu.ts index 138f5d6e..5543ab00 100644 --- a/ts/src/generated/akash/inventory/v1/gpu.ts +++ b/ts/src/generated/akash/inventory/v1/gpu.ts @@ -164,10 +164,10 @@ export const GPUInfo = { return obj; }, - create, I>>(base?: I): GPUInfo { - return GPUInfo.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GPUInfo { + return GPUInfo.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): GPUInfo { + fromPartial(object: DeepPartial): GPUInfo { const message = createBaseGPUInfo(); message.vendor = object.vendor ?? ''; message.vendorId = object.vendorId ?? ''; @@ -252,10 +252,10 @@ export const GPU = { return obj; }, - create, I>>(base?: I): GPU { - return GPU.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GPU { + return GPU.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): GPU { + fromPartial(object: DeepPartial): GPU { const message = createBaseGPU(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -289,13 +289,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/memory.ts b/ts/src/generated/akash/inventory/v1/memory.ts index df268706..60cc4123 100644 --- a/ts/src/generated/akash/inventory/v1/memory.ts +++ b/ts/src/generated/akash/inventory/v1/memory.ts @@ -128,12 +128,10 @@ export const MemoryInfo = { return obj; }, - create, I>>(base?: I): MemoryInfo { - return MemoryInfo.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MemoryInfo { + return MemoryInfo.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MemoryInfo { + fromPartial(object: DeepPartial): MemoryInfo { const message = createBaseMemoryInfo(); message.vendor = object.vendor ?? ''; message.type = object.type ?? ''; @@ -219,10 +217,10 @@ export const Memory = { return obj; }, - create, I>>(base?: I): Memory { - return Memory.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Memory { + return Memory.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Memory { + fromPartial(object: DeepPartial): Memory { const message = createBaseMemory(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -256,13 +254,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/node.ts b/ts/src/generated/akash/inventory/v1/node.ts index baecfd84..aafb7529 100644 --- a/ts/src/generated/akash/inventory/v1/node.ts +++ b/ts/src/generated/akash/inventory/v1/node.ts @@ -78,14 +78,10 @@ export const NodeCapabilities = { return obj; }, - create, I>>( - base?: I, - ): NodeCapabilities { - return NodeCapabilities.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): NodeCapabilities { + return NodeCapabilities.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): NodeCapabilities { + fromPartial(object: DeepPartial): NodeCapabilities { const message = createBaseNodeCapabilities(); message.storageClasses = object.storageClasses?.map((e) => e) || []; return message; @@ -193,10 +189,10 @@ export const Node = { return obj; }, - create, I>>(base?: I): Node { - return Node.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Node { + return Node.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Node { + fromPartial(object: DeepPartial): Node { const message = createBaseNode(); message.name = object.name ?? ''; message.resources = @@ -234,13 +230,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/resourcepair.ts b/ts/src/generated/akash/inventory/v1/resourcepair.ts index 67349fa4..629c6f40 100644 --- a/ts/src/generated/akash/inventory/v1/resourcepair.ts +++ b/ts/src/generated/akash/inventory/v1/resourcepair.ts @@ -110,14 +110,10 @@ export const ResourcePair = { return obj; }, - create, I>>( - base?: I, - ): ResourcePair { - return ResourcePair.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourcePair { + return ResourcePair.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourcePair { + fromPartial(object: DeepPartial): ResourcePair { const message = createBaseResourcePair(); message.allocatable = object.allocatable !== undefined && object.allocatable !== null @@ -156,13 +152,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/resources.ts b/ts/src/generated/akash/inventory/v1/resources.ts index 2b9d88d8..d646c57d 100644 --- a/ts/src/generated/akash/inventory/v1/resources.ts +++ b/ts/src/generated/akash/inventory/v1/resources.ts @@ -175,14 +175,10 @@ export const NodeResources = { return obj; }, - create, I>>( - base?: I, - ): NodeResources { - return NodeResources.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): NodeResources { + return NodeResources.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): NodeResources { + fromPartial(object: DeepPartial): NodeResources { const message = createBaseNodeResources(); message.cpu = object.cpu !== undefined && object.cpu !== null @@ -235,13 +231,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/inventory/v1/storage.ts b/ts/src/generated/akash/inventory/v1/storage.ts index b95761b7..bc402843 100644 --- a/ts/src/generated/akash/inventory/v1/storage.ts +++ b/ts/src/generated/akash/inventory/v1/storage.ts @@ -90,12 +90,10 @@ export const StorageInfo = { return obj; }, - create, I>>(base?: I): StorageInfo { - return StorageInfo.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): StorageInfo { + return StorageInfo.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): StorageInfo { + fromPartial(object: DeepPartial): StorageInfo { const message = createBaseStorageInfo(); message.class = object.class ?? ''; message.iops = object.iops ?? ''; @@ -181,10 +179,10 @@ export const Storage = { return obj; }, - create, I>>(base?: I): Storage { - return Storage.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Storage { + return Storage.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Storage { + fromPartial(object: DeepPartial): Storage { const message = createBaseStorage(); message.quantity = object.quantity !== undefined && object.quantity !== null @@ -221,13 +219,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta1/group.ts b/ts/src/generated/akash/manifest/v2beta1/group.ts index 0a2af840..115b2a2b 100644 --- a/ts/src/generated/akash/manifest/v2beta1/group.ts +++ b/ts/src/generated/akash/manifest/v2beta1/group.ts @@ -82,10 +82,10 @@ export const Group = { return obj; }, - create, I>>(base?: I): Group { - return Group.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Group { + return Group.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Group { + fromPartial(object: DeepPartial): Group { const message = createBaseGroup(); message.name = object.name ?? ''; message.services = @@ -117,13 +117,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta1/httpoptions.ts b/ts/src/generated/akash/manifest/v2beta1/httpoptions.ts index f7ef8863..6b5bafc8 100644 --- a/ts/src/generated/akash/manifest/v2beta1/httpoptions.ts +++ b/ts/src/generated/akash/manifest/v2beta1/httpoptions.ts @@ -165,13 +165,13 @@ export const ServiceExposeHTTPOptions = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): ServiceExposeHTTPOptions { - return ServiceExposeHTTPOptions.fromPartial(base ?? ({} as any)); + return ServiceExposeHTTPOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): ServiceExposeHTTPOptions { const message = createBaseServiceExposeHTTPOptions(); message.maxBodySize = object.maxBodySize ?? 0; @@ -210,13 +210,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta1/service.ts b/ts/src/generated/akash/manifest/v2beta1/service.ts index 2fdbcb4e..41bfa008 100644 --- a/ts/src/generated/akash/manifest/v2beta1/service.ts +++ b/ts/src/generated/akash/manifest/v2beta1/service.ts @@ -126,14 +126,10 @@ export const StorageParams = { return obj; }, - create, I>>( - base?: I, - ): StorageParams { - return StorageParams.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): StorageParams { + return StorageParams.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): StorageParams { + fromPartial(object: DeepPartial): StorageParams { const message = createBaseStorageParams(); message.name = object.name ?? ''; message.mount = object.mount ?? ''; @@ -202,14 +198,10 @@ export const ServiceParams = { return obj; }, - create, I>>( - base?: I, - ): ServiceParams { - return ServiceParams.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceParams { + return ServiceParams.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceParams { + fromPartial(object: DeepPartial): ServiceParams { const message = createBaseServiceParams(); message.storage = object.storage?.map((e) => StorageParams.fromPartial(e)) || []; @@ -413,10 +405,10 @@ export const Service = { return obj; }, - create, I>>(base?: I): Service { - return Service.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Service { + return Service.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Service { + fromPartial(object: DeepPartial): Service { const message = createBaseService(); message.name = object.name ?? ''; message.image = object.image ?? ''; @@ -461,13 +453,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts b/ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts index bcc1da52..1190ae36 100644 --- a/ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts +++ b/ts/src/generated/akash/manifest/v2beta1/serviceexpose.ts @@ -217,14 +217,10 @@ export const ServiceExpose = { return obj; }, - create, I>>( - base?: I, - ): ServiceExpose { - return ServiceExpose.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceExpose { + return ServiceExpose.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceExpose { + fromPartial(object: DeepPartial): ServiceExpose { const message = createBaseServiceExpose(); message.port = object.port ?? 0; message.externalPort = object.externalPort ?? 0; @@ -265,13 +261,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta2/group.ts b/ts/src/generated/akash/manifest/v2beta2/group.ts index 06d96a8b..80c9d91a 100644 --- a/ts/src/generated/akash/manifest/v2beta2/group.ts +++ b/ts/src/generated/akash/manifest/v2beta2/group.ts @@ -82,10 +82,10 @@ export const Group = { return obj; }, - create, I>>(base?: I): Group { - return Group.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Group { + return Group.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Group { + fromPartial(object: DeepPartial): Group { const message = createBaseGroup(); message.name = object.name ?? ''; message.services = @@ -117,13 +117,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta2/httpoptions.ts b/ts/src/generated/akash/manifest/v2beta2/httpoptions.ts index da75f21b..c9fa0ab1 100644 --- a/ts/src/generated/akash/manifest/v2beta2/httpoptions.ts +++ b/ts/src/generated/akash/manifest/v2beta2/httpoptions.ts @@ -165,13 +165,13 @@ export const ServiceExposeHTTPOptions = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): ServiceExposeHTTPOptions { - return ServiceExposeHTTPOptions.fromPartial(base ?? ({} as any)); + return ServiceExposeHTTPOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): ServiceExposeHTTPOptions { const message = createBaseServiceExposeHTTPOptions(); message.maxBodySize = object.maxBodySize ?? 0; @@ -210,13 +210,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta2/service.ts b/ts/src/generated/akash/manifest/v2beta2/service.ts index 84591dd8..4794659e 100644 --- a/ts/src/generated/akash/manifest/v2beta2/service.ts +++ b/ts/src/generated/akash/manifest/v2beta2/service.ts @@ -126,14 +126,10 @@ export const StorageParams = { return obj; }, - create, I>>( - base?: I, - ): StorageParams { - return StorageParams.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): StorageParams { + return StorageParams.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): StorageParams { + fromPartial(object: DeepPartial): StorageParams { const message = createBaseStorageParams(); message.name = object.name ?? ''; message.mount = object.mount ?? ''; @@ -202,14 +198,10 @@ export const ServiceParams = { return obj; }, - create, I>>( - base?: I, - ): ServiceParams { - return ServiceParams.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceParams { + return ServiceParams.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceParams { + fromPartial(object: DeepPartial): ServiceParams { const message = createBaseServiceParams(); message.storage = object.storage?.map((e) => StorageParams.fromPartial(e)) || []; @@ -410,10 +402,10 @@ export const Service = { return obj; }, - create, I>>(base?: I): Service { - return Service.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Service { + return Service.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Service { + fromPartial(object: DeepPartial): Service { const message = createBaseService(); message.name = object.name ?? ''; message.image = object.image ?? ''; @@ -458,13 +450,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts b/ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts index d3a1d345..aa841468 100644 --- a/ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts +++ b/ts/src/generated/akash/manifest/v2beta2/serviceexpose.ts @@ -217,14 +217,10 @@ export const ServiceExpose = { return obj; }, - create, I>>( - base?: I, - ): ServiceExpose { - return ServiceExpose.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceExpose { + return ServiceExpose.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceExpose { + fromPartial(object: DeepPartial): ServiceExpose { const message = createBaseServiceExpose(); message.port = object.port ?? 0; message.externalPort = object.externalPort ?? 0; @@ -265,13 +261,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta2/bid.ts b/ts/src/generated/akash/market/v1beta2/bid.ts index 3b09cbbd..e2502055 100644 --- a/ts/src/generated/akash/market/v1beta2/bid.ts +++ b/ts/src/generated/akash/market/v1beta2/bid.ts @@ -230,14 +230,10 @@ export const MsgCreateBid = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateBid { - return MsgCreateBid.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MsgCreateBid { + create(base?: DeepPartial): MsgCreateBid { + return MsgCreateBid.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MsgCreateBid { const message = createBaseMsgCreateBid(); message.order = object.order !== undefined && object.order !== null @@ -301,14 +297,10 @@ export const MsgCreateBidResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateBidResponse { - return MsgCreateBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateBidResponse { + return MsgCreateBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCreateBidResponse { + fromPartial(_: DeepPartial): MsgCreateBidResponse { const message = createBaseMsgCreateBidResponse(); return message; }, @@ -372,12 +364,10 @@ export const MsgCloseBid = { return obj; }, - create, I>>(base?: I): MsgCloseBid { - return MsgCloseBid.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseBid { + return MsgCloseBid.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseBid { + fromPartial(object: DeepPartial): MsgCloseBid { const message = createBaseMsgCloseBid(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -429,14 +419,10 @@ export const MsgCloseBidResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseBidResponse { - return MsgCloseBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseBidResponse { + return MsgCloseBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseBidResponse { + fromPartial(_: DeepPartial): MsgCloseBidResponse { const message = createBaseMsgCloseBidResponse(); return message; }, @@ -562,10 +548,10 @@ export const BidID = { return obj; }, - create, I>>(base?: I): BidID { - return BidID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): BidID { + return BidID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): BidID { + fromPartial(object: DeepPartial): BidID { const message = createBaseBidID(); message.owner = object.owner ?? ''; message.dseq = @@ -684,10 +670,10 @@ export const Bid = { return obj; }, - create, I>>(base?: I): Bid { - return Bid.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Bid { + return Bid.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Bid { + fromPartial(object: DeepPartial): Bid { const message = createBaseBid(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -844,12 +830,10 @@ export const BidFilters = { return obj; }, - create, I>>(base?: I): BidFilters { - return BidFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): BidFilters { + return BidFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): BidFilters { + fromPartial(object: DeepPartial): BidFilters { const message = createBaseBidFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -887,13 +871,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta2/genesis.ts b/ts/src/generated/akash/market/v1beta2/genesis.ts index f085f5d6..736306d4 100644 --- a/ts/src/generated/akash/market/v1beta2/genesis.ts +++ b/ts/src/generated/akash/market/v1beta2/genesis.ts @@ -109,14 +109,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; message.leases = object.leases?.map((e) => Lease.fromPartial(e)) || []; @@ -151,13 +147,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta2/lease.ts b/ts/src/generated/akash/market/v1beta2/lease.ts index 1138b786..1cd31d72 100644 --- a/ts/src/generated/akash/market/v1beta2/lease.ts +++ b/ts/src/generated/akash/market/v1beta2/lease.ts @@ -242,10 +242,10 @@ export const LeaseID = { return obj; }, - create, I>>(base?: I): LeaseID { - return LeaseID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): LeaseID { + return LeaseID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): LeaseID { + fromPartial(object: DeepPartial): LeaseID { const message = createBaseLeaseID(); message.owner = object.owner ?? ''; message.dseq = @@ -383,10 +383,10 @@ export const Lease = { return obj; }, - create, I>>(base?: I): Lease { - return Lease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Lease { + return Lease.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Lease { + fromPartial(object: DeepPartial): Lease { const message = createBaseLease(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -547,14 +547,10 @@ export const LeaseFilters = { return obj; }, - create, I>>( - base?: I, - ): LeaseFilters { - return LeaseFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): LeaseFilters { + return LeaseFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): LeaseFilters { + fromPartial(object: DeepPartial): LeaseFilters { const message = createBaseLeaseFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -627,14 +623,10 @@ export const MsgCreateLease = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateLease { - return MsgCreateLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateLease { + return MsgCreateLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateLease { + fromPartial(object: DeepPartial): MsgCreateLease { const message = createBaseMsgCreateLease(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -689,14 +681,10 @@ export const MsgCreateLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateLeaseResponse { - return MsgCreateLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateLeaseResponse { + return MsgCreateLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCreateLeaseResponse { + fromPartial(_: DeepPartial): MsgCreateLeaseResponse { const message = createBaseMsgCreateLeaseResponse(); return message; }, @@ -760,14 +748,10 @@ export const MsgWithdrawLease = { return obj; }, - create, I>>( - base?: I, - ): MsgWithdrawLease { - return MsgWithdrawLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgWithdrawLease { + return MsgWithdrawLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgWithdrawLease { + fromPartial(object: DeepPartial): MsgWithdrawLease { const message = createBaseMsgWithdrawLease(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -822,13 +806,13 @@ export const MsgWithdrawLeaseResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgWithdrawLeaseResponse { - return MsgWithdrawLeaseResponse.fromPartial(base ?? ({} as any)); + return MsgWithdrawLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgWithdrawLeaseResponse { const message = createBaseMsgWithdrawLeaseResponse(); return message; @@ -898,14 +882,10 @@ export const MsgCloseLease = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseLease { - return MsgCloseLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseLease { + return MsgCloseLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseLease { + fromPartial(object: DeepPartial): MsgCloseLease { const message = createBaseMsgCloseLease(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -960,14 +940,10 @@ export const MsgCloseLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseLeaseResponse { - return MsgCloseLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseLeaseResponse { + return MsgCloseLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseLeaseResponse { + fromPartial(_: DeepPartial): MsgCloseLeaseResponse { const message = createBaseMsgCloseLeaseResponse(); return message; }, @@ -996,13 +972,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta2/order.ts b/ts/src/generated/akash/market/v1beta2/order.ts index 8caa8650..101c331e 100644 --- a/ts/src/generated/akash/market/v1beta2/order.ts +++ b/ts/src/generated/akash/market/v1beta2/order.ts @@ -188,10 +188,10 @@ export const OrderID = { return obj; }, - create, I>>(base?: I): OrderID { - return OrderID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OrderID { + return OrderID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): OrderID { + fromPartial(object: DeepPartial): OrderID { const message = createBaseOrderID(); message.owner = object.owner ?? ''; message.dseq = @@ -311,10 +311,10 @@ export const Order = { return obj; }, - create, I>>(base?: I): Order { - return Order.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Order { + return Order.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Order { + fromPartial(object: DeepPartial): Order { const message = createBaseOrder(); message.orderId = object.orderId !== undefined && object.orderId !== null @@ -454,14 +454,10 @@ export const OrderFilters = { return obj; }, - create, I>>( - base?: I, - ): OrderFilters { - return OrderFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OrderFilters { + return OrderFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): OrderFilters { + fromPartial(object: DeepPartial): OrderFilters { const message = createBaseOrderFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -498,13 +494,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta2/params.ts b/ts/src/generated/akash/market/v1beta2/params.ts index fa20791c..efcaa65d 100644 --- a/ts/src/generated/akash/market/v1beta2/params.ts +++ b/ts/src/generated/akash/market/v1beta2/params.ts @@ -91,10 +91,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.bidMinDeposit = object.bidMinDeposit !== undefined && object.bidMinDeposit !== null @@ -128,13 +128,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta2/query.ts b/ts/src/generated/akash/market/v1beta2/query.ts index 730e5192..2fca7f1d 100644 --- a/ts/src/generated/akash/market/v1beta2/query.ts +++ b/ts/src/generated/akash/market/v1beta2/query.ts @@ -171,14 +171,10 @@ export const QueryOrdersRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryOrdersRequest { - return QueryOrdersRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): QueryOrdersRequest { + create(base?: DeepPartial): QueryOrdersRequest { + return QueryOrdersRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): QueryOrdersRequest { const message = createBaseQueryOrdersRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -275,14 +271,10 @@ export const QueryOrdersResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryOrdersResponse { - return QueryOrdersResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrdersResponse { + return QueryOrdersResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrdersResponse { + fromPartial(object: DeepPartial): QueryOrdersResponse { const message = createBaseQueryOrdersResponse(); message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; message.pagination = @@ -351,14 +343,10 @@ export const QueryOrderRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryOrderRequest { - return QueryOrderRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrderRequest { + return QueryOrderRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrderRequest { + fromPartial(object: DeepPartial): QueryOrderRequest { const message = createBaseQueryOrderRequest(); message.id = object.id !== undefined && object.id !== null @@ -426,14 +414,10 @@ export const QueryOrderResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryOrderResponse { - return QueryOrderResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrderResponse { + return QueryOrderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrderResponse { + fromPartial(object: DeepPartial): QueryOrderResponse { const message = createBaseQueryOrderResponse(); message.order = object.order !== undefined && object.order !== null @@ -523,14 +507,10 @@ export const QueryBidsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryBidsRequest { - return QueryBidsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidsRequest { + return QueryBidsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidsRequest { + fromPartial(object: DeepPartial): QueryBidsRequest { const message = createBaseQueryBidsRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -627,14 +607,10 @@ export const QueryBidsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryBidsResponse { - return QueryBidsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidsResponse { + return QueryBidsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidsResponse { + fromPartial(object: DeepPartial): QueryBidsResponse { const message = createBaseQueryBidsResponse(); message.bids = object.bids?.map((e) => QueryBidResponse.fromPartial(e)) || []; @@ -704,14 +680,10 @@ export const QueryBidRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryBidRequest { - return QueryBidRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidRequest { + return QueryBidRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidRequest { + fromPartial(object: DeepPartial): QueryBidRequest { const message = createBaseQueryBidRequest(); message.id = object.id !== undefined && object.id !== null @@ -799,14 +771,10 @@ export const QueryBidResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryBidResponse { - return QueryBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidResponse { + return QueryBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidResponse { + fromPartial(object: DeepPartial): QueryBidResponse { const message = createBaseQueryBidResponse(); message.bid = object.bid !== undefined && object.bid !== null @@ -900,14 +868,10 @@ export const QueryLeasesRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryLeasesRequest { - return QueryLeasesRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeasesRequest { + return QueryLeasesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeasesRequest { + fromPartial(object: DeepPartial): QueryLeasesRequest { const message = createBaseQueryLeasesRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -1006,14 +970,10 @@ export const QueryLeasesResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryLeasesResponse { - return QueryLeasesResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeasesResponse { + return QueryLeasesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeasesResponse { + fromPartial(object: DeepPartial): QueryLeasesResponse { const message = createBaseQueryLeasesResponse(); message.leases = object.leases?.map((e) => QueryLeaseResponse.fromPartial(e)) || []; @@ -1083,14 +1043,10 @@ export const QueryLeaseRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryLeaseRequest { - return QueryLeaseRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeaseRequest { + return QueryLeaseRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeaseRequest { + fromPartial(object: DeepPartial): QueryLeaseRequest { const message = createBaseQueryLeaseRequest(); message.id = object.id !== undefined && object.id !== null @@ -1184,14 +1140,10 @@ export const QueryLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryLeaseResponse { - return QueryLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeaseResponse { + return QueryLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeaseResponse { + fromPartial(object: DeepPartial): QueryLeaseResponse { const message = createBaseQueryLeaseResponse(); message.lease = object.lease !== undefined && object.lease !== null @@ -1315,13 +1267,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta3/bid.ts b/ts/src/generated/akash/market/v1beta3/bid.ts index 88ce8dd0..fadbbfc3 100644 --- a/ts/src/generated/akash/market/v1beta3/bid.ts +++ b/ts/src/generated/akash/market/v1beta3/bid.ts @@ -230,14 +230,10 @@ export const MsgCreateBid = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateBid { - return MsgCreateBid.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MsgCreateBid { + create(base?: DeepPartial): MsgCreateBid { + return MsgCreateBid.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MsgCreateBid { const message = createBaseMsgCreateBid(); message.order = object.order !== undefined && object.order !== null @@ -301,14 +297,10 @@ export const MsgCreateBidResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateBidResponse { - return MsgCreateBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateBidResponse { + return MsgCreateBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCreateBidResponse { + fromPartial(_: DeepPartial): MsgCreateBidResponse { const message = createBaseMsgCreateBidResponse(); return message; }, @@ -372,12 +364,10 @@ export const MsgCloseBid = { return obj; }, - create, I>>(base?: I): MsgCloseBid { - return MsgCloseBid.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseBid { + return MsgCloseBid.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseBid { + fromPartial(object: DeepPartial): MsgCloseBid { const message = createBaseMsgCloseBid(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -429,14 +419,10 @@ export const MsgCloseBidResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseBidResponse { - return MsgCloseBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseBidResponse { + return MsgCloseBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseBidResponse { + fromPartial(_: DeepPartial): MsgCloseBidResponse { const message = createBaseMsgCloseBidResponse(); return message; }, @@ -562,10 +548,10 @@ export const BidID = { return obj; }, - create, I>>(base?: I): BidID { - return BidID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): BidID { + return BidID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): BidID { + fromPartial(object: DeepPartial): BidID { const message = createBaseBidID(); message.owner = object.owner ?? ''; message.dseq = @@ -684,10 +670,10 @@ export const Bid = { return obj; }, - create, I>>(base?: I): Bid { - return Bid.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Bid { + return Bid.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Bid { + fromPartial(object: DeepPartial): Bid { const message = createBaseBid(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -844,12 +830,10 @@ export const BidFilters = { return obj; }, - create, I>>(base?: I): BidFilters { - return BidFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): BidFilters { + return BidFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): BidFilters { + fromPartial(object: DeepPartial): BidFilters { const message = createBaseBidFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -887,13 +871,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta3/genesis.ts b/ts/src/generated/akash/market/v1beta3/genesis.ts index eb6c6a6b..9d376a1c 100644 --- a/ts/src/generated/akash/market/v1beta3/genesis.ts +++ b/ts/src/generated/akash/market/v1beta3/genesis.ts @@ -128,14 +128,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null @@ -171,13 +167,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta3/lease.ts b/ts/src/generated/akash/market/v1beta3/lease.ts index 13343109..cede082c 100644 --- a/ts/src/generated/akash/market/v1beta3/lease.ts +++ b/ts/src/generated/akash/market/v1beta3/lease.ts @@ -242,10 +242,10 @@ export const LeaseID = { return obj; }, - create, I>>(base?: I): LeaseID { - return LeaseID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): LeaseID { + return LeaseID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): LeaseID { + fromPartial(object: DeepPartial): LeaseID { const message = createBaseLeaseID(); message.owner = object.owner ?? ''; message.dseq = @@ -383,10 +383,10 @@ export const Lease = { return obj; }, - create, I>>(base?: I): Lease { - return Lease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Lease { + return Lease.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Lease { + fromPartial(object: DeepPartial): Lease { const message = createBaseLease(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -547,14 +547,10 @@ export const LeaseFilters = { return obj; }, - create, I>>( - base?: I, - ): LeaseFilters { - return LeaseFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): LeaseFilters { + return LeaseFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): LeaseFilters { + fromPartial(object: DeepPartial): LeaseFilters { const message = createBaseLeaseFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -627,14 +623,10 @@ export const MsgCreateLease = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateLease { - return MsgCreateLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateLease { + return MsgCreateLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateLease { + fromPartial(object: DeepPartial): MsgCreateLease { const message = createBaseMsgCreateLease(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -689,14 +681,10 @@ export const MsgCreateLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateLeaseResponse { - return MsgCreateLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateLeaseResponse { + return MsgCreateLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCreateLeaseResponse { + fromPartial(_: DeepPartial): MsgCreateLeaseResponse { const message = createBaseMsgCreateLeaseResponse(); return message; }, @@ -760,14 +748,10 @@ export const MsgWithdrawLease = { return obj; }, - create, I>>( - base?: I, - ): MsgWithdrawLease { - return MsgWithdrawLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgWithdrawLease { + return MsgWithdrawLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgWithdrawLease { + fromPartial(object: DeepPartial): MsgWithdrawLease { const message = createBaseMsgWithdrawLease(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -822,13 +806,13 @@ export const MsgWithdrawLeaseResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgWithdrawLeaseResponse { - return MsgWithdrawLeaseResponse.fromPartial(base ?? ({} as any)); + return MsgWithdrawLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgWithdrawLeaseResponse { const message = createBaseMsgWithdrawLeaseResponse(); return message; @@ -898,14 +882,10 @@ export const MsgCloseLease = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseLease { - return MsgCloseLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseLease { + return MsgCloseLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseLease { + fromPartial(object: DeepPartial): MsgCloseLease { const message = createBaseMsgCloseLease(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -960,14 +940,10 @@ export const MsgCloseLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseLeaseResponse { - return MsgCloseLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseLeaseResponse { + return MsgCloseLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseLeaseResponse { + fromPartial(_: DeepPartial): MsgCloseLeaseResponse { const message = createBaseMsgCloseLeaseResponse(); return message; }, @@ -996,13 +972,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta3/order.ts b/ts/src/generated/akash/market/v1beta3/order.ts index 28ff58a6..9bc4de6c 100644 --- a/ts/src/generated/akash/market/v1beta3/order.ts +++ b/ts/src/generated/akash/market/v1beta3/order.ts @@ -188,10 +188,10 @@ export const OrderID = { return obj; }, - create, I>>(base?: I): OrderID { - return OrderID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OrderID { + return OrderID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): OrderID { + fromPartial(object: DeepPartial): OrderID { const message = createBaseOrderID(); message.owner = object.owner ?? ''; message.dseq = @@ -311,10 +311,10 @@ export const Order = { return obj; }, - create, I>>(base?: I): Order { - return Order.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Order { + return Order.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Order { + fromPartial(object: DeepPartial): Order { const message = createBaseOrder(); message.orderId = object.orderId !== undefined && object.orderId !== null @@ -454,14 +454,10 @@ export const OrderFilters = { return obj; }, - create, I>>( - base?: I, - ): OrderFilters { - return OrderFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OrderFilters { + return OrderFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): OrderFilters { + fromPartial(object: DeepPartial): OrderFilters { const message = createBaseOrderFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -498,13 +494,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta3/params.ts b/ts/src/generated/akash/market/v1beta3/params.ts index 3636fab4..df93ce9e 100644 --- a/ts/src/generated/akash/market/v1beta3/params.ts +++ b/ts/src/generated/akash/market/v1beta3/params.ts @@ -91,10 +91,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.bidMinDeposit = object.bidMinDeposit !== undefined && object.bidMinDeposit !== null @@ -128,13 +128,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta3/query.ts b/ts/src/generated/akash/market/v1beta3/query.ts index f5f563ce..ebc39487 100644 --- a/ts/src/generated/akash/market/v1beta3/query.ts +++ b/ts/src/generated/akash/market/v1beta3/query.ts @@ -171,14 +171,10 @@ export const QueryOrdersRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryOrdersRequest { - return QueryOrdersRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): QueryOrdersRequest { + create(base?: DeepPartial): QueryOrdersRequest { + return QueryOrdersRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): QueryOrdersRequest { const message = createBaseQueryOrdersRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -275,14 +271,10 @@ export const QueryOrdersResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryOrdersResponse { - return QueryOrdersResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrdersResponse { + return QueryOrdersResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrdersResponse { + fromPartial(object: DeepPartial): QueryOrdersResponse { const message = createBaseQueryOrdersResponse(); message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; message.pagination = @@ -351,14 +343,10 @@ export const QueryOrderRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryOrderRequest { - return QueryOrderRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrderRequest { + return QueryOrderRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrderRequest { + fromPartial(object: DeepPartial): QueryOrderRequest { const message = createBaseQueryOrderRequest(); message.id = object.id !== undefined && object.id !== null @@ -426,14 +414,10 @@ export const QueryOrderResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryOrderResponse { - return QueryOrderResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrderResponse { + return QueryOrderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrderResponse { + fromPartial(object: DeepPartial): QueryOrderResponse { const message = createBaseQueryOrderResponse(); message.order = object.order !== undefined && object.order !== null @@ -523,14 +507,10 @@ export const QueryBidsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryBidsRequest { - return QueryBidsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidsRequest { + return QueryBidsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidsRequest { + fromPartial(object: DeepPartial): QueryBidsRequest { const message = createBaseQueryBidsRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -627,14 +607,10 @@ export const QueryBidsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryBidsResponse { - return QueryBidsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidsResponse { + return QueryBidsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidsResponse { + fromPartial(object: DeepPartial): QueryBidsResponse { const message = createBaseQueryBidsResponse(); message.bids = object.bids?.map((e) => QueryBidResponse.fromPartial(e)) || []; @@ -704,14 +680,10 @@ export const QueryBidRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryBidRequest { - return QueryBidRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidRequest { + return QueryBidRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidRequest { + fromPartial(object: DeepPartial): QueryBidRequest { const message = createBaseQueryBidRequest(); message.id = object.id !== undefined && object.id !== null @@ -799,14 +771,10 @@ export const QueryBidResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryBidResponse { - return QueryBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidResponse { + return QueryBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidResponse { + fromPartial(object: DeepPartial): QueryBidResponse { const message = createBaseQueryBidResponse(); message.bid = object.bid !== undefined && object.bid !== null @@ -900,14 +868,10 @@ export const QueryLeasesRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryLeasesRequest { - return QueryLeasesRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeasesRequest { + return QueryLeasesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeasesRequest { + fromPartial(object: DeepPartial): QueryLeasesRequest { const message = createBaseQueryLeasesRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -1006,14 +970,10 @@ export const QueryLeasesResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryLeasesResponse { - return QueryLeasesResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeasesResponse { + return QueryLeasesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeasesResponse { + fromPartial(object: DeepPartial): QueryLeasesResponse { const message = createBaseQueryLeasesResponse(); message.leases = object.leases?.map((e) => QueryLeaseResponse.fromPartial(e)) || []; @@ -1083,14 +1043,10 @@ export const QueryLeaseRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryLeaseRequest { - return QueryLeaseRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeaseRequest { + return QueryLeaseRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeaseRequest { + fromPartial(object: DeepPartial): QueryLeaseRequest { const message = createBaseQueryLeaseRequest(); message.id = object.id !== undefined && object.id !== null @@ -1184,14 +1140,10 @@ export const QueryLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryLeaseResponse { - return QueryLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeaseResponse { + return QueryLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeaseResponse { + fromPartial(object: DeepPartial): QueryLeaseResponse { const message = createBaseQueryLeaseResponse(); message.lease = object.lease !== undefined && object.lease !== null @@ -1315,13 +1267,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta4/bid.ts b/ts/src/generated/akash/market/v1beta4/bid.ts index 7d824a8c..98f927b5 100644 --- a/ts/src/generated/akash/market/v1beta4/bid.ts +++ b/ts/src/generated/akash/market/v1beta4/bid.ts @@ -211,14 +211,10 @@ export const ResourceOffer = { return obj; }, - create, I>>( - base?: I, - ): ResourceOffer { - return ResourceOffer.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourceOffer { + return ResourceOffer.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourceOffer { + fromPartial(object: DeepPartial): ResourceOffer { const message = createBaseResourceOffer(); message.resources = object.resources !== undefined && object.resources !== null @@ -360,14 +356,10 @@ export const MsgCreateBid = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateBid { - return MsgCreateBid.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateBid { + return MsgCreateBid.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateBid { + fromPartial(object: DeepPartial): MsgCreateBid { const message = createBaseMsgCreateBid(); message.order = object.order !== undefined && object.order !== null @@ -433,14 +425,10 @@ export const MsgCreateBidResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateBidResponse { - return MsgCreateBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateBidResponse { + return MsgCreateBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCreateBidResponse { + fromPartial(_: DeepPartial): MsgCreateBidResponse { const message = createBaseMsgCreateBidResponse(); return message; }, @@ -504,12 +492,10 @@ export const MsgCloseBid = { return obj; }, - create, I>>(base?: I): MsgCloseBid { - return MsgCloseBid.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseBid { + return MsgCloseBid.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseBid { + fromPartial(object: DeepPartial): MsgCloseBid { const message = createBaseMsgCloseBid(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -561,14 +547,10 @@ export const MsgCloseBidResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseBidResponse { - return MsgCloseBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseBidResponse { + return MsgCloseBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseBidResponse { + fromPartial(_: DeepPartial): MsgCloseBidResponse { const message = createBaseMsgCloseBidResponse(); return message; }, @@ -694,10 +676,10 @@ export const BidID = { return obj; }, - create, I>>(base?: I): BidID { - return BidID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): BidID { + return BidID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): BidID { + fromPartial(object: DeepPartial): BidID { const message = createBaseBidID(); message.owner = object.owner ?? ''; message.dseq = @@ -837,10 +819,10 @@ export const Bid = { return obj; }, - create, I>>(base?: I): Bid { - return Bid.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Bid { + return Bid.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Bid { + fromPartial(object: DeepPartial): Bid { const message = createBaseBid(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -999,12 +981,10 @@ export const BidFilters = { return obj; }, - create, I>>(base?: I): BidFilters { - return BidFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): BidFilters { + return BidFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): BidFilters { + fromPartial(object: DeepPartial): BidFilters { const message = createBaseBidFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -1042,13 +1022,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta4/genesis.ts b/ts/src/generated/akash/market/v1beta4/genesis.ts index 09ddc481..6568b9c5 100644 --- a/ts/src/generated/akash/market/v1beta4/genesis.ts +++ b/ts/src/generated/akash/market/v1beta4/genesis.ts @@ -128,14 +128,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null @@ -171,13 +167,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta4/lease.ts b/ts/src/generated/akash/market/v1beta4/lease.ts index c22c8e53..70fa5107 100644 --- a/ts/src/generated/akash/market/v1beta4/lease.ts +++ b/ts/src/generated/akash/market/v1beta4/lease.ts @@ -242,10 +242,10 @@ export const LeaseID = { return obj; }, - create, I>>(base?: I): LeaseID { - return LeaseID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): LeaseID { + return LeaseID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): LeaseID { + fromPartial(object: DeepPartial): LeaseID { const message = createBaseLeaseID(); message.owner = object.owner ?? ''; message.dseq = @@ -383,10 +383,10 @@ export const Lease = { return obj; }, - create, I>>(base?: I): Lease { - return Lease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Lease { + return Lease.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Lease { + fromPartial(object: DeepPartial): Lease { const message = createBaseLease(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -547,14 +547,10 @@ export const LeaseFilters = { return obj; }, - create, I>>( - base?: I, - ): LeaseFilters { - return LeaseFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): LeaseFilters { + return LeaseFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): LeaseFilters { + fromPartial(object: DeepPartial): LeaseFilters { const message = createBaseLeaseFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -627,14 +623,10 @@ export const MsgCreateLease = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateLease { - return MsgCreateLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateLease { + return MsgCreateLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateLease { + fromPartial(object: DeepPartial): MsgCreateLease { const message = createBaseMsgCreateLease(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -689,14 +681,10 @@ export const MsgCreateLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateLeaseResponse { - return MsgCreateLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateLeaseResponse { + return MsgCreateLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCreateLeaseResponse { + fromPartial(_: DeepPartial): MsgCreateLeaseResponse { const message = createBaseMsgCreateLeaseResponse(); return message; }, @@ -760,14 +748,10 @@ export const MsgWithdrawLease = { return obj; }, - create, I>>( - base?: I, - ): MsgWithdrawLease { - return MsgWithdrawLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgWithdrawLease { + return MsgWithdrawLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgWithdrawLease { + fromPartial(object: DeepPartial): MsgWithdrawLease { const message = createBaseMsgWithdrawLease(); message.bidId = object.bidId !== undefined && object.bidId !== null @@ -822,13 +806,13 @@ export const MsgWithdrawLeaseResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgWithdrawLeaseResponse { - return MsgWithdrawLeaseResponse.fromPartial(base ?? ({} as any)); + return MsgWithdrawLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgWithdrawLeaseResponse { const message = createBaseMsgWithdrawLeaseResponse(); return message; @@ -898,14 +882,10 @@ export const MsgCloseLease = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseLease { - return MsgCloseLease.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseLease { + return MsgCloseLease.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCloseLease { + fromPartial(object: DeepPartial): MsgCloseLease { const message = createBaseMsgCloseLease(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -960,14 +940,10 @@ export const MsgCloseLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): MsgCloseLeaseResponse { - return MsgCloseLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCloseLeaseResponse { + return MsgCloseLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): MsgCloseLeaseResponse { + fromPartial(_: DeepPartial): MsgCloseLeaseResponse { const message = createBaseMsgCloseLeaseResponse(); return message; }, @@ -996,13 +972,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta4/order.ts b/ts/src/generated/akash/market/v1beta4/order.ts index 3fc74131..34a3556b 100644 --- a/ts/src/generated/akash/market/v1beta4/order.ts +++ b/ts/src/generated/akash/market/v1beta4/order.ts @@ -188,10 +188,10 @@ export const OrderID = { return obj; }, - create, I>>(base?: I): OrderID { - return OrderID.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OrderID { + return OrderID.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): OrderID { + fromPartial(object: DeepPartial): OrderID { const message = createBaseOrderID(); message.owner = object.owner ?? ''; message.dseq = @@ -311,10 +311,10 @@ export const Order = { return obj; }, - create, I>>(base?: I): Order { - return Order.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Order { + return Order.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Order { + fromPartial(object: DeepPartial): Order { const message = createBaseOrder(); message.orderId = object.orderId !== undefined && object.orderId !== null @@ -454,14 +454,10 @@ export const OrderFilters = { return obj; }, - create, I>>( - base?: I, - ): OrderFilters { - return OrderFilters.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OrderFilters { + return OrderFilters.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): OrderFilters { + fromPartial(object: DeepPartial): OrderFilters { const message = createBaseOrderFilters(); message.owner = object.owner ?? ''; message.dseq = @@ -498,13 +494,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta4/params.ts b/ts/src/generated/akash/market/v1beta4/params.ts index 9f5d2ce6..69348172 100644 --- a/ts/src/generated/akash/market/v1beta4/params.ts +++ b/ts/src/generated/akash/market/v1beta4/params.ts @@ -91,10 +91,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.bidMinDeposit = object.bidMinDeposit !== undefined && object.bidMinDeposit !== null @@ -128,13 +128,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/market/v1beta4/query.ts b/ts/src/generated/akash/market/v1beta4/query.ts index e3a9a631..67907e08 100644 --- a/ts/src/generated/akash/market/v1beta4/query.ts +++ b/ts/src/generated/akash/market/v1beta4/query.ts @@ -171,14 +171,10 @@ export const QueryOrdersRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryOrdersRequest { - return QueryOrdersRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): QueryOrdersRequest { + create(base?: DeepPartial): QueryOrdersRequest { + return QueryOrdersRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): QueryOrdersRequest { const message = createBaseQueryOrdersRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -275,14 +271,10 @@ export const QueryOrdersResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryOrdersResponse { - return QueryOrdersResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrdersResponse { + return QueryOrdersResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrdersResponse { + fromPartial(object: DeepPartial): QueryOrdersResponse { const message = createBaseQueryOrdersResponse(); message.orders = object.orders?.map((e) => Order.fromPartial(e)) || []; message.pagination = @@ -351,14 +343,10 @@ export const QueryOrderRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryOrderRequest { - return QueryOrderRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrderRequest { + return QueryOrderRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrderRequest { + fromPartial(object: DeepPartial): QueryOrderRequest { const message = createBaseQueryOrderRequest(); message.id = object.id !== undefined && object.id !== null @@ -426,14 +414,10 @@ export const QueryOrderResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryOrderResponse { - return QueryOrderResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryOrderResponse { + return QueryOrderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryOrderResponse { + fromPartial(object: DeepPartial): QueryOrderResponse { const message = createBaseQueryOrderResponse(); message.order = object.order !== undefined && object.order !== null @@ -523,14 +507,10 @@ export const QueryBidsRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryBidsRequest { - return QueryBidsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidsRequest { + return QueryBidsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidsRequest { + fromPartial(object: DeepPartial): QueryBidsRequest { const message = createBaseQueryBidsRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -627,14 +607,10 @@ export const QueryBidsResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryBidsResponse { - return QueryBidsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidsResponse { + return QueryBidsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidsResponse { + fromPartial(object: DeepPartial): QueryBidsResponse { const message = createBaseQueryBidsResponse(); message.bids = object.bids?.map((e) => QueryBidResponse.fromPartial(e)) || []; @@ -704,14 +680,10 @@ export const QueryBidRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryBidRequest { - return QueryBidRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidRequest { + return QueryBidRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidRequest { + fromPartial(object: DeepPartial): QueryBidRequest { const message = createBaseQueryBidRequest(); message.id = object.id !== undefined && object.id !== null @@ -799,14 +771,10 @@ export const QueryBidResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryBidResponse { - return QueryBidResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryBidResponse { + return QueryBidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryBidResponse { + fromPartial(object: DeepPartial): QueryBidResponse { const message = createBaseQueryBidResponse(); message.bid = object.bid !== undefined && object.bid !== null @@ -900,14 +868,10 @@ export const QueryLeasesRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryLeasesRequest { - return QueryLeasesRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeasesRequest { + return QueryLeasesRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeasesRequest { + fromPartial(object: DeepPartial): QueryLeasesRequest { const message = createBaseQueryLeasesRequest(); message.filters = object.filters !== undefined && object.filters !== null @@ -1006,14 +970,10 @@ export const QueryLeasesResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryLeasesResponse { - return QueryLeasesResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeasesResponse { + return QueryLeasesResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeasesResponse { + fromPartial(object: DeepPartial): QueryLeasesResponse { const message = createBaseQueryLeasesResponse(); message.leases = object.leases?.map((e) => QueryLeaseResponse.fromPartial(e)) || []; @@ -1083,14 +1043,10 @@ export const QueryLeaseRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryLeaseRequest { - return QueryLeaseRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeaseRequest { + return QueryLeaseRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeaseRequest { + fromPartial(object: DeepPartial): QueryLeaseRequest { const message = createBaseQueryLeaseRequest(); message.id = object.id !== undefined && object.id !== null @@ -1184,14 +1140,10 @@ export const QueryLeaseResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryLeaseResponse { - return QueryLeaseResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryLeaseResponse { + return QueryLeaseResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryLeaseResponse { + fromPartial(object: DeepPartial): QueryLeaseResponse { const message = createBaseQueryLeaseResponse(); message.lease = object.lease !== undefined && object.lease !== null @@ -1315,13 +1267,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/lease/v1/service.ts b/ts/src/generated/akash/provider/lease/v1/service.ts index 912df4c9..c516ec83 100644 --- a/ts/src/generated/akash/provider/lease/v1/service.ts +++ b/ts/src/generated/akash/provider/lease/v1/service.ts @@ -279,14 +279,10 @@ export const LeaseServiceStatus = { return obj; }, - create, I>>( - base?: I, - ): LeaseServiceStatus { - return LeaseServiceStatus.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): LeaseServiceStatus { + create(base?: DeepPartial): LeaseServiceStatus { + return LeaseServiceStatus.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): LeaseServiceStatus { const message = createBaseLeaseServiceStatus(); message.available = object.available ?? 0; message.total = object.total ?? 0; @@ -414,14 +410,10 @@ export const LeaseIPStatus = { return obj; }, - create, I>>( - base?: I, - ): LeaseIPStatus { - return LeaseIPStatus.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): LeaseIPStatus { + return LeaseIPStatus.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): LeaseIPStatus { + fromPartial(object: DeepPartial): LeaseIPStatus { const message = createBaseLeaseIPStatus(); message.port = object.port ?? 0; message.externalPort = object.externalPort ?? 0; @@ -554,14 +546,10 @@ export const ForwarderPortStatus = { return obj; }, - create, I>>( - base?: I, - ): ForwarderPortStatus { - return ForwarderPortStatus.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ForwarderPortStatus { + return ForwarderPortStatus.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ForwarderPortStatus { + fromPartial(object: DeepPartial): ForwarderPortStatus { const message = createBaseForwarderPortStatus(); message.host = object.host ?? ''; message.port = object.port ?? 0; @@ -689,14 +677,10 @@ export const ServiceStatus = { return obj; }, - create, I>>( - base?: I, - ): ServiceStatus { - return ServiceStatus.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceStatus { + return ServiceStatus.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceStatus { + fromPartial(object: DeepPartial): ServiceStatus { const message = createBaseServiceStatus(); message.name = object.name ?? ''; message.status = @@ -790,14 +774,10 @@ export const SendManifestRequest = { return obj; }, - create, I>>( - base?: I, - ): SendManifestRequest { - return SendManifestRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): SendManifestRequest { + return SendManifestRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): SendManifestRequest { + fromPartial(object: DeepPartial): SendManifestRequest { const message = createBaseSendManifestRequest(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -853,14 +833,10 @@ export const SendManifestResponse = { return obj; }, - create, I>>( - base?: I, - ): SendManifestResponse { - return SendManifestResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): SendManifestResponse { + return SendManifestResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, - ): SendManifestResponse { + fromPartial(_: DeepPartial): SendManifestResponse { const message = createBaseSendManifestResponse(); return message; }, @@ -946,14 +922,10 @@ export const ServiceLogsRequest = { return obj; }, - create, I>>( - base?: I, - ): ServiceLogsRequest { - return ServiceLogsRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceLogsRequest { + return ServiceLogsRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceLogsRequest { + fromPartial(object: DeepPartial): ServiceLogsRequest { const message = createBaseServiceLogsRequest(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -1042,12 +1014,10 @@ export const ServiceLogs = { return obj; }, - create, I>>(base?: I): ServiceLogs { - return ServiceLogs.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceLogs { + return ServiceLogs.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceLogs { + fromPartial(object: DeepPartial): ServiceLogs { const message = createBaseServiceLogs(); message.name = object.name ?? ''; message.logs = object.logs ?? new Uint8Array(0); @@ -1115,14 +1085,10 @@ export const ServiceLogsResponse = { return obj; }, - create, I>>( - base?: I, - ): ServiceLogsResponse { - return ServiceLogsResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceLogsResponse { + return ServiceLogsResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceLogsResponse { + fromPartial(object: DeepPartial): ServiceLogsResponse { const message = createBaseServiceLogsResponse(); message.services = object.services?.map((e) => ServiceLogs.fromPartial(e)) || []; @@ -1190,14 +1156,10 @@ export const ShellRequest = { return obj; }, - create, I>>( - base?: I, - ): ShellRequest { - return ShellRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ShellRequest { + return ShellRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ShellRequest { + fromPartial(object: DeepPartial): ShellRequest { const message = createBaseShellRequest(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -1290,14 +1252,10 @@ export const ServiceStatusRequest = { return obj; }, - create, I>>( - base?: I, - ): ServiceStatusRequest { - return ServiceStatusRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceStatusRequest { + return ServiceStatusRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceStatusRequest { + fromPartial(object: DeepPartial): ServiceStatusRequest { const message = createBaseServiceStatusRequest(); message.leaseId = object.leaseId !== undefined && object.leaseId !== null @@ -1374,13 +1332,11 @@ export const ServiceStatusResponse = { return obj; }, - create, I>>( - base?: I, - ): ServiceStatusResponse { - return ServiceStatusResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceStatusResponse { + return ServiceStatusResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): ServiceStatusResponse { const message = createBaseServiceStatusResponse(); message.services = @@ -1560,13 +1516,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/v1/status.ts b/ts/src/generated/akash/provider/v1/status.ts index 5b465538..ad2d871f 100644 --- a/ts/src/generated/akash/provider/v1/status.ts +++ b/ts/src/generated/akash/provider/v1/status.ts @@ -234,14 +234,10 @@ export const ResourcesMetric = { return obj; }, - create, I>>( - base?: I, - ): ResourcesMetric { - return ResourcesMetric.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ResourcesMetric { + return ResourcesMetric.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ResourcesMetric { + fromPartial(object: DeepPartial): ResourcesMetric { const message = createBaseResourcesMetric(); message.cpu = object.cpu !== undefined && object.cpu !== null @@ -350,13 +346,13 @@ export const ResourcesMetric_StorageEntry = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): ResourcesMetric_StorageEntry { - return ResourcesMetric_StorageEntry.fromPartial(base ?? ({} as any)); + return ResourcesMetric_StorageEntry.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): ResourcesMetric_StorageEntry { const message = createBaseResourcesMetric_StorageEntry(); message.key = object.key ?? ''; @@ -429,10 +425,10 @@ export const Leases = { return obj; }, - create, I>>(base?: I): Leases { - return Leases.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Leases { + return Leases.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Leases { + fromPartial(object: DeepPartial): Leases { const message = createBaseLeases(); message.active = object.active ?? 0; return message; @@ -520,14 +516,10 @@ export const ReservationsMetric = { return obj; }, - create, I>>( - base?: I, - ): ReservationsMetric { - return ReservationsMetric.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ReservationsMetric { + return ReservationsMetric.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ReservationsMetric { + fromPartial(object: DeepPartial): ReservationsMetric { const message = createBaseReservationsMetric(); message.count = object.count ?? 0; message.resources = @@ -624,14 +616,10 @@ export const Reservations = { return obj; }, - create, I>>( - base?: I, - ): Reservations { - return Reservations.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Reservations { + return Reservations.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Reservations { + fromPartial(object: DeepPartial): Reservations { const message = createBaseReservations(); message.pending = object.pending !== undefined && object.pending !== null @@ -728,12 +716,10 @@ export const Inventory = { return obj; }, - create, I>>(base?: I): Inventory { - return Inventory.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Inventory { + return Inventory.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Inventory { + fromPartial(object: DeepPartial): Inventory { const message = createBaseInventory(); message.cluster = object.cluster !== undefined && object.cluster !== null @@ -825,14 +811,10 @@ export const ClusterStatus = { return obj; }, - create, I>>( - base?: I, - ): ClusterStatus { - return ClusterStatus.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ClusterStatus { + return ClusterStatus.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ClusterStatus { + fromPartial(object: DeepPartial): ClusterStatus { const message = createBaseClusterStatus(); message.leases = object.leases !== undefined && object.leases !== null @@ -904,14 +886,10 @@ export const BidEngineStatus = { return obj; }, - create, I>>( - base?: I, - ): BidEngineStatus { - return BidEngineStatus.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): BidEngineStatus { + return BidEngineStatus.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): BidEngineStatus { + fromPartial(object: DeepPartial): BidEngineStatus { const message = createBaseBidEngineStatus(); message.orders = object.orders ?? 0; return message; @@ -978,14 +956,10 @@ export const ManifestStatus = { return obj; }, - create, I>>( - base?: I, - ): ManifestStatus { - return ManifestStatus.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ManifestStatus { + return ManifestStatus.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ManifestStatus { + fromPartial(object: DeepPartial): ManifestStatus { const message = createBaseManifestStatus(); message.deployments = object.deployments ?? 0; return message; @@ -1151,10 +1125,10 @@ export const Status = { return obj; }, - create, I>>(base?: I): Status { - return Status.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Status { + return Status.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Status { + fromPartial(object: DeepPartial): Status { const message = createBaseStatus(); message.errors = object.errors?.map((e) => e) || []; message.cluster = @@ -1198,13 +1172,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - function toTimestamp(date: Date): Timestamp { const seconds = numberToLong(Math.trunc(date.getTime() / 1_000)); const nanos = (date.getTime() % 1_000) * 1_000_000; diff --git a/ts/src/generated/akash/provider/v1beta1/provider.ts b/ts/src/generated/akash/provider/v1beta1/provider.ts index cfde284b..834d1da8 100644 --- a/ts/src/generated/akash/provider/v1beta1/provider.ts +++ b/ts/src/generated/akash/provider/v1beta1/provider.ts @@ -135,14 +135,10 @@ export const ProviderInfo = { return obj; }, - create, I>>( - base?: I, - ): ProviderInfo { - return ProviderInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ProviderInfo { + create(base?: DeepPartial): ProviderInfo { + return ProviderInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ProviderInfo { const message = createBaseProviderInfo(); message.email = object.email ?? ''; message.website = object.website ?? ''; @@ -258,14 +254,10 @@ export const MsgCreateProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateProvider { - return MsgCreateProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateProvider { + return MsgCreateProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateProvider { + fromPartial(object: DeepPartial): MsgCreateProvider { const message = createBaseMsgCreateProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -324,13 +316,13 @@ export const MsgCreateProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateProviderResponse { - return MsgCreateProviderResponse.fromPartial(base ?? ({} as any)); + return MsgCreateProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateProviderResponse { const message = createBaseMsgCreateProviderResponse(); return message; @@ -448,14 +440,10 @@ export const MsgUpdateProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgUpdateProvider { - return MsgUpdateProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgUpdateProvider { + return MsgUpdateProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgUpdateProvider { + fromPartial(object: DeepPartial): MsgUpdateProvider { const message = createBaseMsgUpdateProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -514,13 +502,13 @@ export const MsgUpdateProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgUpdateProviderResponse { - return MsgUpdateProviderResponse.fromPartial(base ?? ({} as any)); + return MsgUpdateProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgUpdateProviderResponse { const message = createBaseMsgUpdateProviderResponse(); return message; @@ -588,14 +576,10 @@ export const MsgDeleteProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgDeleteProvider { - return MsgDeleteProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgDeleteProvider { + return MsgDeleteProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgDeleteProvider { + fromPartial(object: DeepPartial): MsgDeleteProvider { const message = createBaseMsgDeleteProvider(); message.owner = object.owner ?? ''; return message; @@ -647,13 +631,13 @@ export const MsgDeleteProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderResponse { - return MsgDeleteProviderResponse.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgDeleteProviderResponse { const message = createBaseMsgDeleteProviderResponse(); return message; @@ -771,10 +755,10 @@ export const Provider = { return obj; }, - create, I>>(base?: I): Provider { - return Provider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Provider { + return Provider.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Provider { + fromPartial(object: DeepPartial): Provider { const message = createBaseProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -877,13 +861,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/v1beta2/genesis.ts b/ts/src/generated/akash/provider/v1beta2/genesis.ts index 3fa0dcba..1524f9df 100644 --- a/ts/src/generated/akash/provider/v1beta2/genesis.ts +++ b/ts/src/generated/akash/provider/v1beta2/genesis.ts @@ -70,14 +70,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.providers = object.providers?.map((e) => Provider.fromPartial(e)) || []; @@ -108,13 +104,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/v1beta2/provider.ts b/ts/src/generated/akash/provider/v1beta2/provider.ts index b2cb5bc5..46d10a41 100644 --- a/ts/src/generated/akash/provider/v1beta2/provider.ts +++ b/ts/src/generated/akash/provider/v1beta2/provider.ts @@ -135,14 +135,10 @@ export const ProviderInfo = { return obj; }, - create, I>>( - base?: I, - ): ProviderInfo { - return ProviderInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ProviderInfo { + create(base?: DeepPartial): ProviderInfo { + return ProviderInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ProviderInfo { const message = createBaseProviderInfo(); message.email = object.email ?? ''; message.website = object.website ?? ''; @@ -258,14 +254,10 @@ export const MsgCreateProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateProvider { - return MsgCreateProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateProvider { + return MsgCreateProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateProvider { + fromPartial(object: DeepPartial): MsgCreateProvider { const message = createBaseMsgCreateProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -324,13 +316,13 @@ export const MsgCreateProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateProviderResponse { - return MsgCreateProviderResponse.fromPartial(base ?? ({} as any)); + return MsgCreateProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateProviderResponse { const message = createBaseMsgCreateProviderResponse(); return message; @@ -448,14 +440,10 @@ export const MsgUpdateProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgUpdateProvider { - return MsgUpdateProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgUpdateProvider { + return MsgUpdateProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgUpdateProvider { + fromPartial(object: DeepPartial): MsgUpdateProvider { const message = createBaseMsgUpdateProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -514,13 +502,13 @@ export const MsgUpdateProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgUpdateProviderResponse { - return MsgUpdateProviderResponse.fromPartial(base ?? ({} as any)); + return MsgUpdateProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgUpdateProviderResponse { const message = createBaseMsgUpdateProviderResponse(); return message; @@ -588,14 +576,10 @@ export const MsgDeleteProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgDeleteProvider { - return MsgDeleteProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgDeleteProvider { + return MsgDeleteProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgDeleteProvider { + fromPartial(object: DeepPartial): MsgDeleteProvider { const message = createBaseMsgDeleteProvider(); message.owner = object.owner ?? ''; return message; @@ -647,13 +631,13 @@ export const MsgDeleteProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderResponse { - return MsgDeleteProviderResponse.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgDeleteProviderResponse { const message = createBaseMsgDeleteProviderResponse(); return message; @@ -771,10 +755,10 @@ export const Provider = { return obj; }, - create, I>>(base?: I): Provider { - return Provider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Provider { + return Provider.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Provider { + fromPartial(object: DeepPartial): Provider { const message = createBaseProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -877,13 +861,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/v1beta2/query.ts b/ts/src/generated/akash/provider/v1beta2/query.ts index 372e170b..52f6fc72 100644 --- a/ts/src/generated/akash/provider/v1beta2/query.ts +++ b/ts/src/generated/akash/provider/v1beta2/query.ts @@ -99,13 +99,11 @@ export const QueryProvidersRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryProvidersRequest { - return QueryProvidersRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProvidersRequest { + return QueryProvidersRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProvidersRequest { const message = createBaseQueryProvidersRequest(); message.pagination = @@ -202,13 +200,11 @@ export const QueryProvidersResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryProvidersResponse { - return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProvidersResponse { const message = createBaseQueryProvidersResponse(); message.providers = @@ -282,14 +278,10 @@ export const QueryProviderRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryProviderRequest { - return QueryProviderRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryProviderRequest { + fromPartial(object: DeepPartial): QueryProviderRequest { const message = createBaseQueryProviderRequest(); message.owner = object.owner ?? ''; return message; @@ -362,13 +354,11 @@ export const QueryProviderResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryProviderResponse { - return QueryProviderResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProviderResponse { + return QueryProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProviderResponse { const message = createBaseQueryProviderResponse(); message.provider = @@ -445,13 +435,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/v1beta3/genesis.ts b/ts/src/generated/akash/provider/v1beta3/genesis.ts index 8d793174..c5d132ae 100644 --- a/ts/src/generated/akash/provider/v1beta3/genesis.ts +++ b/ts/src/generated/akash/provider/v1beta3/genesis.ts @@ -70,14 +70,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.providers = object.providers?.map((e) => Provider.fromPartial(e)) || []; @@ -108,13 +104,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/v1beta3/provider.ts b/ts/src/generated/akash/provider/v1beta3/provider.ts index 7d703298..497261fc 100644 --- a/ts/src/generated/akash/provider/v1beta3/provider.ts +++ b/ts/src/generated/akash/provider/v1beta3/provider.ts @@ -135,14 +135,10 @@ export const ProviderInfo = { return obj; }, - create, I>>( - base?: I, - ): ProviderInfo { - return ProviderInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ProviderInfo { + create(base?: DeepPartial): ProviderInfo { + return ProviderInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ProviderInfo { const message = createBaseProviderInfo(); message.email = object.email ?? ''; message.website = object.website ?? ''; @@ -258,14 +254,10 @@ export const MsgCreateProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgCreateProvider { - return MsgCreateProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgCreateProvider { + return MsgCreateProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgCreateProvider { + fromPartial(object: DeepPartial): MsgCreateProvider { const message = createBaseMsgCreateProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -324,13 +316,13 @@ export const MsgCreateProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgCreateProviderResponse { - return MsgCreateProviderResponse.fromPartial(base ?? ({} as any)); + return MsgCreateProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgCreateProviderResponse { const message = createBaseMsgCreateProviderResponse(); return message; @@ -448,14 +440,10 @@ export const MsgUpdateProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgUpdateProvider { - return MsgUpdateProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgUpdateProvider { + return MsgUpdateProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgUpdateProvider { + fromPartial(object: DeepPartial): MsgUpdateProvider { const message = createBaseMsgUpdateProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -514,13 +502,13 @@ export const MsgUpdateProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgUpdateProviderResponse { - return MsgUpdateProviderResponse.fromPartial(base ?? ({} as any)); + return MsgUpdateProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgUpdateProviderResponse { const message = createBaseMsgUpdateProviderResponse(); return message; @@ -588,14 +576,10 @@ export const MsgDeleteProvider = { return obj; }, - create, I>>( - base?: I, - ): MsgDeleteProvider { - return MsgDeleteProvider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MsgDeleteProvider { + return MsgDeleteProvider.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MsgDeleteProvider { + fromPartial(object: DeepPartial): MsgDeleteProvider { const message = createBaseMsgDeleteProvider(); message.owner = object.owner ?? ''; return message; @@ -647,13 +631,13 @@ export const MsgDeleteProviderResponse = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): MsgDeleteProviderResponse { - return MsgDeleteProviderResponse.fromPartial(base ?? ({} as any)); + return MsgDeleteProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I, + fromPartial( + _: DeepPartial, ): MsgDeleteProviderResponse { const message = createBaseMsgDeleteProviderResponse(); return message; @@ -771,10 +755,10 @@ export const Provider = { return obj; }, - create, I>>(base?: I): Provider { - return Provider.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Provider { + return Provider.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Provider { + fromPartial(object: DeepPartial): Provider { const message = createBaseProvider(); message.owner = object.owner ?? ''; message.hostUri = object.hostUri ?? ''; @@ -877,13 +861,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/provider/v1beta3/query.ts b/ts/src/generated/akash/provider/v1beta3/query.ts index eebe16f9..2040501f 100644 --- a/ts/src/generated/akash/provider/v1beta3/query.ts +++ b/ts/src/generated/akash/provider/v1beta3/query.ts @@ -99,13 +99,11 @@ export const QueryProvidersRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryProvidersRequest { - return QueryProvidersRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProvidersRequest { + return QueryProvidersRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProvidersRequest { const message = createBaseQueryProvidersRequest(); message.pagination = @@ -202,13 +200,11 @@ export const QueryProvidersResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryProvidersResponse { - return QueryProvidersResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProvidersResponse { + return QueryProvidersResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProvidersResponse { const message = createBaseQueryProvidersResponse(); message.providers = @@ -282,14 +278,10 @@ export const QueryProviderRequest = { return obj; }, - create, I>>( - base?: I, - ): QueryProviderRequest { - return QueryProviderRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProviderRequest { + return QueryProviderRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QueryProviderRequest { + fromPartial(object: DeepPartial): QueryProviderRequest { const message = createBaseQueryProviderRequest(); message.owner = object.owner ?? ''; return message; @@ -362,13 +354,11 @@ export const QueryProviderResponse = { return obj; }, - create, I>>( - base?: I, - ): QueryProviderResponse { - return QueryProviderResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QueryProviderResponse { + return QueryProviderResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): QueryProviderResponse { const message = createBaseQueryProviderResponse(); message.provider = @@ -445,13 +435,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/staking/v1beta3/genesis.ts b/ts/src/generated/akash/staking/v1beta3/genesis.ts index 9c68912e..39bb2ad6 100644 --- a/ts/src/generated/akash/staking/v1beta3/genesis.ts +++ b/ts/src/generated/akash/staking/v1beta3/genesis.ts @@ -68,14 +68,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null @@ -108,13 +104,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/staking/v1beta3/params.ts b/ts/src/generated/akash/staking/v1beta3/params.ts index 8eb8c375..cf1f5110 100644 --- a/ts/src/generated/akash/staking/v1beta3/params.ts +++ b/ts/src/generated/akash/staking/v1beta3/params.ts @@ -70,10 +70,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.minCommissionRate = object.minCommissionRate ?? ''; return message; @@ -103,13 +103,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/take/v1beta3/genesis.ts b/ts/src/generated/akash/take/v1beta3/genesis.ts index a09705e9..4f03db8e 100644 --- a/ts/src/generated/akash/take/v1beta3/genesis.ts +++ b/ts/src/generated/akash/take/v1beta3/genesis.ts @@ -68,14 +68,10 @@ export const GenesisState = { return obj; }, - create, I>>( - base?: I, - ): GenesisState { - return GenesisState.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GenesisState { + return GenesisState.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GenesisState { + fromPartial(object: DeepPartial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null @@ -108,13 +104,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/akash/take/v1beta3/params.ts b/ts/src/generated/akash/take/v1beta3/params.ts index d9fedca6..6b7ff475 100644 --- a/ts/src/generated/akash/take/v1beta3/params.ts +++ b/ts/src/generated/akash/take/v1beta3/params.ts @@ -90,14 +90,10 @@ export const DenomTakeRate = { return obj; }, - create, I>>( - base?: I, - ): DenomTakeRate { - return DenomTakeRate.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DenomTakeRate { + return DenomTakeRate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DenomTakeRate { + fromPartial(object: DeepPartial): DenomTakeRate { const message = createBaseDenomTakeRate(); message.denom = object.denom ?? ''; message.rate = object.rate ?? 0; @@ -189,10 +185,10 @@ export const Params = { return obj; }, - create, I>>(base?: I): Params { - return Params.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Params { + return Params.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Params { + fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.denomTakeRates = object.denomTakeRates?.map((e) => DenomTakeRate.fromPartial(e)) || []; @@ -224,13 +220,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/cosmos/base/query/v1beta1/pagination.ts b/ts/src/generated/cosmos/base/query/v1beta1/pagination.ts index 20b15f49..3c642e14 100644 --- a/ts/src/generated/cosmos/base/query/v1beta1/pagination.ts +++ b/ts/src/generated/cosmos/base/query/v1beta1/pagination.ts @@ -194,12 +194,10 @@ export const PageRequest = { return obj; }, - create, I>>(base?: I): PageRequest { - return PageRequest.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): PageRequest { + return PageRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): PageRequest { + fromPartial(object: DeepPartial): PageRequest { const message = createBasePageRequest(); message.key = object.key ?? new Uint8Array(0); message.offset = @@ -294,14 +292,10 @@ export const PageResponse = { return obj; }, - create, I>>( - base?: I, - ): PageResponse { - return PageResponse.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): PageResponse { + return PageResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): PageResponse { + fromPartial(object: DeepPartial): PageResponse { const message = createBasePageResponse(); message.nextKey = object.nextKey ?? new Uint8Array(0); message.total = @@ -360,13 +354,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/cosmos/base/v1beta1/coin.ts b/ts/src/generated/cosmos/base/v1beta1/coin.ts index 1a0acc7e..b134b157 100644 --- a/ts/src/generated/cosmos/base/v1beta1/coin.ts +++ b/ts/src/generated/cosmos/base/v1beta1/coin.ts @@ -108,10 +108,10 @@ export const Coin = { return obj; }, - create, I>>(base?: I): Coin { - return Coin.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Coin { + return Coin.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Coin { + fromPartial(object: DeepPartial): Coin { const message = createBaseCoin(); message.denom = object.denom ?? ''; message.amount = object.amount ?? ''; @@ -191,10 +191,10 @@ export const DecCoin = { return obj; }, - create, I>>(base?: I): DecCoin { - return DecCoin.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DecCoin { + return DecCoin.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): DecCoin { + fromPartial(object: DeepPartial): DecCoin { const message = createBaseDecCoin(); message.denom = object.denom ?? ''; message.amount = object.amount ?? ''; @@ -260,10 +260,10 @@ export const IntProto = { return obj; }, - create, I>>(base?: I): IntProto { - return IntProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): IntProto { + return IntProto.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): IntProto { + fromPartial(object: DeepPartial): IntProto { const message = createBaseIntProto(); message.int = object.int ?? ''; return message; @@ -328,10 +328,10 @@ export const DecProto = { return obj; }, - create, I>>(base?: I): DecProto { - return DecProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DecProto { + return DecProto.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): DecProto { + fromPartial(object: DeepPartial): DecProto { const message = createBaseDecProto(); message.dec = object.dec ?? ''; return message; @@ -361,13 +361,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/google/api/http.ts b/ts/src/generated/google/api/http.ts index 591aed1e..80b5f6f4 100644 --- a/ts/src/generated/google/api/http.ts +++ b/ts/src/generated/google/api/http.ts @@ -371,10 +371,10 @@ export const Http = { return obj; }, - create, I>>(base?: I): Http { - return Http.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Http { + return Http.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Http { + fromPartial(object: DeepPartial): Http { const message = createBaseHttp(); message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; message.fullyDecodeReservedExpansion = @@ -596,10 +596,10 @@ export const HttpRule = { return obj; }, - create, I>>(base?: I): HttpRule { - return HttpRule.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): HttpRule { + return HttpRule.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): HttpRule { + fromPartial(object: DeepPartial): HttpRule { const message = createBaseHttpRule(); message.selector = object.selector ?? ''; message.get = object.get ?? undefined; @@ -691,14 +691,10 @@ export const CustomHttpPattern = { return obj; }, - create, I>>( - base?: I, - ): CustomHttpPattern { - return CustomHttpPattern.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): CustomHttpPattern { + return CustomHttpPattern.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): CustomHttpPattern { + fromPartial(object: DeepPartial): CustomHttpPattern { const message = createBaseCustomHttpPattern(); message.kind = object.kind ?? ''; message.path = object.path ?? ''; @@ -729,13 +725,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/google/protobuf/descriptor.ts b/ts/src/generated/google/protobuf/descriptor.ts index 68825d8e..e300c199 100644 --- a/ts/src/generated/google/protobuf/descriptor.ts +++ b/ts/src/generated/google/protobuf/descriptor.ts @@ -1232,14 +1232,10 @@ export const FileDescriptorSet = { return obj; }, - create, I>>( - base?: I, - ): FileDescriptorSet { - return FileDescriptorSet.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): FileDescriptorSet { + create(base?: DeepPartial): FileDescriptorSet { + return FileDescriptorSet.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FileDescriptorSet { const message = createBaseFileDescriptorSet(); message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; @@ -1535,14 +1531,10 @@ export const FileDescriptorProto = { return obj; }, - create, I>>( - base?: I, - ): FileDescriptorProto { - return FileDescriptorProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): FileDescriptorProto { + return FileDescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): FileDescriptorProto { + fromPartial(object: DeepPartial): FileDescriptorProto { const message = createBaseFileDescriptorProto(); message.name = object.name ?? ''; message.package = object.package ?? ''; @@ -1816,14 +1808,10 @@ export const DescriptorProto = { return obj; }, - create, I>>( - base?: I, - ): DescriptorProto { - return DescriptorProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): DescriptorProto { + return DescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): DescriptorProto { + fromPartial(object: DeepPartial): DescriptorProto { const message = createBaseDescriptorProto(); message.name = object.name ?? ''; message.field = @@ -1955,13 +1943,13 @@ export const DescriptorProto_ExtensionRange = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): DescriptorProto_ExtensionRange { - return DescriptorProto_ExtensionRange.fromPartial(base ?? ({} as any)); + return DescriptorProto_ExtensionRange.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): DescriptorProto_ExtensionRange { const message = createBaseDescriptorProto_ExtensionRange(); message.start = object.start ?? 0; @@ -2056,13 +2044,13 @@ export const DescriptorProto_ReservedRange = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): DescriptorProto_ReservedRange { - return DescriptorProto_ReservedRange.fromPartial(base ?? ({} as any)); + return DescriptorProto_ReservedRange.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): DescriptorProto_ReservedRange { const message = createBaseDescriptorProto_ReservedRange(); message.start = object.start ?? 0; @@ -2146,13 +2134,11 @@ export const ExtensionRangeOptions = { return obj; }, - create, I>>( - base?: I, - ): ExtensionRangeOptions { - return ExtensionRangeOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ExtensionRangeOptions { + return ExtensionRangeOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): ExtensionRangeOptions { const message = createBaseExtensionRangeOptions(); message.uninterpretedOption = @@ -2401,14 +2387,10 @@ export const FieldDescriptorProto = { return obj; }, - create, I>>( - base?: I, - ): FieldDescriptorProto { - return FieldDescriptorProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): FieldDescriptorProto { + return FieldDescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): FieldDescriptorProto { + fromPartial(object: DeepPartial): FieldDescriptorProto { const message = createBaseFieldDescriptorProto(); message.name = object.name ?? ''; message.number = object.number ?? 0; @@ -2509,14 +2491,10 @@ export const OneofDescriptorProto = { return obj; }, - create, I>>( - base?: I, - ): OneofDescriptorProto { - return OneofDescriptorProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OneofDescriptorProto { + return OneofDescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): OneofDescriptorProto { + fromPartial(object: DeepPartial): OneofDescriptorProto { const message = createBaseOneofDescriptorProto(); message.name = object.name ?? ''; message.options = @@ -2670,14 +2648,10 @@ export const EnumDescriptorProto = { return obj; }, - create, I>>( - base?: I, - ): EnumDescriptorProto { - return EnumDescriptorProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): EnumDescriptorProto { + return EnumDescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): EnumDescriptorProto { + fromPartial(object: DeepPartial): EnumDescriptorProto { const message = createBaseEnumDescriptorProto(); message.name = object.name ?? ''; message.value = @@ -2774,16 +2748,14 @@ export const EnumDescriptorProto_EnumReservedRange = { return obj; }, - create< - I extends Exact, I>, - >(base?: I): EnumDescriptorProto_EnumReservedRange { - return EnumDescriptorProto_EnumReservedRange.fromPartial( - base ?? ({} as any), - ); + create( + base?: DeepPartial, + ): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I>, - >(object: I): EnumDescriptorProto_EnumReservedRange { + fromPartial( + object: DeepPartial, + ): EnumDescriptorProto_EnumReservedRange { const message = createBaseEnumDescriptorProto_EnumReservedRange(); message.start = object.start ?? 0; message.end = object.end ?? 0; @@ -2893,13 +2865,13 @@ export const EnumValueDescriptorProto = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): EnumValueDescriptorProto { - return EnumValueDescriptorProto.fromPartial(base ?? ({} as any)); + return EnumValueDescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): EnumValueDescriptorProto { const message = createBaseEnumValueDescriptorProto(); message.name = object.name ?? ''; @@ -3015,13 +2987,11 @@ export const ServiceDescriptorProto = { return obj; }, - create, I>>( - base?: I, - ): ServiceDescriptorProto { - return ServiceDescriptorProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceDescriptorProto { + return ServiceDescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): ServiceDescriptorProto { const message = createBaseServiceDescriptorProto(); message.name = object.name ?? ''; @@ -3196,13 +3166,11 @@ export const MethodDescriptorProto = { return obj; }, - create, I>>( - base?: I, - ): MethodDescriptorProto { - return MethodDescriptorProto.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MethodDescriptorProto { + return MethodDescriptorProto.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): MethodDescriptorProto { const message = createBaseMethodDescriptorProto(); message.name = object.name ?? ''; @@ -3699,12 +3667,10 @@ export const FileOptions = { return obj; }, - create, I>>(base?: I): FileOptions { - return FileOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): FileOptions { + return FileOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): FileOptions { + fromPartial(object: DeepPartial): FileOptions { const message = createBaseFileOptions(); message.javaPackage = object.javaPackage ?? ''; message.javaOuterClassname = object.javaOuterClassname ?? ''; @@ -3884,14 +3850,10 @@ export const MessageOptions = { return obj; }, - create, I>>( - base?: I, - ): MessageOptions { - return MessageOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MessageOptions { + return MessageOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MessageOptions { + fromPartial(object: DeepPartial): MessageOptions { const message = createBaseMessageOptions(); message.messageSetWireFormat = object.messageSetWireFormat ?? false; message.noStandardDescriptorAccessor = @@ -4092,14 +4054,10 @@ export const FieldOptions = { return obj; }, - create, I>>( - base?: I, - ): FieldOptions { - return FieldOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): FieldOptions { + return FieldOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): FieldOptions { + fromPartial(object: DeepPartial): FieldOptions { const message = createBaseFieldOptions(); message.ctype = object.ctype ?? 0; message.packed = object.packed ?? false; @@ -4182,14 +4140,10 @@ export const OneofOptions = { return obj; }, - create, I>>( - base?: I, - ): OneofOptions { - return OneofOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): OneofOptions { + return OneofOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): OneofOptions { + fromPartial(object: DeepPartial): OneofOptions { const message = createBaseOneofOptions(); message.uninterpretedOption = object.uninterpretedOption?.map((e) => @@ -4302,12 +4256,10 @@ export const EnumOptions = { return obj; }, - create, I>>(base?: I): EnumOptions { - return EnumOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): EnumOptions { + return EnumOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): EnumOptions { + fromPartial(object: DeepPartial): EnumOptions { const message = createBaseEnumOptions(); message.allowAlias = object.allowAlias ?? false; message.deprecated = object.deprecated ?? false; @@ -4405,14 +4357,10 @@ export const EnumValueOptions = { return obj; }, - create, I>>( - base?: I, - ): EnumValueOptions { - return EnumValueOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): EnumValueOptions { + return EnumValueOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): EnumValueOptions { + fromPartial(object: DeepPartial): EnumValueOptions { const message = createBaseEnumValueOptions(); message.deprecated = object.deprecated ?? false; message.uninterpretedOption = @@ -4509,14 +4457,10 @@ export const ServiceOptions = { return obj; }, - create, I>>( - base?: I, - ): ServiceOptions { - return ServiceOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): ServiceOptions { + return ServiceOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): ServiceOptions { + fromPartial(object: DeepPartial): ServiceOptions { const message = createBaseServiceOptions(); message.deprecated = object.deprecated ?? false; message.uninterpretedOption = @@ -4638,14 +4582,10 @@ export const MethodOptions = { return obj; }, - create, I>>( - base?: I, - ): MethodOptions { - return MethodOptions.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): MethodOptions { + return MethodOptions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): MethodOptions { + fromPartial(object: DeepPartial): MethodOptions { const message = createBaseMethodOptions(); message.deprecated = object.deprecated ?? false; message.idempotencyLevel = object.idempotencyLevel ?? 0; @@ -4849,14 +4789,10 @@ export const UninterpretedOption = { return obj; }, - create, I>>( - base?: I, - ): UninterpretedOption { - return UninterpretedOption.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): UninterpretedOption { + return UninterpretedOption.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): UninterpretedOption { + fromPartial(object: DeepPartial): UninterpretedOption { const message = createBaseUninterpretedOption(); message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || @@ -4960,13 +4896,13 @@ export const UninterpretedOption_NamePart = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): UninterpretedOption_NamePart { - return UninterpretedOption_NamePart.fromPartial(base ?? ({} as any)); + return UninterpretedOption_NamePart.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): UninterpretedOption_NamePart { const message = createBaseUninterpretedOption_NamePart(); message.namePart = object.namePart ?? ''; @@ -5042,14 +4978,10 @@ export const SourceCodeInfo = { return obj; }, - create, I>>( - base?: I, - ): SourceCodeInfo { - return SourceCodeInfo.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): SourceCodeInfo { + return SourceCodeInfo.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): SourceCodeInfo { + fromPartial(object: DeepPartial): SourceCodeInfo { const message = createBaseSourceCodeInfo(); message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; @@ -5229,13 +5161,11 @@ export const SourceCodeInfo_Location = { return obj; }, - create, I>>( - base?: I, - ): SourceCodeInfo_Location { - return SourceCodeInfo_Location.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): SourceCodeInfo_Location { const message = createBaseSourceCodeInfo_Location(); message.path = object.path?.map((e) => e) || []; @@ -5317,14 +5247,10 @@ export const GeneratedCodeInfo = { return obj; }, - create, I>>( - base?: I, - ): GeneratedCodeInfo { - return GeneratedCodeInfo.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): GeneratedCodeInfo { + return GeneratedCodeInfo.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): GeneratedCodeInfo { + fromPartial(object: DeepPartial): GeneratedCodeInfo { const message = createBaseGeneratedCodeInfo(); message.annotation = object.annotation?.map((e) => @@ -5459,13 +5385,13 @@ export const GeneratedCodeInfo_Annotation = { return obj; }, - create, I>>( - base?: I, + create( + base?: DeepPartial, ): GeneratedCodeInfo_Annotation { - return GeneratedCodeInfo_Annotation.fromPartial(base ?? ({} as any)); + return GeneratedCodeInfo_Annotation.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GeneratedCodeInfo_Annotation { const message = createBaseGeneratedCodeInfo_Annotation(); message.path = object.path?.map((e) => e) || []; @@ -5527,13 +5453,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/google/protobuf/empty.ts b/ts/src/generated/google/protobuf/empty.ts index fb647157..1019e834 100644 --- a/ts/src/generated/google/protobuf/empty.ts +++ b/ts/src/generated/google/protobuf/empty.ts @@ -55,10 +55,10 @@ export const Empty = { return obj; }, - create, I>>(base?: I): Empty { - return Empty.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Empty { + return Empty.fromPartial(base ?? {}); }, - fromPartial, I>>(_: I): Empty { + fromPartial(_: DeepPartial): Empty { const message = createBaseEmpty(); return message; }, @@ -87,13 +87,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/google/protobuf/timestamp.ts b/ts/src/generated/google/protobuf/timestamp.ts index 780a4066..58c4c3d4 100644 --- a/ts/src/generated/google/protobuf/timestamp.ts +++ b/ts/src/generated/google/protobuf/timestamp.ts @@ -185,12 +185,10 @@ export const Timestamp = { return obj; }, - create, I>>(base?: I): Timestamp { - return Timestamp.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Timestamp { + return Timestamp.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): Timestamp { + fromPartial(object: DeepPartial): Timestamp { const message = createBaseTimestamp(); message.seconds = object.seconds !== undefined && object.seconds !== null @@ -224,13 +222,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts b/ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts index 44a80569..f32513f9 100644 --- a/ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts +++ b/ts/src/generated/k8s.io/apimachinery/pkg/api/resource/generated.ts @@ -152,10 +152,10 @@ export const Quantity = { return obj; }, - create, I>>(base?: I): Quantity { - return Quantity.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): Quantity { + return Quantity.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): Quantity { + fromPartial(object: DeepPartial): Quantity { const message = createBaseQuantity(); message.string = object.string ?? ''; return message; @@ -223,14 +223,10 @@ export const QuantityValue = { return obj; }, - create, I>>( - base?: I, - ): QuantityValue { - return QuantityValue.fromPartial(base ?? ({} as any)); + create(base?: DeepPartial): QuantityValue { + return QuantityValue.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): QuantityValue { + fromPartial(object: DeepPartial): QuantityValue { const message = createBaseQuantityValue(); message.string = object.string ?? ''; return message; @@ -260,13 +256,6 @@ export type DeepPartial = T extends Builtin ? { [K in Exclude]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude | '$type'>]: never; - }; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/ts/tsconfig.build.json b/ts/tsconfig.build.json index d11b9ccc..11fe39ac 100644 --- a/ts/tsconfig.build.json +++ b/ts/tsconfig.build.json @@ -1,5 +1,5 @@ { "extends": "./tsconfig.json", - "include": ["src/index.ts", "src/types/**/*.d.ts"], + "include": ["src/**/*.ts"], "exclude": ["node_modules", "src/**/*.spec.ts"] }