From 83829f94956df22121d01a092511eea5aa7245da Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Thu, 19 Dec 2024 17:50:20 +0100 Subject: [PATCH] WIP refs akash-network/console#566 refs akash-network/support#212 --- package-lock.json | 479 +- package.json | 11 +- patches/@cosmjs+proto-signing+0.32.4.patch | 29 + src/certificates/index.ts | 2 +- src/keplr/index.ts | 3 +- src/pbclient/pbclient.ts | 6 +- src/protobuf/akash/audit/v1beta1/audit.ts | 669 --- src/protobuf/akash/audit/v1beta1/genesis.ts | 95 - src/protobuf/akash/audit/v1beta1/query.ts | 539 --- src/protobuf/akash/audit/v1beta2/audit.ts | 669 --- src/protobuf/akash/audit/v1beta2/genesis.ts | 95 - src/protobuf/akash/audit/v1beta2/query.ts | 539 --- src/protobuf/akash/audit/v1beta3/audit.ts | 669 --- src/protobuf/akash/audit/v1beta3/genesis.ts | 95 - src/protobuf/akash/audit/v1beta3/query.ts | 539 --- src/protobuf/akash/base/v1beta1/attribute.ts | 269 -- src/protobuf/akash/base/v1beta1/endpoint.ts | 130 - src/protobuf/akash/base/v1beta1/resource.ts | 370 -- .../akash/base/v1beta1/resourcevalue.ts | 124 - src/protobuf/akash/base/v1beta2/attribute.ts | 269 -- src/protobuf/akash/base/v1beta2/endpoint.ts | 147 - src/protobuf/akash/base/v1beta2/resource.ts | 277 -- .../akash/base/v1beta2/resourceunits.ts | 143 - .../akash/base/v1beta2/resourcevalue.ts | 124 - src/protobuf/akash/base/v1beta3/attribute.ts | 269 -- src/protobuf/akash/base/v1beta3/cpu.ts | 110 - src/protobuf/akash/base/v1beta3/endpoint.ts | 147 - src/protobuf/akash/base/v1beta3/gpu.ts | 110 - src/protobuf/akash/base/v1beta3/memory.ts | 114 - src/protobuf/akash/base/v1beta3/resources.ts | 168 - .../akash/base/v1beta3/resourceunits.ts | 157 - .../akash/base/v1beta3/resourcevalue.ts | 124 - src/protobuf/akash/base/v1beta3/storage.ts | 125 - src/protobuf/akash/cert/v1beta1/cert.ts | 623 --- src/protobuf/akash/cert/v1beta1/genesis.ts | 173 - src/protobuf/akash/cert/v1beta1/query.ts | 284 -- src/protobuf/akash/cert/v1beta2/cert.ts | 624 --- src/protobuf/akash/cert/v1beta2/genesis.ts | 173 - src/protobuf/akash/cert/v1beta2/query.ts | 285 -- src/protobuf/akash/cert/v1beta3/cert.ts | 624 --- src/protobuf/akash/cert/v1beta3/genesis.ts | 173 - src/protobuf/akash/cert/v1beta3/query.ts | 285 -- .../akash/deployment/v1beta1/authz.ts | 105 - .../akash/deployment/v1beta1/deployment.ts | 967 ---- .../akash/deployment/v1beta1/genesis.ts | 193 - .../akash/deployment/v1beta1/group.ts | 780 ---- .../akash/deployment/v1beta1/params.ts | 100 - .../akash/deployment/v1beta1/query.ts | 506 --- .../akash/deployment/v1beta2/authz.ts | 105 - .../akash/deployment/v1beta2/deployment.ts | 362 -- .../akash/deployment/v1beta2/deploymentmsg.ts | 602 --- .../akash/deployment/v1beta2/genesis.ts | 193 - .../akash/deployment/v1beta2/group.ts | 189 - .../akash/deployment/v1beta2/groupid.ts | 119 - .../akash/deployment/v1beta2/groupmsg.ts | 365 -- .../akash/deployment/v1beta2/groupspec.ts | 126 - .../akash/deployment/v1beta2/params.ts | 100 - .../akash/deployment/v1beta2/query.ts | 507 --- .../akash/deployment/v1beta2/resource.ts | 121 - .../akash/deployment/v1beta2/service.ts | 92 - .../akash/deployment/v1beta3/authz.ts | 105 - .../akash/deployment/v1beta3/deployment.ts | 362 -- .../akash/deployment/v1beta3/deploymentmsg.ts | 602 --- .../akash/deployment/v1beta3/genesis.ts | 193 - .../akash/deployment/v1beta3/group.ts | 189 - .../akash/deployment/v1beta3/groupid.ts | 119 - .../akash/deployment/v1beta3/groupmsg.ts | 365 -- .../akash/deployment/v1beta3/groupspec.ts | 126 - .../akash/deployment/v1beta3/params.ts | 95 - .../akash/deployment/v1beta3/query.ts | 507 --- .../akash/deployment/v1beta3/resource.ts | 121 - .../akash/deployment/v1beta3/resourceunit.ts | 121 - .../akash/deployment/v1beta3/service.ts | 92 - src/protobuf/akash/escrow/v1beta1/genesis.ts | 113 - src/protobuf/akash/escrow/v1beta1/query.ts | 457 -- src/protobuf/akash/escrow/v1beta1/types.ts | 458 -- src/protobuf/akash/escrow/v1beta2/genesis.ts | 113 - src/protobuf/akash/escrow/v1beta2/query.ts | 457 -- src/protobuf/akash/escrow/v1beta2/types.ts | 489 --- src/protobuf/akash/escrow/v1beta3/genesis.ts | 113 - src/protobuf/akash/escrow/v1beta3/query.ts | 457 -- src/protobuf/akash/escrow/v1beta3/types.ts | 489 --- src/protobuf/akash/gov/v1beta3/genesis.ts | 95 - src/protobuf/akash/gov/v1beta3/params.ts | 132 - src/protobuf/akash/icaauth/query.ts | 194 - src/protobuf/akash/icaauth/tx.ts | 326 -- .../akash/inflation/v1beta2/genesis.ts | 95 - .../akash/inflation/v1beta2/params.ts | 128 - .../akash/inflation/v1beta3/genesis.ts | 95 - .../akash/inflation/v1beta3/params.ts | 128 - src/protobuf/akash/market/v1beta1/bid.ts | 672 --- src/protobuf/akash/market/v1beta1/genesis.ts | 130 - src/protobuf/akash/market/v1beta1/lease.ts | 736 ---- src/protobuf/akash/market/v1beta1/order.ts | 383 -- src/protobuf/akash/market/v1beta1/params.ts | 109 - src/protobuf/akash/market/v1beta1/query.ts | 951 ---- src/protobuf/akash/market/v1beta1/service.ts | 78 - src/protobuf/akash/market/v1beta2/bid.ts | 673 --- src/protobuf/akash/market/v1beta2/genesis.ts | 130 - src/protobuf/akash/market/v1beta2/lease.ts | 748 ---- src/protobuf/akash/market/v1beta2/order.ts | 384 -- src/protobuf/akash/market/v1beta2/params.ts | 109 - src/protobuf/akash/market/v1beta2/query.ts | 952 ---- src/protobuf/akash/market/v1beta2/service.ts | 65 - src/protobuf/akash/market/v1beta3/bid.ts | 673 --- src/protobuf/akash/market/v1beta3/genesis.ts | 146 - src/protobuf/akash/market/v1beta3/lease.ts | 748 ---- src/protobuf/akash/market/v1beta3/order.ts | 384 -- src/protobuf/akash/market/v1beta3/params.ts | 109 - src/protobuf/akash/market/v1beta3/query.ts | 952 ---- src/protobuf/akash/market/v1beta3/service.ts | 65 - src/protobuf/akash/market/v1beta4/bid.ts | 781 ---- src/protobuf/akash/market/v1beta4/genesis.ts | 146 - src/protobuf/akash/market/v1beta4/lease.ts | 748 ---- src/protobuf/akash/market/v1beta4/order.ts | 384 -- src/protobuf/akash/market/v1beta4/params.ts | 109 - src/protobuf/akash/market/v1beta4/query.ts | 952 ---- src/protobuf/akash/market/v1beta4/service.ts | 65 - .../akash/provider/v1beta1/genesis.ts | 95 - .../akash/provider/v1beta1/provider.ts | 660 --- src/protobuf/akash/provider/v1beta1/query.ts | 332 -- .../akash/provider/v1beta2/genesis.ts | 95 - .../akash/provider/v1beta2/provider.ts | 660 --- src/protobuf/akash/provider/v1beta2/query.ts | 332 -- .../akash/provider/v1beta3/genesis.ts | 95 - .../akash/provider/v1beta3/provider.ts | 660 --- src/protobuf/akash/provider/v1beta3/query.ts | 332 -- src/protobuf/akash/staking/v1beta3/genesis.ts | 95 - src/protobuf/akash/staking/v1beta3/params.ts | 95 - src/protobuf/akash/take/v1beta3/genesis.ts | 95 - src/protobuf/akash/take/v1beta3/params.ts | 183 - src/protobuf/akash/take/v1beta3/query.ts | 16 - .../cosmos/base/query/v1beta1/pagination.ts | 294 -- src/protobuf/cosmos/base/v1beta1/coin.ts | 304 -- src/protobuf/cosmos_proto/cosmos.ts | 2 - src/protobuf/gogoproto/gogo.ts | 2 - src/protobuf/google/api/annotations.ts | 2 - src/protobuf/google/api/http.ts | 617 --- src/protobuf/google/protobuf/any.ts | 244 -- src/protobuf/google/protobuf/descriptor.ts | 3902 ----------------- src/protobuf/typeRegistry.ts | 29 - src/stargate/index.ts | 25 +- 142 files changed, 328 insertions(+), 44948 deletions(-) create mode 100644 patches/@cosmjs+proto-signing+0.32.4.patch delete mode 100644 src/protobuf/akash/audit/v1beta1/audit.ts delete mode 100644 src/protobuf/akash/audit/v1beta1/genesis.ts delete mode 100644 src/protobuf/akash/audit/v1beta1/query.ts delete mode 100644 src/protobuf/akash/audit/v1beta2/audit.ts delete mode 100644 src/protobuf/akash/audit/v1beta2/genesis.ts delete mode 100644 src/protobuf/akash/audit/v1beta2/query.ts delete mode 100644 src/protobuf/akash/audit/v1beta3/audit.ts delete mode 100644 src/protobuf/akash/audit/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/audit/v1beta3/query.ts delete mode 100644 src/protobuf/akash/base/v1beta1/attribute.ts delete mode 100644 src/protobuf/akash/base/v1beta1/endpoint.ts delete mode 100644 src/protobuf/akash/base/v1beta1/resource.ts delete mode 100644 src/protobuf/akash/base/v1beta1/resourcevalue.ts delete mode 100644 src/protobuf/akash/base/v1beta2/attribute.ts delete mode 100644 src/protobuf/akash/base/v1beta2/endpoint.ts delete mode 100644 src/protobuf/akash/base/v1beta2/resource.ts delete mode 100644 src/protobuf/akash/base/v1beta2/resourceunits.ts delete mode 100644 src/protobuf/akash/base/v1beta2/resourcevalue.ts delete mode 100644 src/protobuf/akash/base/v1beta3/attribute.ts delete mode 100644 src/protobuf/akash/base/v1beta3/cpu.ts delete mode 100644 src/protobuf/akash/base/v1beta3/endpoint.ts delete mode 100644 src/protobuf/akash/base/v1beta3/gpu.ts delete mode 100644 src/protobuf/akash/base/v1beta3/memory.ts delete mode 100644 src/protobuf/akash/base/v1beta3/resources.ts delete mode 100644 src/protobuf/akash/base/v1beta3/resourceunits.ts delete mode 100644 src/protobuf/akash/base/v1beta3/resourcevalue.ts delete mode 100644 src/protobuf/akash/base/v1beta3/storage.ts delete mode 100644 src/protobuf/akash/cert/v1beta1/cert.ts delete mode 100644 src/protobuf/akash/cert/v1beta1/genesis.ts delete mode 100644 src/protobuf/akash/cert/v1beta1/query.ts delete mode 100644 src/protobuf/akash/cert/v1beta2/cert.ts delete mode 100644 src/protobuf/akash/cert/v1beta2/genesis.ts delete mode 100644 src/protobuf/akash/cert/v1beta2/query.ts delete mode 100644 src/protobuf/akash/cert/v1beta3/cert.ts delete mode 100644 src/protobuf/akash/cert/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/cert/v1beta3/query.ts delete mode 100644 src/protobuf/akash/deployment/v1beta1/authz.ts delete mode 100644 src/protobuf/akash/deployment/v1beta1/deployment.ts delete mode 100644 src/protobuf/akash/deployment/v1beta1/genesis.ts delete mode 100644 src/protobuf/akash/deployment/v1beta1/group.ts delete mode 100644 src/protobuf/akash/deployment/v1beta1/params.ts delete mode 100644 src/protobuf/akash/deployment/v1beta1/query.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/authz.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/deployment.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/deploymentmsg.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/genesis.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/group.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/groupid.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/groupmsg.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/groupspec.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/params.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/query.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/resource.ts delete mode 100644 src/protobuf/akash/deployment/v1beta2/service.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/authz.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/deployment.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/deploymentmsg.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/group.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/groupid.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/groupmsg.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/groupspec.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/params.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/query.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/resource.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/resourceunit.ts delete mode 100644 src/protobuf/akash/deployment/v1beta3/service.ts delete mode 100644 src/protobuf/akash/escrow/v1beta1/genesis.ts delete mode 100644 src/protobuf/akash/escrow/v1beta1/query.ts delete mode 100644 src/protobuf/akash/escrow/v1beta1/types.ts delete mode 100644 src/protobuf/akash/escrow/v1beta2/genesis.ts delete mode 100644 src/protobuf/akash/escrow/v1beta2/query.ts delete mode 100644 src/protobuf/akash/escrow/v1beta2/types.ts delete mode 100644 src/protobuf/akash/escrow/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/escrow/v1beta3/query.ts delete mode 100644 src/protobuf/akash/escrow/v1beta3/types.ts delete mode 100644 src/protobuf/akash/gov/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/gov/v1beta3/params.ts delete mode 100644 src/protobuf/akash/icaauth/query.ts delete mode 100644 src/protobuf/akash/icaauth/tx.ts delete mode 100644 src/protobuf/akash/inflation/v1beta2/genesis.ts delete mode 100644 src/protobuf/akash/inflation/v1beta2/params.ts delete mode 100644 src/protobuf/akash/inflation/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/inflation/v1beta3/params.ts delete mode 100644 src/protobuf/akash/market/v1beta1/bid.ts delete mode 100644 src/protobuf/akash/market/v1beta1/genesis.ts delete mode 100644 src/protobuf/akash/market/v1beta1/lease.ts delete mode 100644 src/protobuf/akash/market/v1beta1/order.ts delete mode 100644 src/protobuf/akash/market/v1beta1/params.ts delete mode 100644 src/protobuf/akash/market/v1beta1/query.ts delete mode 100644 src/protobuf/akash/market/v1beta1/service.ts delete mode 100644 src/protobuf/akash/market/v1beta2/bid.ts delete mode 100644 src/protobuf/akash/market/v1beta2/genesis.ts delete mode 100644 src/protobuf/akash/market/v1beta2/lease.ts delete mode 100644 src/protobuf/akash/market/v1beta2/order.ts delete mode 100644 src/protobuf/akash/market/v1beta2/params.ts delete mode 100644 src/protobuf/akash/market/v1beta2/query.ts delete mode 100644 src/protobuf/akash/market/v1beta2/service.ts delete mode 100644 src/protobuf/akash/market/v1beta3/bid.ts delete mode 100644 src/protobuf/akash/market/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/market/v1beta3/lease.ts delete mode 100644 src/protobuf/akash/market/v1beta3/order.ts delete mode 100644 src/protobuf/akash/market/v1beta3/params.ts delete mode 100644 src/protobuf/akash/market/v1beta3/query.ts delete mode 100644 src/protobuf/akash/market/v1beta3/service.ts delete mode 100644 src/protobuf/akash/market/v1beta4/bid.ts delete mode 100644 src/protobuf/akash/market/v1beta4/genesis.ts delete mode 100644 src/protobuf/akash/market/v1beta4/lease.ts delete mode 100644 src/protobuf/akash/market/v1beta4/order.ts delete mode 100644 src/protobuf/akash/market/v1beta4/params.ts delete mode 100644 src/protobuf/akash/market/v1beta4/query.ts delete mode 100644 src/protobuf/akash/market/v1beta4/service.ts delete mode 100644 src/protobuf/akash/provider/v1beta1/genesis.ts delete mode 100644 src/protobuf/akash/provider/v1beta1/provider.ts delete mode 100644 src/protobuf/akash/provider/v1beta1/query.ts delete mode 100644 src/protobuf/akash/provider/v1beta2/genesis.ts delete mode 100644 src/protobuf/akash/provider/v1beta2/provider.ts delete mode 100644 src/protobuf/akash/provider/v1beta2/query.ts delete mode 100644 src/protobuf/akash/provider/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/provider/v1beta3/provider.ts delete mode 100644 src/protobuf/akash/provider/v1beta3/query.ts delete mode 100644 src/protobuf/akash/staking/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/staking/v1beta3/params.ts delete mode 100644 src/protobuf/akash/take/v1beta3/genesis.ts delete mode 100644 src/protobuf/akash/take/v1beta3/params.ts delete mode 100644 src/protobuf/akash/take/v1beta3/query.ts delete mode 100644 src/protobuf/cosmos/base/query/v1beta1/pagination.ts delete mode 100644 src/protobuf/cosmos/base/v1beta1/coin.ts delete mode 100644 src/protobuf/cosmos_proto/cosmos.ts delete mode 100644 src/protobuf/gogoproto/gogo.ts delete mode 100644 src/protobuf/google/api/annotations.ts delete mode 100644 src/protobuf/google/api/http.ts delete mode 100644 src/protobuf/google/protobuf/any.ts delete mode 100644 src/protobuf/google/protobuf/descriptor.ts delete mode 100644 src/protobuf/typeRegistry.ts diff --git a/package-lock.json b/package-lock.json index 9237f30..c27ad05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,11 +7,13 @@ "": { "name": "@akashnetwork/akashjs", "version": "0.10.1", + "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@akashnetwork/akash-api": "^1.4.0", + "@akashnetwork/akash-api": "file:../../go-projects/akash-api/ts", + "@bufbuild/protobuf": "2.0.0", "@cosmjs/amino": "^0.32.4", - "@cosmjs/launchpad": "^0.27.0", + "@cosmjs/launchpad": "^0.27.1", "@cosmjs/proto-signing": "^0.32.4", "@cosmjs/stargate": "^0.32.4", "@cosmjs/tendermint-rpc": "^0.32.4", @@ -58,6 +60,7 @@ "jest": "^29.7.0", "lint-staged": "^15.2.2", "node-polyfill-webpack-plugin": "^1.1.4", + "patch-package": "^8.0.0", "prettier": "^3.2.5", "rimraf": "^5.0.1", "sinon": "^13.0.1", @@ -75,6 +78,40 @@ "node": ">18.0.0" } }, + "../../go-projects/akash-api/ts": { + "name": "@akashnetwork/akash-api", + "version": "0.0.0", + "license": "Apache-2.0", + "dependencies": { + "rxjs": "^7.8.1" + }, + "devDependencies": { + "@semantic-release/commit-analyzer": "^12.0.0", + "@semantic-release/github": "^10.0.3", + "@semantic-release/release-notes-generator": "^13.0.0", + "@types/jest": "^29.5.12", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "conventional-changelog-conventionalcommits": "^7.0.2", + "eslint": "^8.57.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-simple-import-sort": "^12.0.0", + "jest": "^29.7.0", + "lint-staged": "^15.2.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "semantic-release-commit-filter": "^1.0.2", + "sort-json": "^2.0.1", + "ts-jest": "^29.1.2", + "ts-proto": "^2.2.0", + "typescript": "^5.4.2" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.10.6" + } + }, + "../akash-api/ts": { + "extraneous": true + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -86,23 +123,8 @@ } }, "node_modules/@akashnetwork/akash-api": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@akashnetwork/akash-api/-/akash-api-1.4.0.tgz", - "integrity": "sha512-xJTHjkSLHQRk2z1s+pk/fSTXQrJCTyzUzWHn+TvvJapjEsDPT0+AW2YhrmYLOpS0n4s/8GnoGB9swRuzgYYLbg==", - "dependencies": { - "rxjs": "^7.8.1" - }, - "peerDependencies": { - "@grpc/grpc-js": "^1.10.6" - } - }, - "node_modules/@akashnetwork/akash-api/node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dependencies": { - "tslib": "^2.1.0" - } + "resolved": "../../go-projects/akash-api/ts", + "link": true }, "node_modules/@ampproject/remapping": { "version": "2.2.0", @@ -792,6 +814,11 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@bufbuild/protobuf": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.0.0.tgz", + "integrity": "sha512-sw2JhwJyvyL0zlhG61aDzOVryEfJg2PDZFSV7i7IdC7nAE41WuXCru3QWLGiP87At0BMzKOoKO/FqEGoKygGZQ==" + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -1363,7 +1390,6 @@ "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.32.4.tgz", "integrity": "sha512-zKYOt6hPy8obIFtLie/xtygCkH9ZROiQ12UHfKsOkWaZfPQUvVbtgmu6R4Kn1tFLI/SRkw7eqhaogmW/3NYu/Q==", - "license": "Apache-2.0", "dependencies": { "@cosmjs/crypto": "^0.32.4", "@cosmjs/encoding": "^0.32.4", @@ -1495,7 +1521,6 @@ "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.32.4.tgz", "integrity": "sha512-QdyQDbezvdRI4xxSlyM1rSVBO2st5sqtbEIl3IX03uJ7YiZIQHyv6vaHVf1V4mapusCqguiHJzm4N4gsFdLBbQ==", - "license": "Apache-2.0", "dependencies": { "@cosmjs/amino": "^0.32.4", "@cosmjs/crypto": "^0.32.4", @@ -1568,7 +1593,6 @@ "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.32.4.tgz", "integrity": "sha512-usj08LxBSsPRq9sbpCeVdyLx2guEcOHfJS9mHGCLCXpdAPEIEQEtWLDpEUc0LEhWOx6+k/ChXTc5NpFkdrtGUQ==", - "license": "Apache-2.0", "dependencies": { "@confio/ics23": "^0.6.8", "@cosmjs/amino": "^0.32.4", @@ -1627,7 +1651,6 @@ "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.4.tgz", "integrity": "sha512-MWvUUno+4bCb/LmlMIErLypXxy7ckUuzEmpufYYYd9wgbdCXaTaO08SZzyFM5PI8UJ/0S2AmUrgWhldlbxO8mw==", - "license": "Apache-2.0", "dependencies": { "@cosmjs/crypto": "^0.32.4", "@cosmjs/encoding": "^0.32.4", @@ -1883,175 +1906,6 @@ "npm": ">=6.14.13" } }, - "node_modules/@grpc/grpc-js": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.7.tgz", - "integrity": "sha512-ZMBVjSeDAz3tFSehyO6Pd08xZT1HfIwq3opbeM4cDlBh52gmwp0wVIPcQur53NN0ac68HMZ/7SF2rGRD5KmVmg==", - "peer": true, - "dependencies": { - "@grpc/proto-loader": "^0.7.13", - "@js-sdsl/ordered-map": "^4.4.2" - }, - "engines": { - "node": ">=12.10.0" - } - }, - "node_modules/@grpc/proto-loader": { - "version": "0.7.13", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", - "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", - "peer": true, - "dependencies": { - "lodash.camelcase": "^4.3.0", - "long": "^5.0.0", - "protobufjs": "^7.2.5", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@grpc/proto-loader/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==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@grpc/proto-loader/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "peer": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@grpc/proto-loader/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==", - "peer": true - }, - "node_modules/@grpc/proto-loader/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "peer": true - }, - "node_modules/@grpc/proto-loader/node_modules/protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", - "hasInstallScript": true, - "peer": 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/@grpc/proto-loader/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==", - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@grpc/proto-loader/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==", - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@grpc/proto-loader/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "peer": 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/@grpc/proto-loader/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@grpc/proto-loader/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "peer": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@grpc/proto-loader/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "peer": true, - "engines": { - "node": ">=12" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -2725,16 +2579,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@js-sdsl/ordered-map": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", - "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/@noble/hashes": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", @@ -4183,6 +4027,12 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -4316,6 +4166,7 @@ "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" }, @@ -4510,6 +4361,15 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -5540,6 +5400,7 @@ "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" }, @@ -5550,7 +5411,8 @@ "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==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/color-support": { "version": "1.1.3", @@ -6649,6 +6511,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, "engines": { "node": ">=6" } @@ -7312,6 +7175,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/findit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/findit/-/findit-2.0.0.tgz", @@ -7649,6 +7521,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -8530,6 +8403,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -8543,6 +8431,7 @@ "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" } @@ -8813,6 +8702,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -10268,6 +10169,15 @@ "node": ">=0.10.0" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -10598,7 +10508,8 @@ "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true }, "node_modules/lodash.capitalize": { "version": "4.2.1", @@ -14570,6 +14481,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -14603,6 +14530,15 @@ "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", "dev": true }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/own-or": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/own-or/-/own-or-1.0.0.tgz", @@ -14806,6 +14742,128 @@ "dev": true, "peer": true }, + "node_modules/patch-package": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", + "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "dev": true, + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/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/patch-package/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/patch-package/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "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/patch-package/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/patch-package/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/patch-package/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/patch-package/node_modules/yaml": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -15655,6 +15713,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -19684,6 +19743,18 @@ "node": ">=0.6.0" } }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", diff --git a/package.json b/package.json index c4b0157..6c5c46b 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "commitlint": "commitlint --edit", "dev:watch": "tsc -- --watch", "format": "prettier --write './**/*.{js,ts,json}' --config ./.prettierrc", + "postinstall": "patch-package", "lint": "eslint . --ext .js,.ts,.json -c .eslintrc.json", "lint:fix": "npm run lint -- --fix", "prepublishOnly": "npm run build:production", @@ -46,9 +47,10 @@ ] }, "dependencies": { - "@akashnetwork/akash-api": "^1.4.0", + "@akashnetwork/akash-api": "file:../../go-projects/akash-api/ts", + "@bufbuild/protobuf": "2.0.0", "@cosmjs/amino": "^0.32.4", - "@cosmjs/launchpad": "^0.27.0", + "@cosmjs/launchpad": "^0.27.1", "@cosmjs/proto-signing": "^0.32.4", "@cosmjs/stargate": "^0.32.4", "@cosmjs/tendermint-rpc": "^0.32.4", @@ -60,13 +62,13 @@ "json-stable-stringify": "^1.0.2", "jsrsasign": "^11.1.0", "keytar": "^7.7.0", + "lodash": "^4.17.21", "node-fetch": "2", "pkijs": "^3.0.0", "process": "^0.11.10", "pvutils": "^1.0.17", "simple-jsonrpc-js": "^1.2.0", - "sort-json": "^2.0.1", - "lodash": "^4.17.21" + "sort-json": "^2.0.1" }, "devDependencies": { "@commitlint/cli": "^19.2.2", @@ -95,6 +97,7 @@ "jest": "^29.7.0", "lint-staged": "^15.2.2", "node-polyfill-webpack-plugin": "^1.1.4", + "patch-package": "^8.0.0", "prettier": "^3.2.5", "rimraf": "^5.0.1", "sinon": "^13.0.1", diff --git a/patches/@cosmjs+proto-signing+0.32.4.patch b/patches/@cosmjs+proto-signing+0.32.4.patch new file mode 100644 index 0000000..8ef37f2 --- /dev/null +++ b/patches/@cosmjs+proto-signing+0.32.4.patch @@ -0,0 +1,29 @@ +diff --git a/node_modules/@cosmjs/proto-signing/build/registry.d.ts b/node_modules/@cosmjs/proto-signing/build/registry.d.ts +index c6efeeb..21c0e86 100644 +--- a/node_modules/@cosmjs/proto-signing/build/registry.d.ts ++++ b/node_modules/@cosmjs/proto-signing/build/registry.d.ts +@@ -2,6 +2,7 @@ import { BinaryWriter } from "cosmjs-types/binary"; + import { TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx"; + import { Any } from "cosmjs-types/google/protobuf/any"; + import type protobuf from "protobufjs"; ++import * as buf from "@bufbuild/protobuf"; + /** + * A type generated by Telescope 1.0. + */ +@@ -39,7 +40,15 @@ export interface PbjsGeneratedType { + }, writer?: protobuf.Writer) => protobuf.Writer; + readonly decode: (reader: protobuf.Reader | Uint8Array, length?: number) => any; + } +-export type GeneratedType = TelescopeGeneratedType | TsProtoGeneratedType | PbjsGeneratedType; ++ ++export interface BufGeneratedType { ++ readonly encode: (message: any | { ++ [k: string]: any; ++ }, writer?: buf.BinaryWriter) => buf.BinaryWriter; ++ readonly decode: (input: Uint8Array | buf.BinaryReader, length?: number) => any; ++ readonly fromPartial: (object: any) => any; ++} ++export type GeneratedType = TelescopeGeneratedType | TsProtoGeneratedType | PbjsGeneratedType | BufGeneratedType; + export declare function isTelescopeGeneratedType(type: GeneratedType): type is TelescopeGeneratedType; + export declare function isTsProtoGeneratedType(type: GeneratedType): type is TsProtoGeneratedType; + export declare function isPbjsGeneratedType(type: GeneratedType): type is PbjsGeneratedType; diff --git a/src/certificates/index.ts b/src/certificates/index.ts index fe30474..95ce049 100644 --- a/src/certificates/index.ts +++ b/src/certificates/index.ts @@ -1,7 +1,7 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { DeliverTxResponse } from "@cosmjs/stargate/build/stargateclient"; import { toBase64 } from "pvutils"; -import { CertificateFilter, QueryCertificatesRequest, QueryCertificatesResponse } from "@akashnetwork/akash-api/akash/cert/v1beta3"; +import { CertificateFilter, QueryCertificatesRequest, QueryCertificatesResponse } from "@akashnetwork/akash-api/akash/cert/v1"; import type { pems } from "./generate509"; import { Message as stargateMessages } from "../stargate"; diff --git a/src/keplr/index.ts b/src/keplr/index.ts index d821224..c434c45 100644 --- a/src/keplr/index.ts +++ b/src/keplr/index.ts @@ -2,8 +2,7 @@ import { getAkashTypeRegistry } from "../stargate"; import { defaultRegistryTypes, SigningStargateClient } from "@cosmjs/stargate"; import { OfflineDirectSigner, OfflineSigner, Registry } from "@cosmjs/proto-signing"; import { AminoTypes } from "@cosmjs/stargate"; -import { Certificate } from "@akashnetwork/akash-api/akash/cert/v1beta2"; -import { MsgCreateCertificate } from "@akashnetwork/akash-api/deprecated/akash/cert/v1beta1"; +import { Certificate, MsgCreateCertificate } from "@akashnetwork/akash-api/akash/cert/v1"; /** * Represents a blockchain chain. diff --git a/src/pbclient/pbclient.ts b/src/pbclient/pbclient.ts index 869d047..20069ac 100644 --- a/src/pbclient/pbclient.ts +++ b/src/pbclient/pbclient.ts @@ -1,6 +1,6 @@ import { Message } from "../stargate"; import { AminoMsg } from "@cosmjs/amino"; -import { MsgCreateCertificate, MsgRevokeCertificate } from "@akashnetwork/akash-api/akash/cert/v1beta3"; +import { MsgCreateCertificate, MsgRevokeCertificate } from "@akashnetwork/akash-api/akash/cert/v1"; const FEE = { amount: [ @@ -14,7 +14,7 @@ const FEE = { /** * Creates an Amino message object. - * + * * @param {Message} message - The type of the message. * @param {AminoMsg} messageBody - The body of the message. * @returns {object} The Amino message object. @@ -36,7 +36,7 @@ type MessageTypes = { /** * Creates a Stargate message object with a fee. - * + * * @template T * @param {T} message - The type of the message. * @param {MessageTypes[T]} messageBody - The body of the message. diff --git a/src/protobuf/akash/audit/v1beta1/audit.ts b/src/protobuf/akash/audit/v1beta1/audit.ts deleted file mode 100644 index e040b94..0000000 --- a/src/protobuf/akash/audit/v1beta1/audit.ts +++ /dev/null @@ -1,669 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Attribute } from "../../base/v1beta1/attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 4: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Provider { - return { - $type: Provider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Provider): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AuditedAttributes { - return { - $type: AuditedAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: AuditedAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.attributes.push(AuditedAttributes.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AttributesResponse { - return { - $type: AttributesResponse.$type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) : [] - }; - }, - - toJSON(message: AttributesResponse): unknown { - const obj: any = {}; - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? AuditedAttributes.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditors.push(reader.string()); - break; - case 2: - message.owners.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AttributesFilters { - return { - $type: AttributesFilters.$type, - auditors: Array.isArray(object?.auditors) ? object.auditors.map((e: any) => String(e)) : [], - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: AttributesFilters): unknown { - const obj: any = {}; - if (message.auditors) { - obj.auditors = message.auditors.map(e => e); - } else { - obj.auditors = []; - } - if (message.owners) { - obj.owners = message.owners.map(e => e); - } else { - obj.owners = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSignProviderAttributes { - return { - $type: MsgSignProviderAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: MsgSignProviderAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSignProviderAttributesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgSignProviderAttributesResponse { - return { - $type: MsgSignProviderAttributesResponse.$type - }; - }, - - toJSON(_: MsgSignProviderAttributesResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.keys.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteProviderAttributes { - return { - $type: MsgDeleteProviderAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: MsgDeleteProviderAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.keys) { - obj.keys = message.keys.map(e => e); - } else { - obj.keys = []; - } - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteProviderAttributesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDeleteProviderAttributesResponse { - return { - $type: MsgDeleteProviderAttributesResponse.$type - }; - }, - - toJSON(_: MsgDeleteProviderAttributesResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.audit.v1beta1.Msg", "SignProviderAttributes", data); - return promise.then(data => MsgSignProviderAttributesResponse.decode(new _m0.Reader(data))); - } - - DeleteProviderAttributes(request: MsgDeleteProviderAttributes): Promise { - const data = MsgDeleteProviderAttributes.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta1.Msg", "DeleteProviderAttributes", data); - return promise.then(data => MsgDeleteProviderAttributesResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/audit/v1beta1/genesis.ts b/src/protobuf/akash/audit/v1beta1/genesis.ts deleted file mode 100644 index 1d23f0d..0000000 --- a/src/protobuf/akash/audit/v1beta1/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { AuditedAttributes } from "../../../akash/audit/v1beta1/audit"; - -export const protobufPackage = "akash.audit.v1beta1"; - -/** GenesisState defines the basic genesis state used by audit module */ -export interface GenesisState { - $type: "akash.audit.v1beta1.GenesisState"; - attributes: AuditedAttributes[]; -} - -function createBaseGenesisState(): GenesisState { - return { $type: "akash.audit.v1beta1.GenesisState", attributes: [] }; -} - -export const GenesisState = { - $type: "akash.audit.v1beta1.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 : new _m0.Reader(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: - message.attributes.push(AuditedAttributes.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? AuditedAttributes.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/audit/v1beta1/query.ts b/src/protobuf/akash/audit/v1beta1/query.ts deleted file mode 100644 index ed75a42..0000000 --- a/src/protobuf/akash/audit/v1beta1/query.ts +++ /dev/null @@ -1,539 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageResponse, PageRequest } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Provider } from "../../../akash/audit/v1beta1/audit"; - -export const protobufPackage = "akash.audit.v1beta1"; - -/** QueryProvidersResponse is response type for the Query/Providers RPC method */ -export interface QueryProvidersResponse { - $type: "akash.audit.v1beta1.QueryProvidersResponse"; - providers: Provider[]; - pagination?: PageResponse; -} - -/** QueryProviderRequest is request type for the Query/Provider RPC method */ -export interface QueryProviderRequest { - $type: "akash.audit.v1beta1.QueryProviderRequest"; - auditor: string; - owner: string; -} - -/** QueryAllProvidersAttributesRequest is request type for the Query/All Providers RPC method */ -export interface QueryAllProvidersAttributesRequest { - $type: "akash.audit.v1beta1.QueryAllProvidersAttributesRequest"; - pagination?: PageRequest; -} - -/** QueryProviderAttributesRequest is request type for the Query/Provider RPC method */ -export interface QueryProviderAttributesRequest { - $type: "akash.audit.v1beta1.QueryProviderAttributesRequest"; - owner: string; - pagination?: PageRequest; -} - -/** QueryProviderAuditorRequest is request type for the Query/Providers RPC method */ -export interface QueryProviderAuditorRequest { - $type: "akash.audit.v1beta1.QueryProviderAuditorRequest"; - auditor: string; - owner: string; -} - -/** QueryAuditorAttributesRequest is request type for the Query/Providers RPC method */ -export interface QueryAuditorAttributesRequest { - $type: "akash.audit.v1beta1.QueryAuditorAttributesRequest"; - auditor: string; - pagination?: PageRequest; -} - -function createBaseQueryProvidersResponse(): QueryProvidersResponse { - return { - $type: "akash.audit.v1beta1.QueryProvidersResponse", - providers: [], - pagination: undefined - }; -} - -export const QueryProvidersResponse = { - $type: "akash.audit.v1beta1.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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProvidersResponse { - return { - $type: QueryProvidersResponse.$type, - providers: 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) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryProviderRequest", - auditor: "", - owner: "" - }; -} - -export const QueryProviderRequest = { - $type: "akash.audit.v1beta1.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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderRequest { - return { - $type: QueryProviderRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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.v1beta1.QueryAllProvidersAttributesRequest", - pagination: undefined - }; -} - -export const QueryAllProvidersAttributesRequest = { - $type: "akash.audit.v1beta1.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 : new _m0.Reader(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: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, 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.v1beta1.QueryProviderAttributesRequest", - owner: "", - pagination: undefined - }; -} - -export const QueryProviderAttributesRequest = { - $type: "akash.audit.v1beta1.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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderAttributesRequest { - return { - $type: QueryProviderAttributesRequest.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryProviderAttributesRequest): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryProviderAuditorRequest", - auditor: "", - owner: "" - }; -} - -export const QueryProviderAuditorRequest = { - $type: "akash.audit.v1beta1.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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderAuditorRequest { - return { - $type: QueryProviderAuditorRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderAuditorRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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.v1beta1.QueryAuditorAttributesRequest", - auditor: "", - pagination: undefined - }; -} - -export const QueryAuditorAttributesRequest = { - $type: "akash.audit.v1beta1.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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAuditorAttributesRequest { - return { - $type: QueryAuditorAttributesRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryAuditorAttributesRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.audit.v1beta1.Query", "AllProvidersAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - ProviderAttributes(request: QueryProviderAttributesRequest): Promise { - const data = QueryProviderAttributesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta1.Query", "ProviderAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - ProviderAuditorAttributes(request: QueryProviderAuditorRequest): Promise { - const data = QueryProviderAuditorRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta1.Query", "ProviderAuditorAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - AuditorAttributes(request: QueryAuditorAttributesRequest): Promise { - const data = QueryAuditorAttributesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta1.Query", "AuditorAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/audit/v1beta2/audit.ts b/src/protobuf/akash/audit/v1beta2/audit.ts deleted file mode 100644 index 7a750e9..0000000 --- a/src/protobuf/akash/audit/v1beta2/audit.ts +++ /dev/null @@ -1,669 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Attribute } from "../../base/v1beta2/attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 4: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Provider { - return { - $type: Provider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Provider): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AuditedAttributes { - return { - $type: AuditedAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: AuditedAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.attributes.push(AuditedAttributes.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AttributesResponse { - return { - $type: AttributesResponse.$type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) : [] - }; - }, - - toJSON(message: AttributesResponse): unknown { - const obj: any = {}; - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? AuditedAttributes.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditors.push(reader.string()); - break; - case 2: - message.owners.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AttributesFilters { - return { - $type: AttributesFilters.$type, - auditors: Array.isArray(object?.auditors) ? object.auditors.map((e: any) => String(e)) : [], - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: AttributesFilters): unknown { - const obj: any = {}; - if (message.auditors) { - obj.auditors = message.auditors.map(e => e); - } else { - obj.auditors = []; - } - if (message.owners) { - obj.owners = message.owners.map(e => e); - } else { - obj.owners = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSignProviderAttributes { - return { - $type: MsgSignProviderAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: MsgSignProviderAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSignProviderAttributesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgSignProviderAttributesResponse { - return { - $type: MsgSignProviderAttributesResponse.$type - }; - }, - - toJSON(_: MsgSignProviderAttributesResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.keys.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteProviderAttributes { - return { - $type: MsgDeleteProviderAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: MsgDeleteProviderAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.keys) { - obj.keys = message.keys.map(e => e); - } else { - obj.keys = []; - } - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteProviderAttributesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDeleteProviderAttributesResponse { - return { - $type: MsgDeleteProviderAttributesResponse.$type - }; - }, - - toJSON(_: MsgDeleteProviderAttributesResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.audit.v1beta2.Msg", "SignProviderAttributes", data); - return promise.then(data => MsgSignProviderAttributesResponse.decode(new _m0.Reader(data))); - } - - DeleteProviderAttributes(request: MsgDeleteProviderAttributes): Promise { - const data = MsgDeleteProviderAttributes.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta2.Msg", "DeleteProviderAttributes", data); - return promise.then(data => MsgDeleteProviderAttributesResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/audit/v1beta2/genesis.ts b/src/protobuf/akash/audit/v1beta2/genesis.ts deleted file mode 100644 index 1aced68..0000000 --- a/src/protobuf/akash/audit/v1beta2/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { AuditedAttributes } from "./audit"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.attributes.push(AuditedAttributes.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? AuditedAttributes.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/audit/v1beta2/query.ts b/src/protobuf/akash/audit/v1beta2/query.ts deleted file mode 100644 index 54d080f..0000000 --- a/src/protobuf/akash/audit/v1beta2/query.ts +++ /dev/null @@ -1,539 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Provider } from "./audit"; -import { PageResponse, PageRequest } from "../../../cosmos/base/query/v1beta1/pagination"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProvidersResponse { - return { - $type: QueryProvidersResponse.$type, - providers: 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) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderRequest { - return { - $type: QueryProviderRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(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: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderAttributesRequest { - return { - $type: QueryProviderAttributesRequest.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryProviderAttributesRequest): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderAuditorRequest { - return { - $type: QueryProviderAuditorRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderAuditorRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAuditorAttributesRequest { - return { - $type: QueryAuditorAttributesRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryAuditorAttributesRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.audit.v1beta2.Query", "AllProvidersAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - ProviderAttributes(request: QueryProviderAttributesRequest): Promise { - const data = QueryProviderAttributesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta2.Query", "ProviderAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - ProviderAuditorAttributes(request: QueryProviderAuditorRequest): Promise { - const data = QueryProviderAuditorRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta2.Query", "ProviderAuditorAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - AuditorAttributes(request: QueryAuditorAttributesRequest): Promise { - const data = QueryAuditorAttributesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta2.Query", "AuditorAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/audit/v1beta3/audit.ts b/src/protobuf/akash/audit/v1beta3/audit.ts deleted file mode 100644 index cc56653..0000000 --- a/src/protobuf/akash/audit/v1beta3/audit.ts +++ /dev/null @@ -1,669 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Attribute } from "../../base/v1beta3/attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 4: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Provider { - return { - $type: Provider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Provider): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AuditedAttributes { - return { - $type: AuditedAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: AuditedAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.attributes.push(AuditedAttributes.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AttributesResponse { - return { - $type: AttributesResponse.$type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) : [] - }; - }, - - toJSON(message: AttributesResponse): unknown { - const obj: any = {}; - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? AuditedAttributes.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditors.push(reader.string()); - break; - case 2: - message.owners.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AttributesFilters { - return { - $type: AttributesFilters.$type, - auditors: Array.isArray(object?.auditors) ? object.auditors.map((e: any) => String(e)) : [], - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: AttributesFilters): unknown { - const obj: any = {}; - if (message.auditors) { - obj.auditors = message.auditors.map(e => e); - } else { - obj.auditors = []; - } - if (message.owners) { - obj.owners = message.owners.map(e => e); - } else { - obj.owners = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSignProviderAttributes { - return { - $type: MsgSignProviderAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: MsgSignProviderAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSignProviderAttributesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgSignProviderAttributesResponse { - return { - $type: MsgSignProviderAttributesResponse.$type - }; - }, - - toJSON(_: MsgSignProviderAttributesResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.auditor = reader.string(); - break; - case 3: - message.keys.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteProviderAttributes { - return { - $type: MsgDeleteProviderAttributes.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - auditor: isSet(object.auditor) ? String(object.auditor) : "", - keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: MsgDeleteProviderAttributes): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.auditor !== undefined && (obj.auditor = message.auditor); - if (message.keys) { - obj.keys = message.keys.map(e => e); - } else { - obj.keys = []; - } - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteProviderAttributesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDeleteProviderAttributesResponse { - return { - $type: MsgDeleteProviderAttributesResponse.$type - }; - }, - - toJSON(_: MsgDeleteProviderAttributesResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.audit.v1beta3.Msg", "SignProviderAttributes", data); - return promise.then(data => MsgSignProviderAttributesResponse.decode(new _m0.Reader(data))); - } - - DeleteProviderAttributes(request: MsgDeleteProviderAttributes): Promise { - const data = MsgDeleteProviderAttributes.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta3.Msg", "DeleteProviderAttributes", data); - return promise.then(data => MsgDeleteProviderAttributesResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/audit/v1beta3/genesis.ts b/src/protobuf/akash/audit/v1beta3/genesis.ts deleted file mode 100644 index eddd326..0000000 --- a/src/protobuf/akash/audit/v1beta3/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { AuditedAttributes } from "./audit"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.attributes.push(AuditedAttributes.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => AuditedAttributes.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? AuditedAttributes.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/audit/v1beta3/query.ts b/src/protobuf/akash/audit/v1beta3/query.ts deleted file mode 100644 index 59be257..0000000 --- a/src/protobuf/akash/audit/v1beta3/query.ts +++ /dev/null @@ -1,539 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Provider } from "./audit"; -import { PageResponse, PageRequest } from "../../../cosmos/base/query/v1beta1/pagination"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProvidersResponse { - return { - $type: QueryProvidersResponse.$type, - providers: 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) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderRequest { - return { - $type: QueryProviderRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(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: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderAttributesRequest { - return { - $type: QueryProviderAttributesRequest.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryProviderAttributesRequest): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderAuditorRequest { - return { - $type: QueryProviderAuditorRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderAuditorRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(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: - message.auditor = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAuditorAttributesRequest { - return { - $type: QueryAuditorAttributesRequest.$type, - auditor: isSet(object.auditor) ? String(object.auditor) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryAuditorAttributesRequest): unknown { - const obj: any = {}; - message.auditor !== undefined && (obj.auditor = message.auditor); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.audit.v1beta3.Query", "AllProvidersAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - ProviderAttributes(request: QueryProviderAttributesRequest): Promise { - const data = QueryProviderAttributesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta3.Query", "ProviderAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - ProviderAuditorAttributes(request: QueryProviderAuditorRequest): Promise { - const data = QueryProviderAuditorRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta3.Query", "ProviderAuditorAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - AuditorAttributes(request: QueryAuditorAttributesRequest): Promise { - const data = QueryAuditorAttributesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.audit.v1beta3.Query", "AuditorAttributes", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta1/attribute.ts b/src/protobuf/akash/base/v1beta1/attribute.ts deleted file mode 100644 index f317cb6..0000000 --- a/src/protobuf/akash/base/v1beta1/attribute.ts +++ /dev/null @@ -1,269 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Attribute { - return { - $type: Attribute.$type, - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? String(object.value) : "" - }; - }, - - toJSON(message: Attribute): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; - }, - - 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 : new _m0.Reader(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: - message.allOf.push(reader.string()); - break; - case 2: - message.anyOf.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignedBy { - return { - $type: SignedBy.$type, - allOf: Array.isArray(object?.allOf) ? object.allOf.map((e: any) => String(e)) : [], - anyOf: Array.isArray(object?.anyOf) ? object.anyOf.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: SignedBy): unknown { - const obj: any = {}; - if (message.allOf) { - obj.allOf = message.allOf.map(e => e); - } else { - obj.allOf = []; - } - if (message.anyOf) { - obj.anyOf = message.anyOf.map(e => e); - } else { - obj.anyOf = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.signedBy = SignedBy.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PlacementRequirements { - return { - $type: PlacementRequirements.$type, - signedBy: isSet(object.signedBy) ? SignedBy.fromJSON(object.signedBy) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: PlacementRequirements): unknown { - const obj: any = {}; - message.signedBy !== undefined && (obj.signedBy = message.signedBy ? SignedBy.toJSON(message.signedBy) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta1/endpoint.ts b/src/protobuf/akash/base/v1beta1/endpoint.ts deleted file mode 100644 index cde6f71..0000000 --- a/src/protobuf/akash/base/v1beta1/endpoint.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.kind = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.kind !== undefined && (obj.kind = endpoint_KindToJSON(message.kind)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta1/resource.ts b/src/protobuf/akash/base/v1beta1/resource.ts deleted file mode 100644 index 52cd8ad..0000000 --- a/src/protobuf/akash/base/v1beta1/resource.ts +++ /dev/null @@ -1,370 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceValue } from "./resourcevalue"; -import { Attribute } from "./attribute"; -import { Endpoint } from "./endpoint"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.units = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CPU { - return { - $type: CPU.$type, - units: isSet(object.units) ? ResourceValue.fromJSON(object.units) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: CPU): unknown { - const obj: any = {}; - message.units !== undefined && (obj.units = message.units ? ResourceValue.toJSON(message.units) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.quantity = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Memory { - return { - $type: Memory.$type, - quantity: isSet(object.quantity) ? ResourceValue.fromJSON(object.quantity) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Memory): unknown { - const obj: any = {}; - message.quantity !== undefined && (obj.quantity = message.quantity ? ResourceValue.toJSON(message.quantity) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.quantity = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Storage { - return { - $type: Storage.$type, - quantity: isSet(object.quantity) ? ResourceValue.fromJSON(object.quantity) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Storage): unknown { - const obj: any = {}; - message.quantity !== undefined && (obj.quantity = message.quantity ? ResourceValue.toJSON(message.quantity) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.cpu = CPU.decode(reader, reader.uint32()); - break; - case 2: - message.memory = Memory.decode(reader, reader.uint32()); - break; - case 3: - message.storage = Storage.decode(reader, reader.uint32()); - break; - case 4: - message.endpoints.push(Endpoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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: Array.isArray(object?.endpoints) ? object.endpoints.map((e: any) => Endpoint.fromJSON(e)) : [] - }; - }, - - toJSON(message: ResourceUnits): unknown { - const obj: any = {}; - message.cpu !== undefined && (obj.cpu = message.cpu ? CPU.toJSON(message.cpu) : undefined); - message.memory !== undefined && (obj.memory = message.memory ? Memory.toJSON(message.memory) : undefined); - message.storage !== undefined && (obj.storage = message.storage ? Storage.toJSON(message.storage) : undefined); - if (message.endpoints) { - obj.endpoints = message.endpoints.map(e => (e ? Endpoint.toJSON(e) : undefined)); - } else { - obj.endpoints = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta1/resourcevalue.ts b/src/protobuf/akash/base/v1beta1/resourcevalue.ts deleted file mode 100644 index 14b6355..0000000 --- a/src/protobuf/akash/base/v1beta1/resourcevalue.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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() }; -} - -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 : new _m0.Reader(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: - message.val = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResourceValue { - return { - $type: ResourceValue.$type, - val: isSet(object.val) ? bytesFromBase64(object.val) : new Uint8Array() - }; - }, - - toJSON(message: ResourceValue): unknown { - const obj: any = {}; - message.val !== undefined && (obj.val = base64FromBytes(message.val !== undefined ? message.val : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): ResourceValue { - const message = createBaseResourceValue(); - message.val = object.val ?? new Uint8Array(); - return message; - } -}; - -messageTypeRegistry.set(ResourceValue.$type, ResourceValue); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta2/attribute.ts b/src/protobuf/akash/base/v1beta2/attribute.ts deleted file mode 100644 index 5df0168..0000000 --- a/src/protobuf/akash/base/v1beta2/attribute.ts +++ /dev/null @@ -1,269 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Attribute { - return { - $type: Attribute.$type, - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? String(object.value) : "" - }; - }, - - toJSON(message: Attribute): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; - }, - - 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 : new _m0.Reader(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: - message.allOf.push(reader.string()); - break; - case 2: - message.anyOf.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignedBy { - return { - $type: SignedBy.$type, - allOf: Array.isArray(object?.allOf) ? object.allOf.map((e: any) => String(e)) : [], - anyOf: Array.isArray(object?.anyOf) ? object.anyOf.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: SignedBy): unknown { - const obj: any = {}; - if (message.allOf) { - obj.allOf = message.allOf.map(e => e); - } else { - obj.allOf = []; - } - if (message.anyOf) { - obj.anyOf = message.anyOf.map(e => e); - } else { - obj.anyOf = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.signedBy = SignedBy.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PlacementRequirements { - return { - $type: PlacementRequirements.$type, - signedBy: isSet(object.signedBy) ? SignedBy.fromJSON(object.signedBy) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: PlacementRequirements): unknown { - const obj: any = {}; - message.signedBy !== undefined && (obj.signedBy = message.signedBy ? SignedBy.toJSON(message.signedBy) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta2/endpoint.ts b/src/protobuf/akash/base/v1beta2/endpoint.ts deleted file mode 100644 index eef949f..0000000 --- a/src/protobuf/akash/base/v1beta2/endpoint.ts +++ /dev/null @@ -1,147 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.kind = reader.int32() as any; - break; - case 2: - message.sequenceNumber = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Endpoint { - return { - $type: Endpoint.$type, - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, - sequenceNumber: isSet(object.sequenceNumber) ? Number(object.sequenceNumber) : 0 - }; - }, - - toJSON(message: Endpoint): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = endpoint_KindToJSON(message.kind)); - message.sequenceNumber !== undefined && (obj.sequenceNumber = Math.round(message.sequenceNumber)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta2/resource.ts b/src/protobuf/akash/base/v1beta2/resource.ts deleted file mode 100644 index 7bc58b7..0000000 --- a/src/protobuf/akash/base/v1beta2/resource.ts +++ /dev/null @@ -1,277 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceValue } from "./resourcevalue"; -import { Attribute } from "./attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.units = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CPU { - return { - $type: CPU.$type, - units: isSet(object.units) ? ResourceValue.fromJSON(object.units) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: CPU): unknown { - const obj: any = {}; - message.units !== undefined && (obj.units = message.units ? ResourceValue.toJSON(message.units) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.quantity = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Memory { - return { - $type: Memory.$type, - quantity: isSet(object.quantity) ? ResourceValue.fromJSON(object.quantity) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Memory): unknown { - const obj: any = {}; - message.quantity !== undefined && (obj.quantity = message.quantity ? ResourceValue.toJSON(message.quantity) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.quantity = ResourceValue.decode(reader, reader.uint32()); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Storage { - return { - $type: Storage.$type, - name: isSet(object.name) ? String(object.name) : "", - quantity: isSet(object.quantity) ? ResourceValue.fromJSON(object.quantity) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Storage): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.quantity !== undefined && (obj.quantity = message.quantity ? ResourceValue.toJSON(message.quantity) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta2/resourceunits.ts b/src/protobuf/akash/base/v1beta2/resourceunits.ts deleted file mode 100644 index 036b64b..0000000 --- a/src/protobuf/akash/base/v1beta2/resourceunits.ts +++ /dev/null @@ -1,143 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { CPU, Memory, Storage } from "./resource"; -import { Endpoint } from "./endpoint"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.cpu = CPU.decode(reader, reader.uint32()); - break; - case 2: - message.memory = Memory.decode(reader, reader.uint32()); - break; - case 3: - message.storage.push(Storage.decode(reader, reader.uint32())); - break; - case 4: - message.endpoints.push(Endpoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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: Array.isArray(object?.storage) ? object.storage.map((e: any) => Storage.fromJSON(e)) : [], - endpoints: Array.isArray(object?.endpoints) ? object.endpoints.map((e: any) => Endpoint.fromJSON(e)) : [] - }; - }, - - toJSON(message: ResourceUnits): unknown { - const obj: any = {}; - message.cpu !== undefined && (obj.cpu = message.cpu ? CPU.toJSON(message.cpu) : undefined); - message.memory !== undefined && (obj.memory = message.memory ? Memory.toJSON(message.memory) : undefined); - if (message.storage) { - obj.storage = message.storage.map(e => (e ? Storage.toJSON(e) : undefined)); - } else { - obj.storage = []; - } - if (message.endpoints) { - obj.endpoints = message.endpoints.map(e => (e ? Endpoint.toJSON(e) : undefined)); - } else { - obj.endpoints = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta2/resourcevalue.ts b/src/protobuf/akash/base/v1beta2/resourcevalue.ts deleted file mode 100644 index 5a31e7d..0000000 --- a/src/protobuf/akash/base/v1beta2/resourcevalue.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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() }; -} - -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 : new _m0.Reader(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: - message.val = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResourceValue { - return { - $type: ResourceValue.$type, - val: isSet(object.val) ? bytesFromBase64(object.val) : new Uint8Array() - }; - }, - - toJSON(message: ResourceValue): unknown { - const obj: any = {}; - message.val !== undefined && (obj.val = base64FromBytes(message.val !== undefined ? message.val : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): ResourceValue { - const message = createBaseResourceValue(); - message.val = object.val ?? new Uint8Array(); - return message; - } -}; - -messageTypeRegistry.set(ResourceValue.$type, ResourceValue); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/attribute.ts b/src/protobuf/akash/base/v1beta3/attribute.ts deleted file mode 100644 index 32f8baa..0000000 --- a/src/protobuf/akash/base/v1beta3/attribute.ts +++ /dev/null @@ -1,269 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Attribute { - return { - $type: Attribute.$type, - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? String(object.value) : "" - }; - }, - - toJSON(message: Attribute): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; - }, - - 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 : new _m0.Reader(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: - message.allOf.push(reader.string()); - break; - case 2: - message.anyOf.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignedBy { - return { - $type: SignedBy.$type, - allOf: Array.isArray(object?.allOf) ? object.allOf.map((e: any) => String(e)) : [], - anyOf: Array.isArray(object?.anyOf) ? object.anyOf.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: SignedBy): unknown { - const obj: any = {}; - if (message.allOf) { - obj.allOf = message.allOf.map(e => e); - } else { - obj.allOf = []; - } - if (message.anyOf) { - obj.anyOf = message.anyOf.map(e => e); - } else { - obj.anyOf = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.signedBy = SignedBy.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PlacementRequirements { - return { - $type: PlacementRequirements.$type, - signedBy: isSet(object.signedBy) ? SignedBy.fromJSON(object.signedBy) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: PlacementRequirements): unknown { - const obj: any = {}; - message.signedBy !== undefined && (obj.signedBy = message.signedBy ? SignedBy.toJSON(message.signedBy) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/cpu.ts b/src/protobuf/akash/base/v1beta3/cpu.ts deleted file mode 100644 index fbb1513..0000000 --- a/src/protobuf/akash/base/v1beta3/cpu.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceValue } from "./resourcevalue"; -import { Attribute } from "./attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.units = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CPU { - return { - $type: CPU.$type, - units: isSet(object.units) ? ResourceValue.fromJSON(object.units) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: CPU): unknown { - const obj: any = {}; - message.units !== undefined && (obj.units = message.units ? ResourceValue.toJSON(message.units) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/endpoint.ts b/src/protobuf/akash/base/v1beta3/endpoint.ts deleted file mode 100644 index f18c7f3..0000000 --- a/src/protobuf/akash/base/v1beta3/endpoint.ts +++ /dev/null @@ -1,147 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.kind = reader.int32() as any; - break; - case 2: - message.sequenceNumber = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Endpoint { - return { - $type: Endpoint.$type, - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, - sequenceNumber: isSet(object.sequenceNumber) ? Number(object.sequenceNumber) : 0 - }; - }, - - toJSON(message: Endpoint): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = endpoint_KindToJSON(message.kind)); - message.sequenceNumber !== undefined && (obj.sequenceNumber = Math.round(message.sequenceNumber)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/gpu.ts b/src/protobuf/akash/base/v1beta3/gpu.ts deleted file mode 100644 index 8831bb9..0000000 --- a/src/protobuf/akash/base/v1beta3/gpu.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceValue } from "./resourcevalue"; -import { Attribute } from "./attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.units = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GPU { - return { - $type: GPU.$type, - units: isSet(object.units) ? ResourceValue.fromJSON(object.units) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: GPU): unknown { - const obj: any = {}; - message.units !== undefined && (obj.units = message.units ? ResourceValue.toJSON(message.units) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/memory.ts b/src/protobuf/akash/base/v1beta3/memory.ts deleted file mode 100644 index 9cd321d..0000000 --- a/src/protobuf/akash/base/v1beta3/memory.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceValue } from "./resourcevalue"; -import { Attribute } from "./attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.quantity = ResourceValue.decode(reader, reader.uint32()); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Memory { - return { - $type: Memory.$type, - quantity: isSet(object.quantity) ? ResourceValue.fromJSON(object.quantity) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Memory): unknown { - const obj: any = {}; - message.quantity !== undefined && (obj.quantity = message.quantity ? ResourceValue.toJSON(message.quantity) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/resources.ts b/src/protobuf/akash/base/v1beta3/resources.ts deleted file mode 100644 index d7facb3..0000000 --- a/src/protobuf/akash/base/v1beta3/resources.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { CPU } from "./cpu"; -import { Memory } from "./memory"; -import { Storage } from "./storage"; -import { GPU } from "./gpu"; -import { Endpoint } from "./endpoint"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.id = reader.uint32(); - break; - case 2: - message.cpu = CPU.decode(reader, reader.uint32()); - break; - case 3: - message.memory = Memory.decode(reader, reader.uint32()); - break; - case 4: - message.storage.push(Storage.decode(reader, reader.uint32())); - break; - case 5: - message.gpu = GPU.decode(reader, reader.uint32()); - break; - case 6: - message.endpoints.push(Endpoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Resources { - return { - $type: Resources.$type, - id: isSet(object.id) ? Number(object.id) : 0, - cpu: isSet(object.cpu) ? CPU.fromJSON(object.cpu) : undefined, - memory: isSet(object.memory) ? Memory.fromJSON(object.memory) : undefined, - storage: Array.isArray(object?.storage) ? object.storage.map((e: any) => Storage.fromJSON(e)) : [], - gpu: isSet(object.gpu) ? GPU.fromJSON(object.gpu) : undefined, - endpoints: Array.isArray(object?.endpoints) ? object.endpoints.map((e: any) => Endpoint.fromJSON(e)) : [] - }; - }, - - toJSON(message: Resources): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = Math.round(message.id)); - message.cpu !== undefined && (obj.cpu = message.cpu ? CPU.toJSON(message.cpu) : undefined); - message.memory !== undefined && (obj.memory = message.memory ? Memory.toJSON(message.memory) : undefined); - if (message.storage) { - obj.storage = message.storage.map(e => (e ? Storage.toJSON(e) : undefined)); - } else { - obj.storage = []; - } - message.gpu !== undefined && (obj.gpu = message.gpu ? GPU.toJSON(message.gpu) : undefined); - if (message.endpoints) { - obj.endpoints = message.endpoints.map(e => (e ? Endpoint.toJSON(e) : undefined)); - } else { - obj.endpoints = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/resourceunits.ts b/src/protobuf/akash/base/v1beta3/resourceunits.ts deleted file mode 100644 index 7d843b5..0000000 --- a/src/protobuf/akash/base/v1beta3/resourceunits.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { CPU } from "./cpu"; -import { Memory } from "./memory"; -import { Storage } from "./storage"; -import { GPU } from "./gpu"; -import { Endpoint } from "./endpoint"; -import * as _m0 from "protobufjs/minimal"; - -export const protobufPackage = "akash.base.v1beta3"; - -/** - * 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.v1beta3.ResourceUnits"; - cpu: CPU | undefined; - memory: Memory | undefined; - storage: Storage[]; - gpu: GPU | undefined; - endpoints: Endpoint[]; -} - -function createBaseResourceUnits(): ResourceUnits { - return { - $type: "akash.base.v1beta3.ResourceUnits", - cpu: undefined, - memory: undefined, - storage: [], - gpu: undefined, - endpoints: [] - }; -} - -export const ResourceUnits = { - $type: "akash.base.v1beta3.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(); - } - if (message.gpu !== undefined) { - GPU.encode(message.gpu, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.endpoints) { - Endpoint.encode(v!, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ResourceUnits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.cpu = CPU.decode(reader, reader.uint32()); - break; - case 2: - message.memory = Memory.decode(reader, reader.uint32()); - break; - case 3: - message.storage.push(Storage.decode(reader, reader.uint32())); - break; - case 4: - message.gpu = GPU.decode(reader, reader.uint32()); - break; - case 5: - message.endpoints.push(Endpoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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: Array.isArray(object?.storage) ? object.storage.map((e: any) => Storage.fromJSON(e)) : [], - gpu: isSet(object.gpu) ? GPU.fromJSON(object.gpu) : undefined, - endpoints: Array.isArray(object?.endpoints) ? object.endpoints.map((e: any) => Endpoint.fromJSON(e)) : [] - }; - }, - - toJSON(message: ResourceUnits): unknown { - const obj: any = {}; - message.cpu !== undefined && (obj.cpu = message.cpu ? CPU.toJSON(message.cpu) : undefined); - message.memory !== undefined && (obj.memory = message.memory ? Memory.toJSON(message.memory) : undefined); - if (message.storage) { - obj.storage = message.storage.map(e => (e ? Storage.toJSON(e) : undefined)); - } else { - obj.storage = []; - } - message.gpu !== undefined && (obj.gpu = message.gpu ? GPU.toJSON(message.gpu) : undefined); - if (message.endpoints) { - obj.endpoints = message.endpoints.map(e => (e ? Endpoint.toJSON(e) : undefined)); - } else { - obj.endpoints = []; - } - return obj; - }, - - 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.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(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/resourcevalue.ts b/src/protobuf/akash/base/v1beta3/resourcevalue.ts deleted file mode 100644 index 96084d7..0000000 --- a/src/protobuf/akash/base/v1beta3/resourcevalue.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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() }; -} - -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 : new _m0.Reader(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: - message.val = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResourceValue { - return { - $type: ResourceValue.$type, - val: isSet(object.val) ? bytesFromBase64(object.val) : new Uint8Array() - }; - }, - - toJSON(message: ResourceValue): unknown { - const obj: any = {}; - message.val !== undefined && (obj.val = base64FromBytes(message.val !== undefined ? message.val : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): ResourceValue { - const message = createBaseResourceValue(); - message.val = object.val ?? new Uint8Array(); - return message; - } -}; - -messageTypeRegistry.set(ResourceValue.$type, ResourceValue); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/base/v1beta3/storage.ts b/src/protobuf/akash/base/v1beta3/storage.ts deleted file mode 100644 index 3c5273f..0000000 --- a/src/protobuf/akash/base/v1beta3/storage.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceValue } from "./resourcevalue"; -import { Attribute } from "./attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.quantity = ResourceValue.decode(reader, reader.uint32()); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Storage { - return { - $type: Storage.$type, - name: isSet(object.name) ? String(object.name) : "", - quantity: isSet(object.quantity) ? ResourceValue.fromJSON(object.quantity) : undefined, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [] - }; - }, - - toJSON(message: Storage): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.quantity !== undefined && (obj.quantity = message.quantity ? ResourceValue.toJSON(message.quantity) : undefined); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta1/cert.ts b/src/protobuf/akash/cert/v1beta1/cert.ts deleted file mode 100644 index cb0a9bd..0000000 --- a/src/protobuf/akash/cert/v1beta1/cert.ts +++ /dev/null @@ -1,623 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "akash.cert.v1beta1"; - -/** CertificateID stores owner and sequence number */ -export interface CertificateID { - $type: "akash.cert.v1beta1.CertificateID"; - owner: string; - serial: string; -} - -/** Certificate stores state, certificate and it's public key */ -export interface Certificate { - $type: "akash.cert.v1beta1.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"; - default: - return "UNKNOWN"; - } -} - -/** CertificateFilter defines filters used to filter certificates */ -export interface CertificateFilter { - $type: "akash.cert.v1beta1.CertificateFilter"; - owner: string; - serial: string; - state: string; -} - -/** MsgCreateCertificate defines an SDK message for creating certificate */ -export interface MsgCreateCertificate { - $type: "akash.cert.v1beta1.MsgCreateCertificate"; - owner: string; - cert: Uint8Array; - pubkey: Uint8Array; -} - -/** MsgCreateCertificateResponse defines the Msg/CreateCertificate response type. */ -export interface MsgCreateCertificateResponse { - $type: "akash.cert.v1beta1.MsgCreateCertificateResponse"; -} - -/** MsgRevokeCertificate defines an SDK message for revoking certificate */ -export interface MsgRevokeCertificate { - $type: "akash.cert.v1beta1.MsgRevokeCertificate"; - id?: CertificateID; -} - -/** MsgRevokeCertificateResponse defines the Msg/RevokeCertificate response type. */ -export interface MsgRevokeCertificateResponse { - $type: "akash.cert.v1beta1.MsgRevokeCertificateResponse"; -} - -function createBaseCertificateID(): CertificateID { - return { $type: "akash.cert.v1beta1.CertificateID", owner: "", serial: "" }; -} - -export const CertificateID = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.serial = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateID { - return { - $type: CertificateID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - serial: isSet(object.serial) ? String(object.serial) : "" - }; - }, - - toJSON(message: CertificateID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.serial !== undefined && (obj.serial = message.serial); - return obj; - }, - - 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.v1beta1.Certificate", - state: 0, - cert: new Uint8Array(), - pubkey: new Uint8Array() - }; -} - -export const Certificate = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.state = reader.int32() as any; - break; - case 3: - message.cert = reader.bytes(); - break; - case 4: - message.pubkey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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(), - pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() - }; - }, - - toJSON(message: Certificate): unknown { - const obj: any = {}; - message.state !== undefined && (obj.state = certificate_StateToJSON(message.state)); - message.cert !== undefined && (obj.cert = base64FromBytes(message.cert !== undefined ? message.cert : new Uint8Array())); - message.pubkey !== undefined && (obj.pubkey = base64FromBytes(message.pubkey !== undefined ? message.pubkey : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): Certificate { - const message = createBaseCertificate(); - message.state = object.state ?? 0; - message.cert = object.cert ?? new Uint8Array(); - message.pubkey = object.pubkey ?? new Uint8Array(); - return message; - } -}; - -messageTypeRegistry.set(Certificate.$type, Certificate); - -function createBaseCertificateFilter(): CertificateFilter { - return { - $type: "akash.cert.v1beta1.CertificateFilter", - owner: "", - serial: "", - state: "" - }; -} - -export const CertificateFilter = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.serial = reader.string(); - break; - case 3: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateFilter { - return { - $type: CertificateFilter.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - serial: isSet(object.serial) ? String(object.serial) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: CertificateFilter): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.serial !== undefined && (obj.serial = message.serial); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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.v1beta1.MsgCreateCertificate", - owner: "", - cert: new Uint8Array(), - pubkey: new Uint8Array() - }; -} - -export const MsgCreateCertificate = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.cert = reader.bytes(); - break; - case 3: - message.pubkey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateCertificate { - return { - $type: MsgCreateCertificate.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), - pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() - }; - }, - - toJSON(message: MsgCreateCertificate): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.cert !== undefined && (obj.cert = base64FromBytes(message.cert !== undefined ? message.cert : new Uint8Array())); - message.pubkey !== undefined && (obj.pubkey = base64FromBytes(message.pubkey !== undefined ? message.pubkey : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): MsgCreateCertificate { - const message = createBaseMsgCreateCertificate(); - message.owner = object.owner ?? ""; - message.cert = object.cert ?? new Uint8Array(); - message.pubkey = object.pubkey ?? new Uint8Array(); - return message; - } -}; - -messageTypeRegistry.set(MsgCreateCertificate.$type, MsgCreateCertificate); - -function createBaseMsgCreateCertificateResponse(): MsgCreateCertificateResponse { - return { $type: "akash.cert.v1beta1.MsgCreateCertificateResponse" }; -} - -export const MsgCreateCertificateResponse = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateCertificateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateCertificateResponse { - return { - $type: MsgCreateCertificateResponse.$type - }; - }, - - toJSON(_: MsgCreateCertificateResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgCreateCertificateResponse { - const message = createBaseMsgCreateCertificateResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgCreateCertificateResponse.$type, MsgCreateCertificateResponse); - -function createBaseMsgRevokeCertificate(): MsgRevokeCertificate { - return { $type: "akash.cert.v1beta1.MsgRevokeCertificate", id: undefined }; -} - -export const MsgRevokeCertificate = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.id = CertificateID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? CertificateID.toJSON(message.id) : undefined); - return obj; - }, - - 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.v1beta1.MsgRevokeCertificateResponse" }; -} - -export const MsgRevokeCertificateResponse = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevokeCertificateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgRevokeCertificateResponse { - return { - $type: MsgRevokeCertificateResponse.$type - }; - }, - - toJSON(_: MsgRevokeCertificateResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.cert.v1beta1.Msg", "CreateCertificate", data); - return promise.then(data => MsgCreateCertificateResponse.decode(new _m0.Reader(data))); - } - - RevokeCertificate(request: MsgRevokeCertificate): Promise { - const data = MsgRevokeCertificate.encode(request).finish(); - const promise = this.rpc.request("akash.cert.v1beta1.Msg", "RevokeCertificate", data); - return promise.then(data => MsgRevokeCertificateResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (const byte of arr) { - bin.push(String.fromCharCode(byte)); - } - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta1/genesis.ts b/src/protobuf/akash/cert/v1beta1/genesis.ts deleted file mode 100644 index 96322cf..0000000 --- a/src/protobuf/akash/cert/v1beta1/genesis.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Certificate } from "../../../akash/cert/v1beta1/cert"; - -export const protobufPackage = "akash.cert.v1beta1"; - -/** GenesisCertificate defines certificate entry at genesis */ -export interface GenesisCertificate { - $type: "akash.cert.v1beta1.GenesisCertificate"; - owner: string; - certificate?: Certificate; -} - -/** GenesisState defines the basic genesis state used by cert module */ -export interface GenesisState { - $type: "akash.cert.v1beta1.GenesisState"; - certificates: GenesisCertificate[]; -} - -function createBaseGenesisCertificate(): GenesisCertificate { - return { - $type: "akash.cert.v1beta1.GenesisCertificate", - owner: "", - certificate: undefined - }; -} - -export const GenesisCertificate = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.certificate = Certificate.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisCertificate { - return { - $type: GenesisCertificate.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - certificate: isSet(object.certificate) ? Certificate.fromJSON(object.certificate) : undefined - }; - }, - - toJSON(message: GenesisCertificate): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.certificate !== undefined && (obj.certificate = message.certificate ? Certificate.toJSON(message.certificate) : undefined); - return obj; - }, - - 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.v1beta1.GenesisState", certificates: [] }; -} - -export const GenesisState = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.certificates.push(GenesisCertificate.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - certificates: Array.isArray(object?.certificates) ? object.certificates.map((e: any) => GenesisCertificate.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.certificates) { - obj.certificates = message.certificates.map(e => (e ? GenesisCertificate.toJSON(e) : undefined)); - } else { - obj.certificates = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta1/query.ts b/src/protobuf/akash/cert/v1beta1/query.ts deleted file mode 100644 index 26a4fe3..0000000 --- a/src/protobuf/akash/cert/v1beta1/query.ts +++ /dev/null @@ -1,284 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Certificate, CertificateFilter } from "../../../akash/cert/v1beta1/cert"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; - -export const protobufPackage = "akash.cert.v1beta1"; - -export interface CertificateResponse { - $type: "akash.cert.v1beta1.CertificateResponse"; - certificate?: Certificate; - serial: string; -} - -/** QueryDeploymentsRequest is request type for the Query/Deployments RPC method */ -export interface QueryCertificatesRequest { - $type: "akash.cert.v1beta1.QueryCertificatesRequest"; - filter?: CertificateFilter; - pagination?: PageRequest; -} - -/** QueryCertificatesResponse is response type for the Query/Certificates RPC method */ -export interface QueryCertificatesResponse { - $type: "akash.cert.v1beta1.QueryCertificatesResponse"; - certificates: CertificateResponse[]; - pagination?: PageResponse; -} - -function createBaseCertificateResponse(): CertificateResponse { - return { - $type: "akash.cert.v1beta1.CertificateResponse", - certificate: undefined, - serial: "" - }; -} - -export const CertificateResponse = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.certificate = Certificate.decode(reader, reader.uint32()); - break; - case 2: - message.serial = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateResponse { - return { - $type: CertificateResponse.$type, - certificate: isSet(object.certificate) ? Certificate.fromJSON(object.certificate) : undefined, - serial: isSet(object.serial) ? String(object.serial) : "" - }; - }, - - toJSON(message: CertificateResponse): unknown { - const obj: any = {}; - message.certificate !== undefined && (obj.certificate = message.certificate ? Certificate.toJSON(message.certificate) : undefined); - message.serial !== undefined && (obj.serial = message.serial); - return obj; - }, - - 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.v1beta1.QueryCertificatesRequest", - filter: undefined, - pagination: undefined - }; -} - -export const QueryCertificatesRequest = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.filter = CertificateFilter.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filter !== undefined && (obj.filter = message.filter ? CertificateFilter.toJSON(message.filter) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryCertificatesResponse", - certificates: [], - pagination: undefined - }; -} - -export const QueryCertificatesResponse = { - $type: "akash.cert.v1beta1.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 : new _m0.Reader(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: - message.certificates.push(CertificateResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCertificatesResponse { - return { - $type: QueryCertificatesResponse.$type, - certificates: 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) { - obj.certificates = message.certificates.map(e => (e ? CertificateResponse.toJSON(e) : undefined)); - } else { - obj.certificates = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.Certificates = this.Certificates.bind(this); - } - Certificates(request: QueryCertificatesRequest): Promise { - const data = QueryCertificatesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.cert.v1beta1.Query", "Certificates", data); - return promise.then(data => QueryCertificatesResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta2/cert.ts b/src/protobuf/akash/cert/v1beta2/cert.ts deleted file mode 100644 index 6b606e8..0000000 --- a/src/protobuf/akash/cert/v1beta2/cert.ts +++ /dev/null @@ -1,624 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.serial = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateID { - return { - $type: CertificateID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - serial: isSet(object.serial) ? String(object.serial) : "" - }; - }, - - toJSON(message: CertificateID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.serial !== undefined && (obj.serial = message.serial); - return obj; - }, - - 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(), - pubkey: new Uint8Array() - }; -} - -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 : new _m0.Reader(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: - message.state = reader.int32() as any; - break; - case 3: - message.cert = reader.bytes(); - break; - case 4: - message.pubkey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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(), - pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() - }; - }, - - toJSON(message: Certificate): unknown { - const obj: any = {}; - message.state !== undefined && (obj.state = certificate_StateToJSON(message.state)); - message.cert !== undefined && (obj.cert = base64FromBytes(message.cert !== undefined ? message.cert : new Uint8Array())); - message.pubkey !== undefined && (obj.pubkey = base64FromBytes(message.pubkey !== undefined ? message.pubkey : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): Certificate { - const message = createBaseCertificate(); - message.state = object.state ?? 0; - message.cert = object.cert ?? new Uint8Array(); - message.pubkey = object.pubkey ?? new Uint8Array(); - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.serial = reader.string(); - break; - case 3: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateFilter { - return { - $type: CertificateFilter.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - serial: isSet(object.serial) ? String(object.serial) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: CertificateFilter): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.serial !== undefined && (obj.serial = message.serial); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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(), - pubkey: new Uint8Array() - }; -} - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.cert = reader.bytes(); - break; - case 3: - message.pubkey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateCertificate { - return { - $type: MsgCreateCertificate.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), - pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() - }; - }, - - toJSON(message: MsgCreateCertificate): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.cert !== undefined && (obj.cert = base64FromBytes(message.cert !== undefined ? message.cert : new Uint8Array())); - message.pubkey !== undefined && (obj.pubkey = base64FromBytes(message.pubkey !== undefined ? message.pubkey : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): MsgCreateCertificate { - const message = createBaseMsgCreateCertificate(); - message.owner = object.owner ?? ""; - message.cert = object.cert ?? new Uint8Array(); - message.pubkey = object.pubkey ?? new Uint8Array(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateCertificateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateCertificateResponse { - return { - $type: MsgCreateCertificateResponse.$type - }; - }, - - toJSON(_: MsgCreateCertificateResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = CertificateID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? CertificateID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevokeCertificateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgRevokeCertificateResponse { - return { - $type: MsgRevokeCertificateResponse.$type - }; - }, - - toJSON(_: MsgRevokeCertificateResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.cert.v1beta2.Msg", "CreateCertificate", data); - return promise.then(data => MsgCreateCertificateResponse.decode(new _m0.Reader(data))); - } - - RevokeCertificate(request: MsgRevokeCertificate): Promise { - const data = MsgRevokeCertificate.encode(request).finish(); - const promise = this.rpc.request("akash.cert.v1beta2.Msg", "RevokeCertificate", data); - return promise.then(data => MsgRevokeCertificateResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta2/genesis.ts b/src/protobuf/akash/cert/v1beta2/genesis.ts deleted file mode 100644 index 4f8c444..0000000 --- a/src/protobuf/akash/cert/v1beta2/genesis.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Certificate } from "./cert"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.certificate = Certificate.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisCertificate { - return { - $type: GenesisCertificate.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - certificate: isSet(object.certificate) ? Certificate.fromJSON(object.certificate) : undefined - }; - }, - - toJSON(message: GenesisCertificate): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.certificate !== undefined && (obj.certificate = message.certificate ? Certificate.toJSON(message.certificate) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.certificates.push(GenesisCertificate.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - certificates: Array.isArray(object?.certificates) ? object.certificates.map((e: any) => GenesisCertificate.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.certificates) { - obj.certificates = message.certificates.map(e => (e ? GenesisCertificate.toJSON(e) : undefined)); - } else { - obj.certificates = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta2/query.ts b/src/protobuf/akash/cert/v1beta2/query.ts deleted file mode 100644 index 6f69946..0000000 --- a/src/protobuf/akash/cert/v1beta2/query.ts +++ /dev/null @@ -1,285 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Certificate, CertificateFilter } from "./cert"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.certificate = Certificate.decode(reader, reader.uint32()); - break; - case 2: - message.serial = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateResponse { - return { - $type: CertificateResponse.$type, - certificate: isSet(object.certificate) ? Certificate.fromJSON(object.certificate) : undefined, - serial: isSet(object.serial) ? String(object.serial) : "" - }; - }, - - toJSON(message: CertificateResponse): unknown { - const obj: any = {}; - message.certificate !== undefined && (obj.certificate = message.certificate ? Certificate.toJSON(message.certificate) : undefined); - message.serial !== undefined && (obj.serial = message.serial); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filter = CertificateFilter.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filter !== undefined && (obj.filter = message.filter ? CertificateFilter.toJSON(message.filter) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.certificates.push(CertificateResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCertificatesResponse { - return { - $type: QueryCertificatesResponse.$type, - certificates: 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) { - obj.certificates = message.certificates.map(e => (e ? CertificateResponse.toJSON(e) : undefined)); - } else { - obj.certificates = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.Certificates = this.Certificates.bind(this); - } - Certificates(request: QueryCertificatesRequest): Promise { - const data = QueryCertificatesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.cert.v1beta2.Query", "Certificates", data); - return promise.then(data => QueryCertificatesResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta3/cert.ts b/src/protobuf/akash/cert/v1beta3/cert.ts deleted file mode 100644 index 2c46ebb..0000000 --- a/src/protobuf/akash/cert/v1beta3/cert.ts +++ /dev/null @@ -1,624 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.serial = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateID { - return { - $type: CertificateID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - serial: isSet(object.serial) ? String(object.serial) : "" - }; - }, - - toJSON(message: CertificateID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.serial !== undefined && (obj.serial = message.serial); - return obj; - }, - - 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(), - pubkey: new Uint8Array() - }; -} - -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 : new _m0.Reader(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: - message.state = reader.int32() as any; - break; - case 3: - message.cert = reader.bytes(); - break; - case 4: - message.pubkey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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(), - pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() - }; - }, - - toJSON(message: Certificate): unknown { - const obj: any = {}; - message.state !== undefined && (obj.state = certificate_StateToJSON(message.state)); - message.cert !== undefined && (obj.cert = base64FromBytes(message.cert !== undefined ? message.cert : new Uint8Array())); - message.pubkey !== undefined && (obj.pubkey = base64FromBytes(message.pubkey !== undefined ? message.pubkey : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): Certificate { - const message = createBaseCertificate(); - message.state = object.state ?? 0; - message.cert = object.cert ?? new Uint8Array(); - message.pubkey = object.pubkey ?? new Uint8Array(); - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.serial = reader.string(); - break; - case 3: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateFilter { - return { - $type: CertificateFilter.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - serial: isSet(object.serial) ? String(object.serial) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: CertificateFilter): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.serial !== undefined && (obj.serial = message.serial); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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(), - pubkey: new Uint8Array() - }; -} - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.cert = reader.bytes(); - break; - case 3: - message.pubkey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateCertificate { - return { - $type: MsgCreateCertificate.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), - pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() - }; - }, - - toJSON(message: MsgCreateCertificate): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.cert !== undefined && (obj.cert = base64FromBytes(message.cert !== undefined ? message.cert : new Uint8Array())); - message.pubkey !== undefined && (obj.pubkey = base64FromBytes(message.pubkey !== undefined ? message.pubkey : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): MsgCreateCertificate { - const message = createBaseMsgCreateCertificate(); - message.owner = object.owner ?? ""; - message.cert = object.cert ?? new Uint8Array(); - message.pubkey = object.pubkey ?? new Uint8Array(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateCertificateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateCertificateResponse { - return { - $type: MsgCreateCertificateResponse.$type - }; - }, - - toJSON(_: MsgCreateCertificateResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = CertificateID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? CertificateID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevokeCertificateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgRevokeCertificateResponse { - return { - $type: MsgRevokeCertificateResponse.$type - }; - }, - - toJSON(_: MsgRevokeCertificateResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.cert.v1beta3.Msg", "CreateCertificate", data); - return promise.then(data => MsgCreateCertificateResponse.decode(new _m0.Reader(data))); - } - - RevokeCertificate(request: MsgRevokeCertificate): Promise { - const data = MsgRevokeCertificate.encode(request).finish(); - const promise = this.rpc.request("akash.cert.v1beta3.Msg", "RevokeCertificate", data); - return promise.then(data => MsgRevokeCertificateResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta3/genesis.ts b/src/protobuf/akash/cert/v1beta3/genesis.ts deleted file mode 100644 index 9c8ae7c..0000000 --- a/src/protobuf/akash/cert/v1beta3/genesis.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Certificate } from "./cert"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.certificate = Certificate.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisCertificate { - return { - $type: GenesisCertificate.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - certificate: isSet(object.certificate) ? Certificate.fromJSON(object.certificate) : undefined - }; - }, - - toJSON(message: GenesisCertificate): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.certificate !== undefined && (obj.certificate = message.certificate ? Certificate.toJSON(message.certificate) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.certificates.push(GenesisCertificate.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - certificates: Array.isArray(object?.certificates) ? object.certificates.map((e: any) => GenesisCertificate.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.certificates) { - obj.certificates = message.certificates.map(e => (e ? GenesisCertificate.toJSON(e) : undefined)); - } else { - obj.certificates = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/cert/v1beta3/query.ts b/src/protobuf/akash/cert/v1beta3/query.ts deleted file mode 100644 index 388932b..0000000 --- a/src/protobuf/akash/cert/v1beta3/query.ts +++ /dev/null @@ -1,285 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Certificate, CertificateFilter } from "./cert"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.certificate = Certificate.decode(reader, reader.uint32()); - break; - case 2: - message.serial = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CertificateResponse { - return { - $type: CertificateResponse.$type, - certificate: isSet(object.certificate) ? Certificate.fromJSON(object.certificate) : undefined, - serial: isSet(object.serial) ? String(object.serial) : "" - }; - }, - - toJSON(message: CertificateResponse): unknown { - const obj: any = {}; - message.certificate !== undefined && (obj.certificate = message.certificate ? Certificate.toJSON(message.certificate) : undefined); - message.serial !== undefined && (obj.serial = message.serial); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filter = CertificateFilter.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filter !== undefined && (obj.filter = message.filter ? CertificateFilter.toJSON(message.filter) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.certificates.push(CertificateResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCertificatesResponse { - return { - $type: QueryCertificatesResponse.$type, - certificates: 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) { - obj.certificates = message.certificates.map(e => (e ? CertificateResponse.toJSON(e) : undefined)); - } else { - obj.certificates = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.Certificates = this.Certificates.bind(this); - } - Certificates(request: QueryCertificatesRequest): Promise { - const data = QueryCertificatesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.cert.v1beta3.Query", "Certificates", data); - return promise.then(data => QueryCertificatesResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta1/authz.ts b/src/protobuf/akash/deployment/v1beta1/authz.ts deleted file mode 100644 index cac7dc0..0000000 --- a/src/protobuf/akash/deployment/v1beta1/authz.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.spendLimit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.spendLimit !== undefined && (obj.spendLimit = message.spendLimit ? Coin.toJSON(message.spendLimit) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta1/deployment.ts b/src/protobuf/akash/deployment/v1beta1/deployment.ts deleted file mode 100644 index fc2ed64..0000000 --- a/src/protobuf/akash/deployment/v1beta1/deployment.ts +++ /dev/null @@ -1,967 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupSpec, MsgCloseGroupResponse, MsgPauseGroupResponse, MsgStartGroupResponse, MsgCloseGroup, MsgPauseGroup, MsgStartGroup } from "./group"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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(), - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(GroupSpec.decode(reader, reader.uint32())); - break; - case 3: - message.version = reader.bytes(); - break; - case 4: - message.deposit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateDeployment { - return { - $type: MsgCreateDeployment.$type, - id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) : [], - version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), - deposit: isSet(object.deposit) ? Coin.fromJSON(object.deposit) : undefined - }; - }, - - toJSON(message: MsgCreateDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? GroupSpec.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - message.deposit !== undefined && (obj.deposit = message.deposit ? Coin.toJSON(message.deposit) : undefined); - return obj; - }, - - 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(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateDeploymentResponse { - return { - $type: MsgCreateDeploymentResponse.$type - }; - }, - - toJSON(_: MsgCreateDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.amount = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDepositDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDepositDeploymentResponse { - return { - $type: MsgDepositDeploymentResponse.$type - }; - }, - - toJSON(_: MsgDepositDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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() - }; -} - -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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(GroupSpec.decode(reader, reader.uint32())); - break; - case 3: - message.version = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUpdateDeployment { - return { - $type: MsgUpdateDeployment.$type, - id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) : [], - version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array() - }; - }, - - toJSON(message: MsgUpdateDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? GroupSpec.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - return obj; - }, - - 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(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateDeploymentResponse { - return { - $type: MsgUpdateDeploymentResponse.$type - }; - }, - - toJSON(_: MsgUpdateDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseDeploymentResponse { - return { - $type: MsgCloseDeploymentResponse.$type - }; - }, - - toJSON(_: MsgCloseDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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.isZero()) { - writer.uint32(16).uint64(message.dseq); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DeploymentID { - return { - $type: DeploymentID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO - }; - }, - - toJSON(message: DeploymentID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - return obj; - }, - - 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(), - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Deployment { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.deploymentId = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.version = reader.bytes(); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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(), - createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO - }; - }, - - toJSON(message: Deployment): unknown { - const obj: any = {}; - message.deploymentId !== undefined && (obj.deploymentId = message.deploymentId ? DeploymentID.toJSON(message.deploymentId) : undefined); - message.state !== undefined && (obj.state = deployment_StateToJSON(message.state)); - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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(); - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DeploymentFilters { - return { - $type: DeploymentFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: DeploymentFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.deployment.v1beta1.Msg", "CreateDeployment", data); - return promise.then(data => MsgCreateDeploymentResponse.decode(new _m0.Reader(data))); - } - - DepositDeployment(request: MsgDepositDeployment): Promise { - const data = MsgDepositDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Msg", "DepositDeployment", data); - return promise.then(data => MsgDepositDeploymentResponse.decode(new _m0.Reader(data))); - } - - UpdateDeployment(request: MsgUpdateDeployment): Promise { - const data = MsgUpdateDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Msg", "UpdateDeployment", data); - return promise.then(data => MsgUpdateDeploymentResponse.decode(new _m0.Reader(data))); - } - - CloseDeployment(request: MsgCloseDeployment): Promise { - const data = MsgCloseDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Msg", "CloseDeployment", data); - return promise.then(data => MsgCloseDeploymentResponse.decode(new _m0.Reader(data))); - } - - CloseGroup(request: MsgCloseGroup): Promise { - const data = MsgCloseGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Msg", "CloseGroup", data); - return promise.then(data => MsgCloseGroupResponse.decode(new _m0.Reader(data))); - } - - PauseGroup(request: MsgPauseGroup): Promise { - const data = MsgPauseGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Msg", "PauseGroup", data); - return promise.then(data => MsgPauseGroupResponse.decode(new _m0.Reader(data))); - } - - StartGroup(request: MsgStartGroup): Promise { - const data = MsgStartGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Msg", "StartGroup", data); - return promise.then(data => MsgStartGroupResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta1/genesis.ts b/src/protobuf/akash/deployment/v1beta1/genesis.ts deleted file mode 100644 index 2c5c8e7..0000000 --- a/src/protobuf/akash/deployment/v1beta1/genesis.ts +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Deployment } from "./deployment"; -import { Group } from "./group"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.deployment = Deployment.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(Group.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisDeployment { - return { - $type: GenesisDeployment.$type, - deployment: isSet(object.deployment) ? Deployment.fromJSON(object.deployment) : undefined, - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => Group.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisDeployment): unknown { - const obj: any = {}; - message.deployment !== undefined && (obj.deployment = message.deployment ? Deployment.toJSON(message.deployment) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? Group.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployments.push(GenesisDeployment.decode(reader, reader.uint32())); - break; - case 2: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - deployments: 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) { - obj.deployments = message.deployments.map(e => (e ? GenesisDeployment.toJSON(e) : undefined)); - } else { - obj.deployments = []; - } - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta1/group.ts b/src/protobuf/akash/deployment/v1beta1/group.ts deleted file mode 100644 index 5a7befe..0000000 --- a/src/protobuf/akash/deployment/v1beta1/group.ts +++ /dev/null @@ -1,780 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PlacementRequirements } from "../../base/v1beta1/attribute"; -import { ResourceUnits } from "../../base/v1beta1/resource"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseGroupResponse { - return { - $type: MsgCloseGroupResponse.$type - }; - }, - - toJSON(_: MsgCloseGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgPauseGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgPauseGroupResponse { - return { - $type: MsgPauseGroupResponse.$type - }; - }, - - toJSON(_: MsgPauseGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStartGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgStartGroupResponse { - return { - $type: MsgStartGroupResponse.$type - }; - }, - - toJSON(_: MsgStartGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GroupID { - return { - $type: GroupID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0 - }; - }, - - toJSON(message: GroupID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - return obj; - }, - - 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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.requirements = PlacementRequirements.decode(reader, reader.uint32()); - break; - case 3: - message.resources.push(Resource.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GroupSpec { - return { - $type: GroupSpec.$type, - name: isSet(object.name) ? String(object.name) : "", - requirements: isSet(object.requirements) ? PlacementRequirements.fromJSON(object.requirements) : undefined, - resources: Array.isArray(object?.resources) ? object.resources.map((e: any) => Resource.fromJSON(e)) : [] - }; - }, - - toJSON(message: GroupSpec): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.requirements !== undefined && (obj.requirements = message.requirements ? PlacementRequirements.toJSON(message.requirements) : undefined); - if (message.resources) { - obj.resources = message.resources.map(e => (e ? Resource.toJSON(e) : undefined)); - } else { - obj.resources = []; - } - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Group { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.groupId = GroupID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.groupSpec = GroupSpec.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.groupId !== undefined && (obj.groupId = message.groupId ? GroupID.toJSON(message.groupId) : undefined); - message.state !== undefined && (obj.state = group_StateToJSON(message.state)); - message.groupSpec !== undefined && (obj.groupSpec = message.groupSpec ? GroupSpec.toJSON(message.groupSpec) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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 : new _m0.Reader(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: - message.resources = ResourceUnits.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.price = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Resource { - return { - $type: Resource.$type, - resources: isSet(object.resources) ? ResourceUnits.fromJSON(object.resources) : undefined, - count: isSet(object.count) ? Number(object.count) : 0, - price: isSet(object.price) ? Coin.fromJSON(object.price) : undefined - }; - }, - - toJSON(message: Resource): unknown { - const obj: any = {}; - message.resources !== undefined && (obj.resources = message.resources ? ResourceUnits.toJSON(message.resources) : undefined); - message.count !== undefined && (obj.count = Math.round(message.count)); - message.price !== undefined && (obj.price = message.price ? Coin.toJSON(message.price) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta1/params.ts b/src/protobuf/akash/deployment/v1beta1/params.ts deleted file mode 100644 index ca31b9d..0000000 --- a/src/protobuf/akash/deployment/v1beta1/params.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.deploymentMinDeposit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.deploymentMinDeposit !== undefined && - (obj.deploymentMinDeposit = message.deploymentMinDeposit ? Coin.toJSON(message.deploymentMinDeposit) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta1/query.ts b/src/protobuf/akash/deployment/v1beta1/query.ts deleted file mode 100644 index 95b01ff..0000000 --- a/src/protobuf/akash/deployment/v1beta1/query.ts +++ /dev/null @@ -1,506 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DeploymentFilters, DeploymentID, Deployment } from "./deployment"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Group, GroupID } from "./group"; -import { Account } from "../../escrow/v1beta1/types"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.filters = DeploymentFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? DeploymentFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployments.push(QueryDeploymentResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDeploymentsResponse { - return { - $type: QueryDeploymentsResponse.$type, - deployments: 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) { - obj.deployments = message.deployments.map(e => (e ? QueryDeploymentResponse.toJSON(e) : undefined)); - } else { - obj.deployments = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployment = Deployment.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(Group.decode(reader, reader.uint32())); - break; - case 3: - message.escrowAccount = Account.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDeploymentResponse { - return { - $type: QueryDeploymentResponse.$type, - deployment: isSet(object.deployment) ? Deployment.fromJSON(object.deployment) : undefined, - groups: 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 = {}; - message.deployment !== undefined && (obj.deployment = message.deployment ? Deployment.toJSON(message.deployment) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? Group.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - message.escrowAccount !== undefined && (obj.escrowAccount = message.escrowAccount ? Account.toJSON(message.escrowAccount) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.group = Group.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.group !== undefined && (obj.group = message.group ? Group.toJSON(message.group) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.deployment.v1beta1.Query", "Deployments", data); - return promise.then(data => QueryDeploymentsResponse.decode(new _m0.Reader(data))); - } - - Deployment(request: QueryDeploymentRequest): Promise { - const data = QueryDeploymentRequest.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Query", "Deployment", data); - return promise.then(data => QueryDeploymentResponse.decode(new _m0.Reader(data))); - } - - Group(request: QueryGroupRequest): Promise { - const data = QueryGroupRequest.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta1.Query", "Group", data); - return promise.then(data => QueryGroupResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/authz.ts b/src/protobuf/akash/deployment/v1beta2/authz.ts deleted file mode 100644 index 93f46a9..0000000 --- a/src/protobuf/akash/deployment/v1beta2/authz.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.spendLimit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.spendLimit !== undefined && (obj.spendLimit = message.spendLimit ? Coin.toJSON(message.spendLimit) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/deployment.ts b/src/protobuf/akash/deployment/v1beta2/deployment.ts deleted file mode 100644 index e970e74..0000000 --- a/src/protobuf/akash/deployment/v1beta2/deployment.ts +++ /dev/null @@ -1,362 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - writer.uint32(16).uint64(message.dseq); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DeploymentID { - return { - $type: DeploymentID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO - }; - }, - - toJSON(message: DeploymentID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - return obj; - }, - - 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(), - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Deployment { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.deploymentId = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.version = reader.bytes(); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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(), - createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO - }; - }, - - toJSON(message: Deployment): unknown { - const obj: any = {}; - message.deploymentId !== undefined && (obj.deploymentId = message.deploymentId ? DeploymentID.toJSON(message.deploymentId) : undefined); - message.state !== undefined && (obj.state = deployment_StateToJSON(message.state)); - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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(); - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DeploymentFilters { - return { - $type: DeploymentFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: DeploymentFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/deploymentmsg.ts b/src/protobuf/akash/deployment/v1beta2/deploymentmsg.ts deleted file mode 100644 index d3a3758..0000000 --- a/src/protobuf/akash/deployment/v1beta2/deploymentmsg.ts +++ /dev/null @@ -1,602 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DeploymentID } from "./deployment"; -import { GroupSpec } from "./groupspec"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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(), - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(GroupSpec.decode(reader, reader.uint32())); - break; - case 3: - message.version = reader.bytes(); - break; - case 4: - message.deposit = Coin.decode(reader, reader.uint32()); - break; - case 5: - message.depositor = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateDeployment { - return { - $type: MsgCreateDeployment.$type, - id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) : [], - version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), - deposit: isSet(object.deposit) ? Coin.fromJSON(object.deposit) : undefined, - depositor: isSet(object.depositor) ? String(object.depositor) : "" - }; - }, - - toJSON(message: MsgCreateDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? GroupSpec.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - message.deposit !== undefined && (obj.deposit = message.deposit ? Coin.toJSON(message.deposit) : undefined); - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; - }, - - 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(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateDeploymentResponse { - return { - $type: MsgCreateDeploymentResponse.$type - }; - }, - - toJSON(_: MsgCreateDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.amount = Coin.decode(reader, reader.uint32()); - break; - case 3: - message.depositor = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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) ? String(object.depositor) : "" - }; - }, - - toJSON(message: MsgDepositDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDepositDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDepositDeploymentResponse { - return { - $type: MsgDepositDeploymentResponse.$type - }; - }, - - toJSON(_: MsgDepositDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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() - }; -} - -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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 3: - message.version = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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() - }; - }, - - toJSON(message: MsgUpdateDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - return obj; - }, - - 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(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateDeploymentResponse { - return { - $type: MsgUpdateDeploymentResponse.$type - }; - }, - - toJSON(_: MsgUpdateDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseDeploymentResponse { - return { - $type: MsgCloseDeploymentResponse.$type - }; - }, - - toJSON(_: MsgCloseDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgCloseDeploymentResponse { - const message = createBaseMsgCloseDeploymentResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgCloseDeploymentResponse.$type, MsgCloseDeploymentResponse); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/genesis.ts b/src/protobuf/akash/deployment/v1beta2/genesis.ts deleted file mode 100644 index 0b264b3..0000000 --- a/src/protobuf/akash/deployment/v1beta2/genesis.ts +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Deployment } from "./deployment"; -import { Group } from "./group"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.deployment = Deployment.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(Group.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisDeployment { - return { - $type: GenesisDeployment.$type, - deployment: isSet(object.deployment) ? Deployment.fromJSON(object.deployment) : undefined, - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => Group.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisDeployment): unknown { - const obj: any = {}; - message.deployment !== undefined && (obj.deployment = message.deployment ? Deployment.toJSON(message.deployment) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? Group.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployments.push(GenesisDeployment.decode(reader, reader.uint32())); - break; - case 2: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - deployments: 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) { - obj.deployments = message.deployments.map(e => (e ? GenesisDeployment.toJSON(e) : undefined)); - } else { - obj.deployments = []; - } - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/group.ts b/src/protobuf/akash/deployment/v1beta2/group.ts deleted file mode 100644 index d08ff1a..0000000 --- a/src/protobuf/akash/deployment/v1beta2/group.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupID } from "./groupid"; -import { GroupSpec } from "./groupspec"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Group { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.groupId = GroupID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.groupSpec = GroupSpec.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.groupId !== undefined && (obj.groupId = message.groupId ? GroupID.toJSON(message.groupId) : undefined); - message.state !== undefined && (obj.state = group_StateToJSON(message.state)); - message.groupSpec !== undefined && (obj.groupSpec = message.groupSpec ? GroupSpec.toJSON(message.groupSpec) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/groupid.ts b/src/protobuf/akash/deployment/v1beta2/groupid.ts deleted file mode 100644 index c23fddd..0000000 --- a/src/protobuf/akash/deployment/v1beta2/groupid.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GroupID { - return { - $type: GroupID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0 - }; - }, - - toJSON(message: GroupID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/groupmsg.ts b/src/protobuf/akash/deployment/v1beta2/groupmsg.ts deleted file mode 100644 index fdd45cb..0000000 --- a/src/protobuf/akash/deployment/v1beta2/groupmsg.ts +++ /dev/null @@ -1,365 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupID } from "./groupid"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseGroupResponse { - return { - $type: MsgCloseGroupResponse.$type - }; - }, - - toJSON(_: MsgCloseGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgPauseGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgPauseGroupResponse { - return { - $type: MsgPauseGroupResponse.$type - }; - }, - - toJSON(_: MsgPauseGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStartGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgStartGroupResponse { - return { - $type: MsgStartGroupResponse.$type - }; - }, - - toJSON(_: MsgStartGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/groupspec.ts b/src/protobuf/akash/deployment/v1beta2/groupspec.ts deleted file mode 100644 index 10bb58e..0000000 --- a/src/protobuf/akash/deployment/v1beta2/groupspec.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PlacementRequirements } from "../../base/v1beta2/attribute"; -import { Resource } from "./resource"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.requirements = PlacementRequirements.decode(reader, reader.uint32()); - break; - case 3: - message.resources.push(Resource.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GroupSpec { - return { - $type: GroupSpec.$type, - name: isSet(object.name) ? String(object.name) : "", - requirements: isSet(object.requirements) ? PlacementRequirements.fromJSON(object.requirements) : undefined, - resources: Array.isArray(object?.resources) ? object.resources.map((e: any) => Resource.fromJSON(e)) : [] - }; - }, - - toJSON(message: GroupSpec): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.requirements !== undefined && (obj.requirements = message.requirements ? PlacementRequirements.toJSON(message.requirements) : undefined); - if (message.resources) { - obj.resources = message.resources.map(e => (e ? Resource.toJSON(e) : undefined)); - } else { - obj.resources = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/params.ts b/src/protobuf/akash/deployment/v1beta2/params.ts deleted file mode 100644 index 595d5fc..0000000 --- a/src/protobuf/akash/deployment/v1beta2/params.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.deploymentMinDeposit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.deploymentMinDeposit !== undefined && - (obj.deploymentMinDeposit = message.deploymentMinDeposit ? Coin.toJSON(message.deploymentMinDeposit) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/query.ts b/src/protobuf/akash/deployment/v1beta2/query.ts deleted file mode 100644 index f7ba05e..0000000 --- a/src/protobuf/akash/deployment/v1beta2/query.ts +++ /dev/null @@ -1,507 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DeploymentFilters, DeploymentID, Deployment } from "./deployment"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Group } from "./group"; -import { Account } from "../../escrow/v1beta2/types"; -import { GroupID } from "./groupid"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.filters = DeploymentFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? DeploymentFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployments.push(QueryDeploymentResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDeploymentsResponse { - return { - $type: QueryDeploymentsResponse.$type, - deployments: 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) { - obj.deployments = message.deployments.map(e => (e ? QueryDeploymentResponse.toJSON(e) : undefined)); - } else { - obj.deployments = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployment = Deployment.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(Group.decode(reader, reader.uint32())); - break; - case 3: - message.escrowAccount = Account.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDeploymentResponse { - return { - $type: QueryDeploymentResponse.$type, - deployment: isSet(object.deployment) ? Deployment.fromJSON(object.deployment) : undefined, - groups: 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 = {}; - message.deployment !== undefined && (obj.deployment = message.deployment ? Deployment.toJSON(message.deployment) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? Group.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - message.escrowAccount !== undefined && (obj.escrowAccount = message.escrowAccount ? Account.toJSON(message.escrowAccount) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.group = Group.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.group !== undefined && (obj.group = message.group ? Group.toJSON(message.group) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.deployment.v1beta2.Query", "Deployments", data); - return promise.then(data => QueryDeploymentsResponse.decode(new _m0.Reader(data))); - } - - Deployment(request: QueryDeploymentRequest): Promise { - const data = QueryDeploymentRequest.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Query", "Deployment", data); - return promise.then(data => QueryDeploymentResponse.decode(new _m0.Reader(data))); - } - - Group(request: QueryGroupRequest): Promise { - const data = QueryGroupRequest.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Query", "Group", data); - return promise.then(data => QueryGroupResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/resource.ts b/src/protobuf/akash/deployment/v1beta2/resource.ts deleted file mode 100644 index 3af803c..0000000 --- a/src/protobuf/akash/deployment/v1beta2/resource.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceUnits } from "../../base/v1beta2/resourceunits"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.resources = ResourceUnits.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Resource { - return { - $type: Resource.$type, - resources: isSet(object.resources) ? ResourceUnits.fromJSON(object.resources) : undefined, - count: isSet(object.count) ? Number(object.count) : 0, - price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined - }; - }, - - toJSON(message: Resource): unknown { - const obj: any = {}; - message.resources !== undefined && (obj.resources = message.resources ? ResourceUnits.toJSON(message.resources) : undefined); - message.count !== undefined && (obj.count = Math.round(message.count)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta2/service.ts b/src/protobuf/akash/deployment/v1beta2/service.ts deleted file mode 100644 index 4d42036..0000000 --- a/src/protobuf/akash/deployment/v1beta2/service.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint-disable */ -import { - MsgCreateDeploymentResponse, - MsgDepositDeploymentResponse, - MsgUpdateDeploymentResponse, - MsgCloseDeploymentResponse, - MsgCreateDeployment, - MsgDepositDeployment, - MsgUpdateDeployment, - MsgCloseDeployment -} from "./deploymentmsg"; -import { MsgCloseGroupResponse, MsgPauseGroupResponse, MsgStartGroupResponse, MsgCloseGroup, MsgPauseGroup, MsgStartGroup } from "./groupmsg"; -import * as _m0 from "protobufjs/minimal"; - -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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.deployment.v1beta2.Msg", "CreateDeployment", data); - return promise.then(data => MsgCreateDeploymentResponse.decode(new _m0.Reader(data))); - } - - DepositDeployment(request: MsgDepositDeployment): Promise { - const data = MsgDepositDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Msg", "DepositDeployment", data); - return promise.then(data => MsgDepositDeploymentResponse.decode(new _m0.Reader(data))); - } - - UpdateDeployment(request: MsgUpdateDeployment): Promise { - const data = MsgUpdateDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Msg", "UpdateDeployment", data); - return promise.then(data => MsgUpdateDeploymentResponse.decode(new _m0.Reader(data))); - } - - CloseDeployment(request: MsgCloseDeployment): Promise { - const data = MsgCloseDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Msg", "CloseDeployment", data); - return promise.then(data => MsgCloseDeploymentResponse.decode(new _m0.Reader(data))); - } - - CloseGroup(request: MsgCloseGroup): Promise { - const data = MsgCloseGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Msg", "CloseGroup", data); - return promise.then(data => MsgCloseGroupResponse.decode(new _m0.Reader(data))); - } - - PauseGroup(request: MsgPauseGroup): Promise { - const data = MsgPauseGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Msg", "PauseGroup", data); - return promise.then(data => MsgPauseGroupResponse.decode(new _m0.Reader(data))); - } - - StartGroup(request: MsgStartGroup): Promise { - const data = MsgStartGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta2.Msg", "StartGroup", data); - return promise.then(data => MsgStartGroupResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} diff --git a/src/protobuf/akash/deployment/v1beta3/authz.ts b/src/protobuf/akash/deployment/v1beta3/authz.ts deleted file mode 100644 index e6b26c9..0000000 --- a/src/protobuf/akash/deployment/v1beta3/authz.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.spendLimit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.spendLimit !== undefined && (obj.spendLimit = message.spendLimit ? Coin.toJSON(message.spendLimit) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/deployment.ts b/src/protobuf/akash/deployment/v1beta3/deployment.ts deleted file mode 100644 index 09fa4b2..0000000 --- a/src/protobuf/akash/deployment/v1beta3/deployment.ts +++ /dev/null @@ -1,362 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - writer.uint32(16).uint64(message.dseq); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeploymentID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DeploymentID { - return { - $type: DeploymentID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO - }; - }, - - toJSON(message: DeploymentID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - return obj; - }, - - 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(), - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Deployment { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.deploymentId = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.version = reader.bytes(); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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(), - createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO - }; - }, - - toJSON(message: Deployment): unknown { - const obj: any = {}; - message.deploymentId !== undefined && (obj.deploymentId = message.deploymentId ? DeploymentID.toJSON(message.deploymentId) : undefined); - message.state !== undefined && (obj.state = deployment_StateToJSON(message.state)); - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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(); - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DeploymentFilters { - return { - $type: DeploymentFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: DeploymentFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/deploymentmsg.ts b/src/protobuf/akash/deployment/v1beta3/deploymentmsg.ts deleted file mode 100644 index f9106ef..0000000 --- a/src/protobuf/akash/deployment/v1beta3/deploymentmsg.ts +++ /dev/null @@ -1,602 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DeploymentID } from "./deployment"; -import { GroupSpec } from "./groupspec"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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(), - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(GroupSpec.decode(reader, reader.uint32())); - break; - case 3: - message.version = reader.bytes(); - break; - case 4: - message.deposit = Coin.decode(reader, reader.uint32()); - break; - case 5: - message.depositor = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateDeployment { - return { - $type: MsgCreateDeployment.$type, - id: isSet(object.id) ? DeploymentID.fromJSON(object.id) : undefined, - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupSpec.fromJSON(e)) : [], - version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), - deposit: isSet(object.deposit) ? Coin.fromJSON(object.deposit) : undefined, - depositor: isSet(object.depositor) ? String(object.depositor) : "" - }; - }, - - toJSON(message: MsgCreateDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? GroupSpec.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - message.deposit !== undefined && (obj.deposit = message.deposit ? Coin.toJSON(message.deposit) : undefined); - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; - }, - - 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(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateDeploymentResponse { - return { - $type: MsgCreateDeploymentResponse.$type - }; - }, - - toJSON(_: MsgCreateDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 2: - message.amount = Coin.decode(reader, reader.uint32()); - break; - case 3: - message.depositor = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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) ? String(object.depositor) : "" - }; - }, - - toJSON(message: MsgDepositDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDepositDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDepositDeploymentResponse { - return { - $type: MsgDepositDeploymentResponse.$type - }; - }, - - toJSON(_: MsgDepositDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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() - }; -} - -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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - case 3: - message.version = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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() - }; - }, - - toJSON(message: MsgUpdateDeployment): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - message.version !== undefined && (obj.version = base64FromBytes(message.version !== undefined ? message.version : new Uint8Array())); - return obj; - }, - - 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(); - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateDeploymentResponse { - return { - $type: MsgUpdateDeploymentResponse.$type - }; - }, - - toJSON(_: MsgUpdateDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseDeploymentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseDeploymentResponse { - return { - $type: MsgCloseDeploymentResponse.$type - }; - }, - - toJSON(_: MsgCloseDeploymentResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgCloseDeploymentResponse { - const message = createBaseMsgCloseDeploymentResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgCloseDeploymentResponse.$type, MsgCloseDeploymentResponse); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/genesis.ts b/src/protobuf/akash/deployment/v1beta3/genesis.ts deleted file mode 100644 index 82deadc..0000000 --- a/src/protobuf/akash/deployment/v1beta3/genesis.ts +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Deployment } from "./deployment"; -import { Group } from "./group"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.deployment = Deployment.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(Group.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisDeployment { - return { - $type: GenesisDeployment.$type, - deployment: isSet(object.deployment) ? Deployment.fromJSON(object.deployment) : undefined, - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => Group.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisDeployment): unknown { - const obj: any = {}; - message.deployment !== undefined && (obj.deployment = message.deployment ? Deployment.toJSON(message.deployment) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? Group.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployments.push(GenesisDeployment.decode(reader, reader.uint32())); - break; - case 2: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - deployments: 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) { - obj.deployments = message.deployments.map(e => (e ? GenesisDeployment.toJSON(e) : undefined)); - } else { - obj.deployments = []; - } - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/group.ts b/src/protobuf/akash/deployment/v1beta3/group.ts deleted file mode 100644 index 81fd108..0000000 --- a/src/protobuf/akash/deployment/v1beta3/group.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupID } from "./groupid"; -import { GroupSpec } from "./groupspec"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Group { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.groupId = GroupID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.groupSpec = GroupSpec.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.groupId !== undefined && (obj.groupId = message.groupId ? GroupID.toJSON(message.groupId) : undefined); - message.state !== undefined && (obj.state = group_StateToJSON(message.state)); - message.groupSpec !== undefined && (obj.groupSpec = message.groupSpec ? GroupSpec.toJSON(message.groupSpec) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/groupid.ts b/src/protobuf/akash/deployment/v1beta3/groupid.ts deleted file mode 100644 index a3e896c..0000000 --- a/src/protobuf/akash/deployment/v1beta3/groupid.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GroupID { - return { - $type: GroupID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0 - }; - }, - - toJSON(message: GroupID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/groupmsg.ts b/src/protobuf/akash/deployment/v1beta3/groupmsg.ts deleted file mode 100644 index d6a972f..0000000 --- a/src/protobuf/akash/deployment/v1beta3/groupmsg.ts +++ /dev/null @@ -1,365 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupID } from "./groupid"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseGroupResponse { - return { - $type: MsgCloseGroupResponse.$type - }; - }, - - toJSON(_: MsgCloseGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgPauseGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgPauseGroupResponse { - return { - $type: MsgPauseGroupResponse.$type - }; - }, - - toJSON(_: MsgPauseGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStartGroupResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgStartGroupResponse { - return { - $type: MsgStartGroupResponse.$type - }; - }, - - toJSON(_: MsgStartGroupResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/groupspec.ts b/src/protobuf/akash/deployment/v1beta3/groupspec.ts deleted file mode 100644 index b59cd6e..0000000 --- a/src/protobuf/akash/deployment/v1beta3/groupspec.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PlacementRequirements } from "../../base/v1beta3/attribute"; -import { ResourceUnit } from "./resourceunit"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.requirements = PlacementRequirements.decode(reader, reader.uint32()); - break; - case 3: - message.resources.push(ResourceUnit.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GroupSpec { - return { - $type: GroupSpec.$type, - name: isSet(object.name) ? String(object.name) : "", - requirements: isSet(object.requirements) ? PlacementRequirements.fromJSON(object.requirements) : undefined, - resources: Array.isArray(object?.resources) ? object.resources.map((e: any) => ResourceUnit.fromJSON(e)) : [] - }; - }, - - toJSON(message: GroupSpec): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.requirements !== undefined && (obj.requirements = message.requirements ? PlacementRequirements.toJSON(message.requirements) : undefined); - if (message.resources) { - obj.resources = message.resources.map(e => (e ? ResourceUnit.toJSON(e) : undefined)); - } else { - obj.resources = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/params.ts b/src/protobuf/akash/deployment/v1beta3/params.ts deleted file mode 100644 index edf4658..0000000 --- a/src/protobuf/akash/deployment/v1beta3/params.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.minDeposits.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - minDeposits: Array.isArray(object?.minDeposits) ? object.minDeposits.map((e: any) => Coin.fromJSON(e)) : [] - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.minDeposits) { - obj.minDeposits = message.minDeposits.map(e => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.minDeposits = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/deployment/v1beta3/query.ts b/src/protobuf/akash/deployment/v1beta3/query.ts deleted file mode 100644 index bdd934b..0000000 --- a/src/protobuf/akash/deployment/v1beta3/query.ts +++ /dev/null @@ -1,507 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DeploymentFilters, DeploymentID, Deployment } from "./deployment"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Group } from "./group"; -import { Account } from "../../escrow/v1beta3/types"; -import { GroupID } from "./groupid"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.filters = DeploymentFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? DeploymentFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployments.push(QueryDeploymentResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDeploymentsResponse { - return { - $type: QueryDeploymentsResponse.$type, - deployments: 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) { - obj.deployments = message.deployments.map(e => (e ? QueryDeploymentResponse.toJSON(e) : undefined)); - } else { - obj.deployments = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = DeploymentID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? DeploymentID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.deployment = Deployment.decode(reader, reader.uint32()); - break; - case 2: - message.groups.push(Group.decode(reader, reader.uint32())); - break; - case 3: - message.escrowAccount = Account.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDeploymentResponse { - return { - $type: QueryDeploymentResponse.$type, - deployment: isSet(object.deployment) ? Deployment.fromJSON(object.deployment) : undefined, - groups: 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 = {}; - message.deployment !== undefined && (obj.deployment = message.deployment ? Deployment.toJSON(message.deployment) : undefined); - if (message.groups) { - obj.groups = message.groups.map(e => (e ? Group.toJSON(e) : undefined)); - } else { - obj.groups = []; - } - message.escrowAccount !== undefined && (obj.escrowAccount = message.escrowAccount ? Account.toJSON(message.escrowAccount) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = GroupID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? GroupID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.group = Group.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.group !== undefined && (obj.group = message.group ? Group.toJSON(message.group) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.deployment.v1beta3.Query", "Deployments", data); - return promise.then(data => QueryDeploymentsResponse.decode(new _m0.Reader(data))); - } - - Deployment(request: QueryDeploymentRequest): Promise { - const data = QueryDeploymentRequest.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Query", "Deployment", data); - return promise.then(data => QueryDeploymentResponse.decode(new _m0.Reader(data))); - } - - Group(request: QueryGroupRequest): Promise { - const data = QueryGroupRequest.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Query", "Group", data); - return promise.then(data => QueryGroupResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/resource.ts b/src/protobuf/akash/deployment/v1beta3/resource.ts deleted file mode 100644 index 2ac9d38..0000000 --- a/src/protobuf/akash/deployment/v1beta3/resource.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { ResourceUnits } from "../../base/v1beta3/resourceunits"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -export const protobufPackage = "akash.deployment.v1beta3"; - -/** Resource stores unit, total count and price of resource */ -export interface Resource { - $type: "akash.deployment.v1beta3.Resource"; - resources: ResourceUnits | undefined; - count: number; - price: DecCoin | undefined; -} - -function createBaseResource(): Resource { - return { - $type: "akash.deployment.v1beta3.Resource", - resources: undefined, - count: 0, - price: undefined - }; -} - -export const Resource = { - $type: "akash.deployment.v1beta3.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 : new _m0.Reader(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: - message.resources = ResourceUnits.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Resource { - return { - $type: Resource.$type, - resources: isSet(object.resources) ? ResourceUnits.fromJSON(object.resources) : undefined, - count: isSet(object.count) ? Number(object.count) : 0, - price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined - }; - }, - - toJSON(message: Resource): unknown { - const obj: any = {}; - message.resources !== undefined && (obj.resources = message.resources ? ResourceUnits.toJSON(message.resources) : undefined); - message.count !== undefined && (obj.count = Math.round(message.count)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/resourceunit.ts b/src/protobuf/akash/deployment/v1beta3/resourceunit.ts deleted file mode 100644 index d12bed3..0000000 --- a/src/protobuf/akash/deployment/v1beta3/resourceunit.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Resources } from "../../base/v1beta3/resources"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.resource = Resources.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResourceUnit { - return { - $type: ResourceUnit.$type, - resource: isSet(object.resource) ? Resources.fromJSON(object.resource) : undefined, - count: isSet(object.count) ? Number(object.count) : 0, - price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined - }; - }, - - toJSON(message: ResourceUnit): unknown { - const obj: any = {}; - message.resource !== undefined && (obj.resource = message.resource ? Resources.toJSON(message.resource) : undefined); - message.count !== undefined && (obj.count = Math.round(message.count)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/deployment/v1beta3/service.ts b/src/protobuf/akash/deployment/v1beta3/service.ts deleted file mode 100644 index 11b4e2b..0000000 --- a/src/protobuf/akash/deployment/v1beta3/service.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint-disable */ -import { - MsgCreateDeploymentResponse, - MsgDepositDeploymentResponse, - MsgUpdateDeploymentResponse, - MsgCloseDeploymentResponse, - MsgCreateDeployment, - MsgDepositDeployment, - MsgUpdateDeployment, - MsgCloseDeployment -} from "./deploymentmsg"; -import { MsgCloseGroupResponse, MsgPauseGroupResponse, MsgStartGroupResponse, MsgCloseGroup, MsgPauseGroup, MsgStartGroup } from "./groupmsg"; -import * as _m0 from "protobufjs/minimal"; - -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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.deployment.v1beta3.Msg", "CreateDeployment", data); - return promise.then(data => MsgCreateDeploymentResponse.decode(new _m0.Reader(data))); - } - - DepositDeployment(request: MsgDepositDeployment): Promise { - const data = MsgDepositDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Msg", "DepositDeployment", data); - return promise.then(data => MsgDepositDeploymentResponse.decode(new _m0.Reader(data))); - } - - UpdateDeployment(request: MsgUpdateDeployment): Promise { - const data = MsgUpdateDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Msg", "UpdateDeployment", data); - return promise.then(data => MsgUpdateDeploymentResponse.decode(new _m0.Reader(data))); - } - - CloseDeployment(request: MsgCloseDeployment): Promise { - const data = MsgCloseDeployment.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Msg", "CloseDeployment", data); - return promise.then(data => MsgCloseDeploymentResponse.decode(new _m0.Reader(data))); - } - - CloseGroup(request: MsgCloseGroup): Promise { - const data = MsgCloseGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Msg", "CloseGroup", data); - return promise.then(data => MsgCloseGroupResponse.decode(new _m0.Reader(data))); - } - - PauseGroup(request: MsgPauseGroup): Promise { - const data = MsgPauseGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Msg", "PauseGroup", data); - return promise.then(data => MsgPauseGroupResponse.decode(new _m0.Reader(data))); - } - - StartGroup(request: MsgStartGroup): Promise { - const data = MsgStartGroup.encode(request).finish(); - const promise = this.rpc.request("akash.deployment.v1beta3.Msg", "StartGroup", data); - return promise.then(data => MsgStartGroupResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} diff --git a/src/protobuf/akash/escrow/v1beta1/genesis.ts b/src/protobuf/akash/escrow/v1beta1/genesis.ts deleted file mode 100644 index 22d5539..0000000 --- a/src/protobuf/akash/escrow/v1beta1/genesis.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Account, Payment } from "./types"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.accounts.push(Account.decode(reader, reader.uint32())); - break; - case 2: - message.payments.push(Payment.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Account.fromJSON(e)) : [], - payments: Array.isArray(object?.payments) ? object.payments.map((e: any) => Payment.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.accounts) { - obj.accounts = message.accounts.map(e => (e ? Account.toJSON(e) : undefined)); - } else { - obj.accounts = []; - } - if (message.payments) { - obj.payments = message.payments.map(e => (e ? Payment.toJSON(e) : undefined)); - } else { - obj.payments = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/escrow/v1beta1/query.ts b/src/protobuf/akash/escrow/v1beta1/query.ts deleted file mode 100644 index fe462f5..0000000 --- a/src/protobuf/akash/escrow/v1beta1/query.ts +++ /dev/null @@ -1,457 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Account, Payment } from "./types"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - case 3: - message.owner = reader.string(); - break; - case 4: - message.state = reader.string(); - break; - case 5: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountsRequest { - return { - $type: QueryAccountsRequest.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "", - owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? String(object.state) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryAccountsRequest): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = message.state); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.accounts.push(Account.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountsResponse { - return { - $type: QueryAccountsResponse.$type, - accounts: 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) { - obj.accounts = message.accounts.map(e => (e ? Account.toJSON(e) : undefined)); - } else { - obj.accounts = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - case 3: - message.id = reader.string(); - break; - case 4: - message.owner = reader.string(); - break; - case 5: - message.state = reader.string(); - break; - case 6: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPaymentsRequest { - return { - $type: QueryPaymentsRequest.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "", - id: isSet(object.id) ? String(object.id) : "", - owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? String(object.state) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryPaymentsRequest): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - message.id !== undefined && (obj.id = message.id); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = message.state); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.payments.push(Payment.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPaymentsResponse { - return { - $type: QueryPaymentsResponse.$type, - payments: 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) { - obj.payments = message.payments.map(e => (e ? Payment.toJSON(e) : undefined)); - } else { - obj.payments = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.escrow.v1beta1.Query", "Accounts", data); - return promise.then(data => QueryAccountsResponse.decode(new _m0.Reader(data))); - } - - Payments(request: QueryPaymentsRequest): Promise { - const data = QueryPaymentsRequest.encode(request).finish(); - const promise = this.rpc.request("akash.escrow.v1beta1.Query", "Payments", data); - return promise.then(data => QueryPaymentsResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/escrow/v1beta1/types.ts b/src/protobuf/akash/escrow/v1beta1/types.ts deleted file mode 100644 index 97b7c4c..0000000 --- a/src/protobuf/akash/escrow/v1beta1/types.ts +++ /dev/null @@ -1,458 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AccountID { - return { - $type: AccountID.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "" - }; - }, - - toJSON(message: AccountID): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - return obj; - }, - - 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.isZero()) { - writer.uint32(48).int64(message.settledAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Account { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.id = AccountID.decode(reader, reader.uint32()); - break; - case 2: - message.owner = reader.string(); - break; - case 3: - message.state = reader.int32() as any; - break; - case 4: - message.balance = Coin.decode(reader, reader.uint32()); - break; - case 5: - message.transferred = Coin.decode(reader, reader.uint32()); - break; - case 6: - message.settledAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Account { - return { - $type: Account.$type, - id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, - owner: isSet(object.owner) ? 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 = {}; - message.id !== undefined && (obj.id = message.id ? AccountID.toJSON(message.id) : undefined); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = account_StateToJSON(message.state)); - message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); - message.transferred !== undefined && (obj.transferred = message.transferred ? Coin.toJSON(message.transferred) : undefined); - message.settledAt !== undefined && (obj.settledAt = (message.settledAt || Long.ZERO).toString()); - return obj; - }, - - 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 : new _m0.Reader(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: - message.accountId = AccountID.decode(reader, reader.uint32()); - break; - case 2: - message.paymentId = reader.string(); - break; - case 3: - message.owner = reader.string(); - break; - case 4: - message.state = reader.int32() as any; - break; - case 5: - message.rate = Coin.decode(reader, reader.uint32()); - break; - case 6: - message.balance = Coin.decode(reader, reader.uint32()); - break; - case 7: - message.withdrawn = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Payment { - return { - $type: Payment.$type, - accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, - paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", - owner: isSet(object.owner) ? 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 = {}; - message.accountId !== undefined && (obj.accountId = message.accountId ? AccountID.toJSON(message.accountId) : undefined); - message.paymentId !== undefined && (obj.paymentId = message.paymentId); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = payment_StateToJSON(message.state)); - message.rate !== undefined && (obj.rate = message.rate ? Coin.toJSON(message.rate) : undefined); - message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); - message.withdrawn !== undefined && (obj.withdrawn = message.withdrawn ? Coin.toJSON(message.withdrawn) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/escrow/v1beta2/genesis.ts b/src/protobuf/akash/escrow/v1beta2/genesis.ts deleted file mode 100644 index a83ce61..0000000 --- a/src/protobuf/akash/escrow/v1beta2/genesis.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Account, FractionalPayment } from "./types"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.accounts.push(Account.decode(reader, reader.uint32())); - break; - case 2: - message.payments.push(FractionalPayment.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Account.fromJSON(e)) : [], - payments: Array.isArray(object?.payments) ? object.payments.map((e: any) => FractionalPayment.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.accounts) { - obj.accounts = message.accounts.map(e => (e ? Account.toJSON(e) : undefined)); - } else { - obj.accounts = []; - } - if (message.payments) { - obj.payments = message.payments.map(e => (e ? FractionalPayment.toJSON(e) : undefined)); - } else { - obj.payments = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/escrow/v1beta2/query.ts b/src/protobuf/akash/escrow/v1beta2/query.ts deleted file mode 100644 index efe9df0..0000000 --- a/src/protobuf/akash/escrow/v1beta2/query.ts +++ /dev/null @@ -1,457 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Account, FractionalPayment } from "./types"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - case 3: - message.owner = reader.string(); - break; - case 4: - message.state = reader.string(); - break; - case 5: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountsRequest { - return { - $type: QueryAccountsRequest.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "", - owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? String(object.state) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryAccountsRequest): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = message.state); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.accounts.push(Account.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountsResponse { - return { - $type: QueryAccountsResponse.$type, - accounts: 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) { - obj.accounts = message.accounts.map(e => (e ? Account.toJSON(e) : undefined)); - } else { - obj.accounts = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - case 3: - message.id = reader.string(); - break; - case 4: - message.owner = reader.string(); - break; - case 5: - message.state = reader.string(); - break; - case 6: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPaymentsRequest { - return { - $type: QueryPaymentsRequest.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "", - id: isSet(object.id) ? String(object.id) : "", - owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? String(object.state) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryPaymentsRequest): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - message.id !== undefined && (obj.id = message.id); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = message.state); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.payments.push(FractionalPayment.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPaymentsResponse { - return { - $type: QueryPaymentsResponse.$type, - payments: 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) { - obj.payments = message.payments.map(e => (e ? FractionalPayment.toJSON(e) : undefined)); - } else { - obj.payments = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.escrow.v1beta2.Query", "Accounts", data); - return promise.then(data => QueryAccountsResponse.decode(new _m0.Reader(data))); - } - - Payments(request: QueryPaymentsRequest): Promise { - const data = QueryPaymentsRequest.encode(request).finish(); - const promise = this.rpc.request("akash.escrow.v1beta2.Query", "Payments", data); - return promise.then(data => QueryPaymentsResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/escrow/v1beta2/types.ts b/src/protobuf/akash/escrow/v1beta2/types.ts deleted file mode 100644 index f83add5..0000000 --- a/src/protobuf/akash/escrow/v1beta2/types.ts +++ /dev/null @@ -1,489 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AccountID { - return { - $type: AccountID.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "" - }; - }, - - toJSON(message: AccountID): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.id = AccountID.decode(reader, reader.uint32()); - break; - case 2: - message.owner = reader.string(); - break; - case 3: - message.state = reader.int32() as any; - break; - case 4: - message.balance = DecCoin.decode(reader, reader.uint32()); - break; - case 5: - message.transferred = DecCoin.decode(reader, reader.uint32()); - break; - case 6: - message.settledAt = reader.int64() as Long; - break; - case 7: - message.depositor = reader.string(); - break; - case 8: - message.funds = DecCoin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Account { - return { - $type: Account.$type, - id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, - owner: isSet(object.owner) ? 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) ? String(object.depositor) : "", - funds: isSet(object.funds) ? DecCoin.fromJSON(object.funds) : undefined - }; - }, - - toJSON(message: Account): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? AccountID.toJSON(message.id) : undefined); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = account_StateToJSON(message.state)); - message.balance !== undefined && (obj.balance = message.balance ? DecCoin.toJSON(message.balance) : undefined); - message.transferred !== undefined && (obj.transferred = message.transferred ? DecCoin.toJSON(message.transferred) : undefined); - message.settledAt !== undefined && (obj.settledAt = (message.settledAt || Long.ZERO).toString()); - message.depositor !== undefined && (obj.depositor = message.depositor); - message.funds !== undefined && (obj.funds = message.funds ? DecCoin.toJSON(message.funds) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.accountId = AccountID.decode(reader, reader.uint32()); - break; - case 2: - message.paymentId = reader.string(); - break; - case 3: - message.owner = reader.string(); - break; - case 4: - message.state = reader.int32() as any; - break; - case 5: - message.rate = DecCoin.decode(reader, reader.uint32()); - break; - case 6: - message.balance = DecCoin.decode(reader, reader.uint32()); - break; - case 7: - message.withdrawn = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FractionalPayment { - return { - $type: FractionalPayment.$type, - accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, - paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", - owner: isSet(object.owner) ? 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 = {}; - message.accountId !== undefined && (obj.accountId = message.accountId ? AccountID.toJSON(message.accountId) : undefined); - message.paymentId !== undefined && (obj.paymentId = message.paymentId); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = fractionalPayment_StateToJSON(message.state)); - message.rate !== undefined && (obj.rate = message.rate ? DecCoin.toJSON(message.rate) : undefined); - message.balance !== undefined && (obj.balance = message.balance ? DecCoin.toJSON(message.balance) : undefined); - message.withdrawn !== undefined && (obj.withdrawn = message.withdrawn ? Coin.toJSON(message.withdrawn) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/escrow/v1beta3/genesis.ts b/src/protobuf/akash/escrow/v1beta3/genesis.ts deleted file mode 100644 index ee3f508..0000000 --- a/src/protobuf/akash/escrow/v1beta3/genesis.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Account, FractionalPayment } from "./types"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.accounts.push(Account.decode(reader, reader.uint32())); - break; - case 2: - message.payments.push(FractionalPayment.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Account.fromJSON(e)) : [], - payments: Array.isArray(object?.payments) ? object.payments.map((e: any) => FractionalPayment.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.accounts) { - obj.accounts = message.accounts.map(e => (e ? Account.toJSON(e) : undefined)); - } else { - obj.accounts = []; - } - if (message.payments) { - obj.payments = message.payments.map(e => (e ? FractionalPayment.toJSON(e) : undefined)); - } else { - obj.payments = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/escrow/v1beta3/query.ts b/src/protobuf/akash/escrow/v1beta3/query.ts deleted file mode 100644 index 61de887..0000000 --- a/src/protobuf/akash/escrow/v1beta3/query.ts +++ /dev/null @@ -1,457 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Account, FractionalPayment } from "./types"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - case 3: - message.owner = reader.string(); - break; - case 4: - message.state = reader.string(); - break; - case 5: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountsRequest { - return { - $type: QueryAccountsRequest.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "", - owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? String(object.state) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryAccountsRequest): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = message.state); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.accounts.push(Account.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountsResponse { - return { - $type: QueryAccountsResponse.$type, - accounts: 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) { - obj.accounts = message.accounts.map(e => (e ? Account.toJSON(e) : undefined)); - } else { - obj.accounts = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - case 3: - message.id = reader.string(); - break; - case 4: - message.owner = reader.string(); - break; - case 5: - message.state = reader.string(); - break; - case 6: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPaymentsRequest { - return { - $type: QueryPaymentsRequest.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "", - id: isSet(object.id) ? String(object.id) : "", - owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? String(object.state) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QueryPaymentsRequest): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - message.id !== undefined && (obj.id = message.id); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = message.state); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.payments.push(FractionalPayment.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPaymentsResponse { - return { - $type: QueryPaymentsResponse.$type, - payments: 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) { - obj.payments = message.payments.map(e => (e ? FractionalPayment.toJSON(e) : undefined)); - } else { - obj.payments = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.escrow.v1beta3.Query", "Accounts", data); - return promise.then(data => QueryAccountsResponse.decode(new _m0.Reader(data))); - } - - Payments(request: QueryPaymentsRequest): Promise { - const data = QueryPaymentsRequest.encode(request).finish(); - const promise = this.rpc.request("akash.escrow.v1beta3.Query", "Payments", data); - return promise.then(data => QueryPaymentsResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/escrow/v1beta3/types.ts b/src/protobuf/akash/escrow/v1beta3/types.ts deleted file mode 100644 index c235701..0000000 --- a/src/protobuf/akash/escrow/v1beta3/types.ts +++ /dev/null @@ -1,489 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.scope = reader.string(); - break; - case 2: - message.xid = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AccountID { - return { - $type: AccountID.$type, - scope: isSet(object.scope) ? String(object.scope) : "", - xid: isSet(object.xid) ? String(object.xid) : "" - }; - }, - - toJSON(message: AccountID): unknown { - const obj: any = {}; - message.scope !== undefined && (obj.scope = message.scope); - message.xid !== undefined && (obj.xid = message.xid); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.id = AccountID.decode(reader, reader.uint32()); - break; - case 2: - message.owner = reader.string(); - break; - case 3: - message.state = reader.int32() as any; - break; - case 4: - message.balance = DecCoin.decode(reader, reader.uint32()); - break; - case 5: - message.transferred = DecCoin.decode(reader, reader.uint32()); - break; - case 6: - message.settledAt = reader.int64() as Long; - break; - case 7: - message.depositor = reader.string(); - break; - case 8: - message.funds = DecCoin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Account { - return { - $type: Account.$type, - id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, - owner: isSet(object.owner) ? 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) ? String(object.depositor) : "", - funds: isSet(object.funds) ? DecCoin.fromJSON(object.funds) : undefined - }; - }, - - toJSON(message: Account): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id ? AccountID.toJSON(message.id) : undefined); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = account_StateToJSON(message.state)); - message.balance !== undefined && (obj.balance = message.balance ? DecCoin.toJSON(message.balance) : undefined); - message.transferred !== undefined && (obj.transferred = message.transferred ? DecCoin.toJSON(message.transferred) : undefined); - message.settledAt !== undefined && (obj.settledAt = (message.settledAt || Long.ZERO).toString()); - message.depositor !== undefined && (obj.depositor = message.depositor); - message.funds !== undefined && (obj.funds = message.funds ? DecCoin.toJSON(message.funds) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.accountId = AccountID.decode(reader, reader.uint32()); - break; - case 2: - message.paymentId = reader.string(); - break; - case 3: - message.owner = reader.string(); - break; - case 4: - message.state = reader.int32() as any; - break; - case 5: - message.rate = DecCoin.decode(reader, reader.uint32()); - break; - case 6: - message.balance = DecCoin.decode(reader, reader.uint32()); - break; - case 7: - message.withdrawn = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FractionalPayment { - return { - $type: FractionalPayment.$type, - accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, - paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", - owner: isSet(object.owner) ? 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 = {}; - message.accountId !== undefined && (obj.accountId = message.accountId ? AccountID.toJSON(message.accountId) : undefined); - message.paymentId !== undefined && (obj.paymentId = message.paymentId); - message.owner !== undefined && (obj.owner = message.owner); - message.state !== undefined && (obj.state = fractionalPayment_StateToJSON(message.state)); - message.rate !== undefined && (obj.rate = message.rate ? DecCoin.toJSON(message.rate) : undefined); - message.balance !== undefined && (obj.balance = message.balance ? DecCoin.toJSON(message.balance) : undefined); - message.withdrawn !== undefined && (obj.withdrawn = message.withdrawn ? Coin.toJSON(message.withdrawn) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/gov/v1beta3/genesis.ts b/src/protobuf/akash/gov/v1beta3/genesis.ts deleted file mode 100644 index dfe92ae..0000000 --- a/src/protobuf/akash/gov/v1beta3/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DepositParams } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.depositParams = DepositParams.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.depositParams !== undefined && (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/gov/v1beta3/params.ts b/src/protobuf/akash/gov/v1beta3/params.ts deleted file mode 100644 index 26fa5fc..0000000 --- a/src/protobuf/akash/gov/v1beta3/params.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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() - }; -} - -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 : new _m0.Reader(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: - message.minInitialDepositRate = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DepositParams { - return { - $type: DepositParams.$type, - minInitialDepositRate: isSet(object.minInitialDepositRate) ? bytesFromBase64(object.minInitialDepositRate) : new Uint8Array() - }; - }, - - toJSON(message: DepositParams): unknown { - const obj: any = {}; - message.minInitialDepositRate !== undefined && - (obj.minInitialDepositRate = base64FromBytes(message.minInitialDepositRate !== undefined ? message.minInitialDepositRate : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): DepositParams { - const message = createBaseDepositParams(); - message.minInitialDepositRate = object.minInitialDepositRate ?? new Uint8Array(); - return message; - } -}; - -messageTypeRegistry.set(DepositParams.$type, DepositParams); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/icaauth/query.ts b/src/protobuf/akash/icaauth/query.ts deleted file mode 100644 index d567aa9..0000000 --- a/src/protobuf/akash/icaauth/query.ts +++ /dev/null @@ -1,194 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -export const protobufPackage = "akash.icaauth"; - -/** QueryInterchainAccountFromAddressRequest is the request type for the Query/InterchainAccountAddress RPC */ -export interface QueryInterchainAccountFromAddressRequest { - $type: "akash.icaauth.QueryInterchainAccountFromAddressRequest"; - owner: string; - connectionId: string; -} - -/** QueryInterchainAccountFromAddressResponse the response type for the Query/InterchainAccountAddress RPC */ -export interface QueryInterchainAccountFromAddressResponse { - $type: "akash.icaauth.QueryInterchainAccountFromAddressResponse"; - interchainAccountAddress: string; -} - -function createBaseQueryInterchainAccountFromAddressRequest(): QueryInterchainAccountFromAddressRequest { - return { - $type: "akash.icaauth.QueryInterchainAccountFromAddressRequest", - owner: "", - connectionId: "" - }; -} - -export const QueryInterchainAccountFromAddressRequest = { - $type: "akash.icaauth.QueryInterchainAccountFromAddressRequest" as const, - - encode(message: QueryInterchainAccountFromAddressRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.owner !== "") { - writer.uint32(10).string(message.owner); - } - if (message.connectionId !== "") { - writer.uint32(18).string(message.connectionId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInterchainAccountFromAddressRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryInterchainAccountFromAddressRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.owner = reader.string(); - break; - case 2: - message.connectionId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryInterchainAccountFromAddressRequest { - return { - $type: QueryInterchainAccountFromAddressRequest.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" - }; - }, - - toJSON(message: QueryInterchainAccountFromAddressRequest): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.connectionId !== undefined && (obj.connectionId = message.connectionId); - return obj; - }, - - fromPartial, I>>(object: I): QueryInterchainAccountFromAddressRequest { - const message = createBaseQueryInterchainAccountFromAddressRequest(); - message.owner = object.owner ?? ""; - message.connectionId = object.connectionId ?? ""; - return message; - } -}; - -messageTypeRegistry.set(QueryInterchainAccountFromAddressRequest.$type, QueryInterchainAccountFromAddressRequest); - -function createBaseQueryInterchainAccountFromAddressResponse(): QueryInterchainAccountFromAddressResponse { - return { - $type: "akash.icaauth.QueryInterchainAccountFromAddressResponse", - interchainAccountAddress: "" - }; -} - -export const QueryInterchainAccountFromAddressResponse = { - $type: "akash.icaauth.QueryInterchainAccountFromAddressResponse" as const, - - encode(message: QueryInterchainAccountFromAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.interchainAccountAddress !== "") { - writer.uint32(10).string(message.interchainAccountAddress); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInterchainAccountFromAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryInterchainAccountFromAddressResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.interchainAccountAddress = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryInterchainAccountFromAddressResponse { - return { - $type: QueryInterchainAccountFromAddressResponse.$type, - interchainAccountAddress: isSet(object.interchainAccountAddress) ? String(object.interchainAccountAddress) : "" - }; - }, - - toJSON(message: QueryInterchainAccountFromAddressResponse): unknown { - const obj: any = {}; - message.interchainAccountAddress !== undefined && (obj.interchainAccountAddress = message.interchainAccountAddress); - return obj; - }, - - fromPartial, I>>(object: I): QueryInterchainAccountFromAddressResponse { - const message = createBaseQueryInterchainAccountFromAddressResponse(); - message.interchainAccountAddress = object.interchainAccountAddress ?? ""; - return message; - } -}; - -messageTypeRegistry.set(QueryInterchainAccountFromAddressResponse.$type, QueryInterchainAccountFromAddressResponse); - -/** Query defines the gRPC querier service. */ -export interface Query { - /** QueryInterchainAccountFromAddress returns the interchain account for given owner address on a given connection pair */ - InterchainAccountFromAddress(request: QueryInterchainAccountFromAddressRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.InterchainAccountFromAddress = this.InterchainAccountFromAddress.bind(this); - } - InterchainAccountFromAddress(request: QueryInterchainAccountFromAddressRequest): Promise { - const data = QueryInterchainAccountFromAddressRequest.encode(request).finish(); - const promise = this.rpc.request("akash.icaauth.Query", "InterchainAccountFromAddress", data); - return promise.then(data => QueryInterchainAccountFromAddressResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/icaauth/tx.ts b/src/protobuf/akash/icaauth/tx.ts deleted file mode 100644 index 1034878..0000000 --- a/src/protobuf/akash/icaauth/tx.ts +++ /dev/null @@ -1,326 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../typeRegistry"; -import { Any } from "../../google/protobuf/any"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -export const protobufPackage = "akash.icaauth"; - -/** MsgRegisterAccount defines the payload for Msg/RegisterAccount */ -export interface MsgRegisterAccount { - $type: "akash.icaauth.MsgRegisterAccount"; - owner: string; - connectionId: string; -} - -/** MsgRegisterAccountResponse defines the response for Msg/RegisterAccount */ -export interface MsgRegisterAccountResponse { - $type: "akash.icaauth.MsgRegisterAccountResponse"; -} - -/** MsgSubmitTx defines the payload for Msg/SubmitTx */ -export interface MsgSubmitTx { - $type: "akash.icaauth.MsgSubmitTx"; - owner: string; - connectionId: string; - msg?: Any; -} - -/** MsgSubmitTxResponse defines the response for Msg/SubmitTx */ -export interface MsgSubmitTxResponse { - $type: "akash.icaauth.MsgSubmitTxResponse"; -} - -function createBaseMsgRegisterAccount(): MsgRegisterAccount { - return { - $type: "akash.icaauth.MsgRegisterAccount", - owner: "", - connectionId: "" - }; -} - -export const MsgRegisterAccount = { - $type: "akash.icaauth.MsgRegisterAccount" as const, - - encode(message: MsgRegisterAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.owner !== "") { - writer.uint32(10).string(message.owner); - } - if (message.connectionId !== "") { - writer.uint32(18).string(message.connectionId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRegisterAccount(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.owner = reader.string(); - break; - case 2: - message.connectionId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgRegisterAccount { - return { - $type: MsgRegisterAccount.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" - }; - }, - - toJSON(message: MsgRegisterAccount): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.connectionId !== undefined && (obj.connectionId = message.connectionId); - return obj; - }, - - fromPartial, I>>(object: I): MsgRegisterAccount { - const message = createBaseMsgRegisterAccount(); - message.owner = object.owner ?? ""; - message.connectionId = object.connectionId ?? ""; - return message; - } -}; - -messageTypeRegistry.set(MsgRegisterAccount.$type, MsgRegisterAccount); - -function createBaseMsgRegisterAccountResponse(): MsgRegisterAccountResponse { - return { $type: "akash.icaauth.MsgRegisterAccountResponse" }; -} - -export const MsgRegisterAccountResponse = { - $type: "akash.icaauth.MsgRegisterAccountResponse" as const, - - encode(_: MsgRegisterAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRegisterAccountResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgRegisterAccountResponse { - return { - $type: MsgRegisterAccountResponse.$type - }; - }, - - toJSON(_: MsgRegisterAccountResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgRegisterAccountResponse { - const message = createBaseMsgRegisterAccountResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgRegisterAccountResponse.$type, MsgRegisterAccountResponse); - -function createBaseMsgSubmitTx(): MsgSubmitTx { - return { - $type: "akash.icaauth.MsgSubmitTx", - owner: "", - connectionId: "", - msg: undefined - }; -} - -export const MsgSubmitTx = { - $type: "akash.icaauth.MsgSubmitTx" as const, - - encode(message: MsgSubmitTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.owner !== "") { - writer.uint32(10).string(message.owner); - } - if (message.connectionId !== "") { - writer.uint32(18).string(message.connectionId); - } - if (message.msg !== undefined) { - Any.encode(message.msg, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitTx(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.owner = reader.string(); - break; - case 2: - message.connectionId = reader.string(); - break; - case 3: - message.msg = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSubmitTx { - return { - $type: MsgSubmitTx.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", - msg: isSet(object.msg) ? Any.fromJSON(object.msg) : undefined - }; - }, - - toJSON(message: MsgSubmitTx): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.connectionId !== undefined && (obj.connectionId = message.connectionId); - message.msg !== undefined && (obj.msg = message.msg ? Any.toJSON(message.msg) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgSubmitTx { - const message = createBaseMsgSubmitTx(); - message.owner = object.owner ?? ""; - message.connectionId = object.connectionId ?? ""; - message.msg = object.msg !== undefined && object.msg !== null ? Any.fromPartial(object.msg) : undefined; - return message; - } -}; - -messageTypeRegistry.set(MsgSubmitTx.$type, MsgSubmitTx); - -function createBaseMsgSubmitTxResponse(): MsgSubmitTxResponse { - return { $type: "akash.icaauth.MsgSubmitTxResponse" }; -} - -export const MsgSubmitTxResponse = { - $type: "akash.icaauth.MsgSubmitTxResponse" as const, - - encode(_: MsgSubmitTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitTxResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgSubmitTxResponse { - return { - $type: MsgSubmitTxResponse.$type - }; - }, - - toJSON(_: MsgSubmitTxResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgSubmitTxResponse { - const message = createBaseMsgSubmitTxResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgSubmitTxResponse.$type, MsgSubmitTxResponse); - -/** Msg defines the icaauth Msg service. */ -export interface Msg { - /** Register defines a rpc handler for MsgRegisterAccount */ - RegisterAccount(request: MsgRegisterAccount): Promise; - /** SubmitTx defines a rpc handler for MsgSubmitTx */ - SubmitTx(request: MsgSubmitTx): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.RegisterAccount = this.RegisterAccount.bind(this); - this.SubmitTx = this.SubmitTx.bind(this); - } - RegisterAccount(request: MsgRegisterAccount): Promise { - const data = MsgRegisterAccount.encode(request).finish(); - const promise = this.rpc.request("akash.icaauth.Msg", "RegisterAccount", data); - return promise.then(data => MsgRegisterAccountResponse.decode(new _m0.Reader(data))); - } - - SubmitTx(request: MsgSubmitTx): Promise { - const data = MsgSubmitTx.encode(request).finish(); - const promise = this.rpc.request("akash.icaauth.Msg", "SubmitTx", data); - return promise.then(data => MsgSubmitTxResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/inflation/v1beta2/genesis.ts b/src/protobuf/akash/inflation/v1beta2/genesis.ts deleted file mode 100644 index 66f25f7..0000000 --- a/src/protobuf/akash/inflation/v1beta2/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/inflation/v1beta2/params.ts b/src/protobuf/akash/inflation/v1beta2/params.ts deleted file mode 100644 index f4adfbe..0000000 --- a/src/protobuf/akash/inflation/v1beta2/params.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.inflationDecayFactor = reader.string(); - break; - case 2: - message.initialInflation = reader.string(); - break; - case 3: - message.variance = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - inflationDecayFactor: isSet(object.inflationDecayFactor) ? String(object.inflationDecayFactor) : "", - initialInflation: isSet(object.initialInflation) ? String(object.initialInflation) : "", - variance: isSet(object.variance) ? String(object.variance) : "" - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.inflationDecayFactor !== undefined && (obj.inflationDecayFactor = message.inflationDecayFactor); - message.initialInflation !== undefined && (obj.initialInflation = message.initialInflation); - message.variance !== undefined && (obj.variance = message.variance); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/inflation/v1beta3/genesis.ts b/src/protobuf/akash/inflation/v1beta3/genesis.ts deleted file mode 100644 index fa5d48f..0000000 --- a/src/protobuf/akash/inflation/v1beta3/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/inflation/v1beta3/params.ts b/src/protobuf/akash/inflation/v1beta3/params.ts deleted file mode 100644 index aaca2f0..0000000 --- a/src/protobuf/akash/inflation/v1beta3/params.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.inflationDecayFactor = reader.string(); - break; - case 2: - message.initialInflation = reader.string(); - break; - case 3: - message.variance = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - inflationDecayFactor: isSet(object.inflationDecayFactor) ? String(object.inflationDecayFactor) : "", - initialInflation: isSet(object.initialInflation) ? String(object.initialInflation) : "", - variance: isSet(object.variance) ? String(object.variance) : "" - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.inflationDecayFactor !== undefined && (obj.inflationDecayFactor = message.inflationDecayFactor); - message.initialInflation !== undefined && (obj.initialInflation = message.initialInflation); - message.variance !== undefined && (obj.variance = message.variance); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta1/bid.ts b/src/protobuf/akash/market/v1beta1/bid.ts deleted file mode 100644 index 9a463c6..0000000 --- a/src/protobuf/akash/market/v1beta1/bid.ts +++ /dev/null @@ -1,672 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { OrderID } from "../../../akash/market/v1beta1/order"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "akash.market.v1beta1"; - -/** MsgCreateBid defines an SDK message for creating Bid */ -export interface MsgCreateBid { - $type: "akash.market.v1beta1.MsgCreateBid"; - order?: OrderID; - provider: string; - price?: Coin; - deposit?: Coin; -} - -/** MsgCreateBidResponse defines the Msg/CreateBid response type. */ -export interface MsgCreateBidResponse { - $type: "akash.market.v1beta1.MsgCreateBidResponse"; -} - -/** MsgCloseBid defines an SDK message for closing bid */ -export interface MsgCloseBid { - $type: "akash.market.v1beta1.MsgCloseBid"; - bidId?: BidID; -} - -/** MsgCloseBidResponse defines the Msg/CloseBid response type. */ -export interface MsgCloseBidResponse { - $type: "akash.market.v1beta1.MsgCloseBidResponse"; -} - -/** - * BidID stores owner and all other seq numbers - * A successful bid becomes a Lease(ID). - */ -export interface BidID { - $type: "akash.market.v1beta1.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.v1beta1.Bid"; - bidId?: BidID; - state: Bid_State; - price?: Coin; - 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"; - default: - return "UNKNOWN"; - } -} - -/** BidFilters defines flags for bid list filter */ -export interface BidFilters { - $type: "akash.market.v1beta1.BidFilters"; - owner: string; - dseq: Long; - gseq: number; - oseq: number; - provider: string; - state: string; -} - -function createBaseMsgCreateBid(): MsgCreateBid { - return { - $type: "akash.market.v1beta1.MsgCreateBid", - order: undefined, - provider: "", - price: undefined, - deposit: undefined - }; -} - -export const MsgCreateBid = { - $type: "akash.market.v1beta1.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) { - Coin.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 : new _m0.Reader(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: - message.order = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.provider = reader.string(); - break; - case 3: - message.price = Coin.decode(reader, reader.uint32()); - break; - case 4: - message.deposit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateBid { - return { - $type: MsgCreateBid.$type, - order: isSet(object.order) ? OrderID.fromJSON(object.order) : undefined, - provider: isSet(object.provider) ? String(object.provider) : "", - price: isSet(object.price) ? Coin.fromJSON(object.price) : undefined, - deposit: isSet(object.deposit) ? Coin.fromJSON(object.deposit) : undefined - }; - }, - - toJSON(message: MsgCreateBid): unknown { - const obj: any = {}; - message.order !== undefined && (obj.order = message.order ? OrderID.toJSON(message.order) : undefined); - message.provider !== undefined && (obj.provider = message.provider); - message.price !== undefined && (obj.price = message.price ? Coin.toJSON(message.price) : undefined); - message.deposit !== undefined && (obj.deposit = message.deposit ? Coin.toJSON(message.deposit) : undefined); - return obj; - }, - - 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 ? Coin.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.v1beta1.MsgCreateBidResponse" }; -} - -export const MsgCreateBidResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateBidResponse { - return { - $type: MsgCreateBidResponse.$type - }; - }, - - toJSON(_: MsgCreateBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgCreateBidResponse { - const message = createBaseMsgCreateBidResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgCreateBidResponse.$type, MsgCreateBidResponse); - -function createBaseMsgCloseBid(): MsgCloseBid { - return { $type: "akash.market.v1beta1.MsgCloseBid", bidId: undefined }; -} - -export const MsgCloseBid = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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.v1beta1.MsgCloseBidResponse" }; -} - -export const MsgCloseBidResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseBidResponse { - return { - $type: MsgCloseBidResponse.$type - }; - }, - - toJSON(_: MsgCloseBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgCloseBidResponse { - const message = createBaseMsgCloseBidResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgCloseBidResponse.$type, MsgCloseBidResponse); - -function createBaseBidID(): BidID { - return { - $type: "akash.market.v1beta1.BidID", - owner: "", - dseq: Long.UZERO, - gseq: 0, - oseq: 0, - provider: "" - }; -} - -export const BidID = { - $type: "akash.market.v1beta1.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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidID { - return { - $type: BidID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromString(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: BidID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.v1beta1.Bid", - bidId: undefined, - state: 0, - price: undefined, - createdAt: Long.ZERO - }; -} - -export const Bid = { - $type: "akash.market.v1beta1.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) { - Coin.encode(message.price, writer.uint32(26).fork()).ldelim(); - } - if (!message.createdAt.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Bid { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = Coin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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) ? Coin.fromJSON(object.price) : undefined, - createdAt: isSet(object.createdAt) ? Long.fromString(object.createdAt) : Long.ZERO - }; - }, - - toJSON(message: Bid): unknown { - const obj: any = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - message.state !== undefined && (obj.state = bid_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? Coin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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 ? Coin.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.v1beta1.BidFilters", - owner: "", - dseq: Long.UZERO, - gseq: 0, - oseq: 0, - provider: "", - state: "" - }; -} - -export const BidFilters = { - $type: "akash.market.v1beta1.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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidFilters { - return { - $type: BidFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromString(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: BidFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta1/genesis.ts b/src/protobuf/akash/market/v1beta1/genesis.ts deleted file mode 100644 index 38f608e..0000000 --- a/src/protobuf/akash/market/v1beta1/genesis.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Params } from "../../../akash/market/v1beta1/params"; -import { Order } from "../../../akash/market/v1beta1/order"; -import { Lease } from "../../../akash/market/v1beta1/lease"; - -export const protobufPackage = "akash.market.v1beta1"; - -/** GenesisState defines the basic genesis state used by market module */ -export interface GenesisState { - $type: "akash.market.v1beta1.GenesisState"; - orders: Order[]; - leases: Lease[]; - params?: Params; -} - -function createBaseGenesisState(): GenesisState { - return { - $type: "akash.market.v1beta1.GenesisState", - orders: [], - leases: [], - params: undefined - }; -} - -export const GenesisState = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 2: - message.leases.push(Lease.decode(reader, reader.uint32())); - break; - case 3: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - orders: Array.isArray(object?.orders) ? object.orders.map((e: any) => Order.fromJSON(e)) : [], - leases: 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) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - if (message.leases) { - obj.leases = message.leases.map(e => (e ? Lease.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta1/lease.ts b/src/protobuf/akash/market/v1beta1/lease.ts deleted file mode 100644 index b663024..0000000 --- a/src/protobuf/akash/market/v1beta1/lease.ts +++ /dev/null @@ -1,736 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { BidID } from "../../../akash/market/v1beta1/bid"; - -export const protobufPackage = "akash.market.v1beta1"; - -/** LeaseID stores bid details of lease */ -export interface LeaseID { - $type: "akash.market.v1beta1.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.v1beta1.Lease"; - leaseId?: LeaseID; - state: Lease_State; - price?: Coin; - createdAt: 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"; - default: - return "UNKNOWN"; - } -} - -/** LeaseFilters defines flags for lease list filter */ -export interface LeaseFilters { - $type: "akash.market.v1beta1.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.v1beta1.MsgCreateLease"; - bidId?: BidID; -} - -/** MsgCreateLeaseResponse is the response from creating a lease */ -export interface MsgCreateLeaseResponse { - $type: "akash.market.v1beta1.MsgCreateLeaseResponse"; -} - -/** MsgWithdrawLease defines an SDK message for closing bid */ -export interface MsgWithdrawLease { - $type: "akash.market.v1beta1.MsgWithdrawLease"; - bidId?: LeaseID; -} - -/** MsgWithdrawLeaseResponse defines the Msg/WithdrawLease response type. */ -export interface MsgWithdrawLeaseResponse { - $type: "akash.market.v1beta1.MsgWithdrawLeaseResponse"; -} - -/** MsgCloseLease defines an SDK message for closing order */ -export interface MsgCloseLease { - $type: "akash.market.v1beta1.MsgCloseLease"; - leaseId?: LeaseID; -} - -/** MsgCloseLeaseResponse defines the Msg/CloseLease response type. */ -export interface MsgCloseLeaseResponse { - $type: "akash.market.v1beta1.MsgCloseLeaseResponse"; -} - -function createBaseLeaseID(): LeaseID { - return { - $type: "akash.market.v1beta1.LeaseID", - owner: "", - dseq: Long.UZERO, - gseq: 0, - oseq: 0, - provider: "" - }; -} - -export const LeaseID = { - $type: "akash.market.v1beta1.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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseID { - return { - $type: LeaseID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromString(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: LeaseID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.v1beta1.Lease", - leaseId: undefined, - state: 0, - price: undefined, - createdAt: Long.ZERO - }; -} - -export const Lease = { - $type: "akash.market.v1beta1.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) { - Coin.encode(message.price, writer.uint32(26).fork()).ldelim(); - } - if (!message.createdAt.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Lease { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = Coin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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) ? Coin.fromJSON(object.price) : undefined, - createdAt: isSet(object.createdAt) ? Long.fromString(object.createdAt) : Long.ZERO - }; - }, - - toJSON(message: Lease): unknown { - const obj: any = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - message.state !== undefined && (obj.state = lease_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? Coin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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 ? Coin.fromPartial(object.price) : undefined; - message.createdAt = object.createdAt !== undefined && object.createdAt !== null ? Long.fromValue(object.createdAt) : Long.ZERO; - return message; - } -}; - -messageTypeRegistry.set(Lease.$type, Lease); - -function createBaseLeaseFilters(): LeaseFilters { - return { - $type: "akash.market.v1beta1.LeaseFilters", - owner: "", - dseq: Long.UZERO, - gseq: 0, - oseq: 0, - provider: "", - state: "" - }; -} - -export const LeaseFilters = { - $type: "akash.market.v1beta1.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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseFilters { - return { - $type: LeaseFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromString(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: LeaseFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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.v1beta1.MsgCreateLease", bidId: undefined }; -} - -export const MsgCreateLease = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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.v1beta1.MsgCreateLeaseResponse" }; -} - -export const MsgCreateLeaseResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateLeaseResponse { - return { - $type: MsgCreateLeaseResponse.$type - }; - }, - - toJSON(_: MsgCreateLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgCreateLeaseResponse { - const message = createBaseMsgCreateLeaseResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgCreateLeaseResponse.$type, MsgCreateLeaseResponse); - -function createBaseMsgWithdrawLease(): MsgWithdrawLease { - return { $type: "akash.market.v1beta1.MsgWithdrawLease", bidId: undefined }; -} - -export const MsgWithdrawLease = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.bidId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? LeaseID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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.v1beta1.MsgWithdrawLeaseResponse" }; -} - -export const MsgWithdrawLeaseResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgWithdrawLeaseResponse { - return { - $type: MsgWithdrawLeaseResponse.$type - }; - }, - - toJSON(_: MsgWithdrawLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial, I>>(_: I): MsgWithdrawLeaseResponse { - const message = createBaseMsgWithdrawLeaseResponse(); - return message; - } -}; - -messageTypeRegistry.set(MsgWithdrawLeaseResponse.$type, MsgWithdrawLeaseResponse); - -function createBaseMsgCloseLease(): MsgCloseLease { - return { $type: "akash.market.v1beta1.MsgCloseLease", leaseId: undefined }; -} - -export const MsgCloseLease = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - return obj; - }, - - 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.v1beta1.MsgCloseLeaseResponse" }; -} - -export const MsgCloseLeaseResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseLeaseResponse { - return { - $type: MsgCloseLeaseResponse.$type - }; - }, - - toJSON(_: MsgCloseLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta1/order.ts b/src/protobuf/akash/market/v1beta1/order.ts deleted file mode 100644 index b4eed28..0000000 --- a/src/protobuf/akash/market/v1beta1/order.ts +++ /dev/null @@ -1,383 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { GroupSpec } from "../../../akash/deployment/v1beta1/group"; - -export const protobufPackage = "akash.market.v1beta1"; - -/** OrderID stores owner and all other seq numbers */ -export interface OrderID { - $type: "akash.market.v1beta1.OrderID"; - owner: string; - dseq: Long; - gseq: number; - oseq: number; -} - -/** Order stores orderID, state of order and other details */ -export interface Order { - $type: "akash.market.v1beta1.Order"; - orderId?: OrderID; - state: Order_State; - spec?: GroupSpec; - 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"; - default: - return "UNKNOWN"; - } -} - -/** OrderFilters defines flags for order list filter */ -export interface OrderFilters { - $type: "akash.market.v1beta1.OrderFilters"; - owner: string; - dseq: Long; - gseq: number; - oseq: number; - state: string; -} - -function createBaseOrderID(): OrderID { - return { - $type: "akash.market.v1beta1.OrderID", - owner: "", - dseq: Long.UZERO, - gseq: 0, - oseq: 0 - }; -} - -export const OrderID = { - $type: "akash.market.v1beta1.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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderID { - return { - $type: OrderID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromString(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0 - }; - }, - - toJSON(message: OrderID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - return obj; - }, - - 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.v1beta1.Order", - orderId: undefined, - state: 0, - spec: undefined, - createdAt: Long.ZERO - }; -} - -export const Order = { - $type: "akash.market.v1beta1.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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Order { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.orderId = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.spec = GroupSpec.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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.fromString(object.createdAt) : Long.ZERO - }; - }, - - toJSON(message: Order): unknown { - const obj: any = {}; - message.orderId !== undefined && (obj.orderId = message.orderId ? OrderID.toJSON(message.orderId) : undefined); - message.state !== undefined && (obj.state = order_StateToJSON(message.state)); - message.spec !== undefined && (obj.spec = message.spec ? GroupSpec.toJSON(message.spec) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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.v1beta1.OrderFilters", - owner: "", - dseq: Long.UZERO, - gseq: 0, - oseq: 0, - state: "" - }; -} - -export const OrderFilters = { - $type: "akash.market.v1beta1.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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderFilters { - return { - $type: OrderFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromString(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: OrderFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta1/params.ts b/src/protobuf/akash/market/v1beta1/params.ts deleted file mode 100644 index 913ce27..0000000 --- a/src/protobuf/akash/market/v1beta1/params.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "akash.market.v1beta1"; - -/** Params is the params for the x/market module */ -export interface Params { - $type: "akash.market.v1beta1.Params"; - bidMinDeposit?: Coin; - orderMaxBids: number; -} - -function createBaseParams(): Params { - return { - $type: "akash.market.v1beta1.Params", - bidMinDeposit: undefined, - orderMaxBids: 0 - }; -} - -export const Params = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.bidMinDeposit = Coin.decode(reader, reader.uint32()); - break; - case 2: - message.orderMaxBids = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - bidMinDeposit: isSet(object.bidMinDeposit) ? Coin.fromJSON(object.bidMinDeposit) : undefined, - orderMaxBids: isSet(object.orderMaxBids) ? Number(object.orderMaxBids) : 0 - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.bidMinDeposit !== undefined && (obj.bidMinDeposit = message.bidMinDeposit ? Coin.toJSON(message.bidMinDeposit) : undefined); - message.orderMaxBids !== undefined && (obj.orderMaxBids = Math.round(message.orderMaxBids)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta1/query.ts b/src/protobuf/akash/market/v1beta1/query.ts deleted file mode 100644 index d1e6520..0000000 --- a/src/protobuf/akash/market/v1beta1/query.ts +++ /dev/null @@ -1,951 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { OrderFilters, OrderID, Order } from "../../../akash/market/v1beta1/order"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { BidFilters, BidID, Bid } from "../../../akash/market/v1beta1/bid"; -import { Account, Payment } from "../../../akash/escrow/v1beta1/types"; -import { LeaseFilters, LeaseID, Lease } from "../../../akash/market/v1beta1/lease"; - -export const protobufPackage = "akash.market.v1beta1"; - -/** QueryOrdersRequest is request type for the Query/Orders RPC method */ -export interface QueryOrdersRequest { - $type: "akash.market.v1beta1.QueryOrdersRequest"; - filters?: OrderFilters; - pagination?: PageRequest; -} - -/** QueryOrdersResponse is response type for the Query/Orders RPC method */ -export interface QueryOrdersResponse { - $type: "akash.market.v1beta1.QueryOrdersResponse"; - orders: Order[]; - pagination?: PageResponse; -} - -/** QueryOrderRequest is request type for the Query/Order RPC method */ -export interface QueryOrderRequest { - $type: "akash.market.v1beta1.QueryOrderRequest"; - id?: OrderID; -} - -/** QueryOrderResponse is response type for the Query/Order RPC method */ -export interface QueryOrderResponse { - $type: "akash.market.v1beta1.QueryOrderResponse"; - order?: Order; -} - -/** QueryBidsRequest is request type for the Query/Bids RPC method */ -export interface QueryBidsRequest { - $type: "akash.market.v1beta1.QueryBidsRequest"; - filters?: BidFilters; - pagination?: PageRequest; -} - -/** QueryBidsResponse is response type for the Query/Bids RPC method */ -export interface QueryBidsResponse { - $type: "akash.market.v1beta1.QueryBidsResponse"; - bids: QueryBidResponse[]; - pagination?: PageResponse; -} - -/** QueryBidRequest is request type for the Query/Bid RPC method */ -export interface QueryBidRequest { - $type: "akash.market.v1beta1.QueryBidRequest"; - id?: BidID; -} - -/** QueryBidResponse is response type for the Query/Bid RPC method */ -export interface QueryBidResponse { - $type: "akash.market.v1beta1.QueryBidResponse"; - bid?: Bid; - escrowAccount?: Account; -} - -/** QueryLeasesRequest is request type for the Query/Leases RPC method */ -export interface QueryLeasesRequest { - $type: "akash.market.v1beta1.QueryLeasesRequest"; - filters?: LeaseFilters; - pagination?: PageRequest; -} - -/** QueryLeasesResponse is response type for the Query/Leases RPC method */ -export interface QueryLeasesResponse { - $type: "akash.market.v1beta1.QueryLeasesResponse"; - leases: QueryLeaseResponse[]; - pagination?: PageResponse; -} - -/** QueryLeaseRequest is request type for the Query/Lease RPC method */ -export interface QueryLeaseRequest { - $type: "akash.market.v1beta1.QueryLeaseRequest"; - id?: LeaseID; -} - -/** QueryLeaseResponse is response type for the Query/Lease RPC method */ -export interface QueryLeaseResponse { - $type: "akash.market.v1beta1.QueryLeaseResponse"; - lease?: Lease; - escrowPayment?: Payment; -} - -function createBaseQueryOrdersRequest(): QueryOrdersRequest { - return { - $type: "akash.market.v1beta1.QueryOrdersRequest", - filters: undefined, - pagination: undefined - }; -} - -export const QueryOrdersRequest = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.filters = OrderFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? OrderFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryOrdersResponse", - orders: [], - pagination: undefined - }; -} - -export const QueryOrdersResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryOrdersResponse { - return { - $type: QueryOrdersResponse.$type, - orders: 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) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryOrderRequest", id: undefined }; -} - -export const QueryOrderRequest = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.id = OrderID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? OrderID.toJSON(message.id) : undefined); - return obj; - }, - - 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.v1beta1.QueryOrderResponse", order: undefined }; -} - -export const QueryOrderResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.order = Order.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.order !== undefined && (obj.order = message.order ? Order.toJSON(message.order) : undefined); - return obj; - }, - - 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.v1beta1.QueryBidsRequest", - filters: undefined, - pagination: undefined - }; -} - -export const QueryBidsRequest = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.filters = BidFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? BidFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryBidsResponse", - bids: [], - pagination: undefined - }; -} - -export const QueryBidsResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.bids.push(QueryBidResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryBidsResponse { - return { - $type: QueryBidsResponse.$type, - bids: 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) { - obj.bids = message.bids.map(e => (e ? QueryBidResponse.toJSON(e) : undefined)); - } else { - obj.bids = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryBidRequest", id: undefined }; -} - -export const QueryBidRequest = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.id = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? BidID.toJSON(message.id) : undefined); - return obj; - }, - - 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.v1beta1.QueryBidResponse", - bid: undefined, - escrowAccount: undefined - }; -} - -export const QueryBidResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.bid = Bid.decode(reader, reader.uint32()); - break; - case 2: - message.escrowAccount = Account.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bid !== undefined && (obj.bid = message.bid ? Bid.toJSON(message.bid) : undefined); - message.escrowAccount !== undefined && (obj.escrowAccount = message.escrowAccount ? Account.toJSON(message.escrowAccount) : undefined); - return obj; - }, - - 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.v1beta1.QueryLeasesRequest", - filters: undefined, - pagination: undefined - }; -} - -export const QueryLeasesRequest = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.filters = LeaseFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? LeaseFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryLeasesResponse", - leases: [], - pagination: undefined - }; -} - -export const QueryLeasesResponse = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.leases.push(QueryLeaseResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryLeasesResponse { - return { - $type: QueryLeasesResponse.$type, - leases: 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) { - obj.leases = message.leases.map(e => (e ? QueryLeaseResponse.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryLeaseRequest", id: undefined }; -} - -export const QueryLeaseRequest = { - $type: "akash.market.v1beta1.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 : new _m0.Reader(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: - message.id = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? LeaseID.toJSON(message.id) : undefined); - return obj; - }, - - 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.v1beta1.QueryLeaseResponse", - lease: undefined, - escrowPayment: undefined - }; -} - -export const QueryLeaseResponse = { - $type: "akash.market.v1beta1.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) { - Payment.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 : new _m0.Reader(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: - message.lease = Lease.decode(reader, reader.uint32()); - break; - case 2: - message.escrowPayment = Payment.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryLeaseResponse { - return { - $type: QueryLeaseResponse.$type, - lease: isSet(object.lease) ? Lease.fromJSON(object.lease) : undefined, - escrowPayment: isSet(object.escrowPayment) ? Payment.fromJSON(object.escrowPayment) : undefined - }; - }, - - toJSON(message: QueryLeaseResponse): unknown { - const obj: any = {}; - message.lease !== undefined && (obj.lease = message.lease ? Lease.toJSON(message.lease) : undefined); - message.escrowPayment !== undefined && (obj.escrowPayment = message.escrowPayment ? Payment.toJSON(message.escrowPayment) : undefined); - return obj; - }, - - 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 ? Payment.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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta1.Query", "Orders", data); - return promise.then(data => QueryOrdersResponse.decode(new _m0.Reader(data))); - } - - Order(request: QueryOrderRequest): Promise { - const data = QueryOrderRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Query", "Order", data); - return promise.then(data => QueryOrderResponse.decode(new _m0.Reader(data))); - } - - Bids(request: QueryBidsRequest): Promise { - const data = QueryBidsRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Query", "Bids", data); - return promise.then(data => QueryBidsResponse.decode(new _m0.Reader(data))); - } - - Bid(request: QueryBidRequest): Promise { - const data = QueryBidRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Query", "Bid", data); - return promise.then(data => QueryBidResponse.decode(new _m0.Reader(data))); - } - - Leases(request: QueryLeasesRequest): Promise { - const data = QueryLeasesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Query", "Leases", data); - return promise.then(data => QueryLeasesResponse.decode(new _m0.Reader(data))); - } - - Lease(request: QueryLeaseRequest): Promise { - const data = QueryLeaseRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Query", "Lease", data); - return promise.then(data => QueryLeaseResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta1/service.ts b/src/protobuf/akash/market/v1beta1/service.ts deleted file mode 100644 index fe2e161..0000000 --- a/src/protobuf/akash/market/v1beta1/service.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { MsgCreateBidResponse, MsgCloseBidResponse, MsgCreateBid, MsgCloseBid } from "../../../akash/market/v1beta1/bid"; -import { - MsgWithdrawLeaseResponse, - MsgCreateLeaseResponse, - MsgCloseLeaseResponse, - MsgWithdrawLease, - MsgCreateLease, - MsgCloseLease -} from "../../../akash/market/v1beta1/lease"; - -export const protobufPackage = "akash.market.v1beta1"; - -/** 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta1.Msg", "CreateBid", data); - return promise.then(data => MsgCreateBidResponse.decode(new _m0.Reader(data))); - } - - CloseBid(request: MsgCloseBid): Promise { - const data = MsgCloseBid.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Msg", "CloseBid", data); - return promise.then(data => MsgCloseBidResponse.decode(new _m0.Reader(data))); - } - - WithdrawLease(request: MsgWithdrawLease): Promise { - const data = MsgWithdrawLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Msg", "WithdrawLease", data); - return promise.then(data => MsgWithdrawLeaseResponse.decode(new _m0.Reader(data))); - } - - CreateLease(request: MsgCreateLease): Promise { - const data = MsgCreateLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Msg", "CreateLease", data); - return promise.then(data => MsgCreateLeaseResponse.decode(new _m0.Reader(data))); - } - - CloseLease(request: MsgCloseLease): Promise { - const data = MsgCloseLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta1.Msg", "CloseLease", data); - return promise.then(data => MsgCloseLeaseResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/market/v1beta2/bid.ts b/src/protobuf/akash/market/v1beta2/bid.ts deleted file mode 100644 index a6df004..0000000 --- a/src/protobuf/akash/market/v1beta2/bid.ts +++ /dev/null @@ -1,673 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { OrderID } from "./order"; -import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.order = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.provider = reader.string(); - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.deposit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateBid { - return { - $type: MsgCreateBid.$type, - order: isSet(object.order) ? OrderID.fromJSON(object.order) : undefined, - provider: isSet(object.provider) ? 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 = {}; - message.order !== undefined && (obj.order = message.order ? OrderID.toJSON(message.order) : undefined); - message.provider !== undefined && (obj.provider = message.provider); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.deposit !== undefined && (obj.deposit = message.deposit ? Coin.toJSON(message.deposit) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateBidResponse { - return { - $type: MsgCreateBidResponse.$type - }; - }, - - toJSON(_: MsgCreateBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseBidResponse { - return { - $type: MsgCloseBidResponse.$type - }; - }, - - toJSON(_: MsgCloseBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidID { - return { - $type: BidID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: BidID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Bid { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - message.state !== undefined && (obj.state = bid_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidFilters { - return { - $type: BidFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: BidFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta2/genesis.ts b/src/protobuf/akash/market/v1beta2/genesis.ts deleted file mode 100644 index f405789..0000000 --- a/src/protobuf/akash/market/v1beta2/genesis.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Order } from "./order"; -import { Lease } from "./lease"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 2: - message.leases.push(Lease.decode(reader, reader.uint32())); - break; - case 3: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - orders: Array.isArray(object?.orders) ? object.orders.map((e: any) => Order.fromJSON(e)) : [], - leases: 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) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - if (message.leases) { - obj.leases = message.leases.map(e => (e ? Lease.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta2/lease.ts b/src/protobuf/akash/market/v1beta2/lease.ts deleted file mode 100644 index e7e3b9c..0000000 --- a/src/protobuf/akash/market/v1beta2/lease.ts +++ /dev/null @@ -1,748 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; -import { BidID } from "./bid"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseID { - return { - $type: LeaseID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: LeaseID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - if (!message.closedOn.isZero()) { - writer.uint32(40).int64(message.closedOn); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Lease { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - case 5: - message.closedOn = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - message.state !== undefined && (obj.state = lease_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - message.closedOn !== undefined && (obj.closedOn = (message.closedOn || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseFilters { - return { - $type: LeaseFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: LeaseFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateLeaseResponse { - return { - $type: MsgCreateLeaseResponse.$type - }; - }, - - toJSON(_: MsgCreateLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? LeaseID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgWithdrawLeaseResponse { - return { - $type: MsgWithdrawLeaseResponse.$type - }; - }, - - toJSON(_: MsgWithdrawLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseLeaseResponse { - return { - $type: MsgCloseLeaseResponse.$type - }; - }, - - toJSON(_: MsgCloseLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta2/order.ts b/src/protobuf/akash/market/v1beta2/order.ts deleted file mode 100644 index b456d1a..0000000 --- a/src/protobuf/akash/market/v1beta2/order.ts +++ /dev/null @@ -1,384 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupSpec } from "../../deployment/v1beta2/groupspec"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderID { - return { - $type: OrderID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0 - }; - }, - - toJSON(message: OrderID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Order { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.orderId = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.spec = GroupSpec.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.orderId !== undefined && (obj.orderId = message.orderId ? OrderID.toJSON(message.orderId) : undefined); - message.state !== undefined && (obj.state = order_StateToJSON(message.state)); - message.spec !== undefined && (obj.spec = message.spec ? GroupSpec.toJSON(message.spec) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderFilters { - return { - $type: OrderFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: OrderFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta2/params.ts b/src/protobuf/akash/market/v1beta2/params.ts deleted file mode 100644 index c28c709..0000000 --- a/src/protobuf/akash/market/v1beta2/params.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.bidMinDeposit = Coin.decode(reader, reader.uint32()); - break; - case 2: - message.orderMaxBids = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - bidMinDeposit: isSet(object.bidMinDeposit) ? Coin.fromJSON(object.bidMinDeposit) : undefined, - orderMaxBids: isSet(object.orderMaxBids) ? Number(object.orderMaxBids) : 0 - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.bidMinDeposit !== undefined && (obj.bidMinDeposit = message.bidMinDeposit ? Coin.toJSON(message.bidMinDeposit) : undefined); - message.orderMaxBids !== undefined && (obj.orderMaxBids = Math.round(message.orderMaxBids)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta2/query.ts b/src/protobuf/akash/market/v1beta2/query.ts deleted file mode 100644 index 915fb37..0000000 --- a/src/protobuf/akash/market/v1beta2/query.ts +++ /dev/null @@ -1,952 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { OrderFilters, Order, OrderID } from "./order"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { BidFilters, BidID, Bid } from "./bid"; -import { Account, FractionalPayment } from "../../escrow/v1beta2/types"; -import { LeaseFilters, LeaseID, Lease } from "./lease"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.filters = OrderFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? OrderFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryOrdersResponse { - return { - $type: QueryOrdersResponse.$type, - orders: 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) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = OrderID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? OrderID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.order = Order.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.order !== undefined && (obj.order = message.order ? Order.toJSON(message.order) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filters = BidFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? BidFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bids.push(QueryBidResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryBidsResponse { - return { - $type: QueryBidsResponse.$type, - bids: 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) { - obj.bids = message.bids.map(e => (e ? QueryBidResponse.toJSON(e) : undefined)); - } else { - obj.bids = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? BidID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bid = Bid.decode(reader, reader.uint32()); - break; - case 2: - message.escrowAccount = Account.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bid !== undefined && (obj.bid = message.bid ? Bid.toJSON(message.bid) : undefined); - message.escrowAccount !== undefined && (obj.escrowAccount = message.escrowAccount ? Account.toJSON(message.escrowAccount) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filters = LeaseFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? LeaseFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.leases.push(QueryLeaseResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryLeasesResponse { - return { - $type: QueryLeasesResponse.$type, - leases: 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) { - obj.leases = message.leases.map(e => (e ? QueryLeaseResponse.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? LeaseID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.lease = Lease.decode(reader, reader.uint32()); - break; - case 2: - message.escrowPayment = FractionalPayment.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.lease !== undefined && (obj.lease = message.lease ? Lease.toJSON(message.lease) : undefined); - message.escrowPayment !== undefined && (obj.escrowPayment = message.escrowPayment ? FractionalPayment.toJSON(message.escrowPayment) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta2.Query", "Orders", data); - return promise.then(data => QueryOrdersResponse.decode(new _m0.Reader(data))); - } - - Order(request: QueryOrderRequest): Promise { - const data = QueryOrderRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Query", "Order", data); - return promise.then(data => QueryOrderResponse.decode(new _m0.Reader(data))); - } - - Bids(request: QueryBidsRequest): Promise { - const data = QueryBidsRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Query", "Bids", data); - return promise.then(data => QueryBidsResponse.decode(new _m0.Reader(data))); - } - - Bid(request: QueryBidRequest): Promise { - const data = QueryBidRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Query", "Bid", data); - return promise.then(data => QueryBidResponse.decode(new _m0.Reader(data))); - } - - Leases(request: QueryLeasesRequest): Promise { - const data = QueryLeasesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Query", "Leases", data); - return promise.then(data => QueryLeasesResponse.decode(new _m0.Reader(data))); - } - - Lease(request: QueryLeaseRequest): Promise { - const data = QueryLeaseRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Query", "Lease", data); - return promise.then(data => QueryLeaseResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta2/service.ts b/src/protobuf/akash/market/v1beta2/service.ts deleted file mode 100644 index 6cd2728..0000000 --- a/src/protobuf/akash/market/v1beta2/service.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* eslint-disable */ -import { MsgCreateBidResponse, MsgCloseBidResponse, MsgCreateBid, MsgCloseBid } from "./bid"; -import { MsgWithdrawLeaseResponse, MsgCreateLeaseResponse, MsgCloseLeaseResponse, MsgWithdrawLease, MsgCreateLease, MsgCloseLease } from "./lease"; -import * as _m0 from "protobufjs/minimal"; - -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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta2.Msg", "CreateBid", data); - return promise.then(data => MsgCreateBidResponse.decode(new _m0.Reader(data))); - } - - CloseBid(request: MsgCloseBid): Promise { - const data = MsgCloseBid.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Msg", "CloseBid", data); - return promise.then(data => MsgCloseBidResponse.decode(new _m0.Reader(data))); - } - - WithdrawLease(request: MsgWithdrawLease): Promise { - const data = MsgWithdrawLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Msg", "WithdrawLease", data); - return promise.then(data => MsgWithdrawLeaseResponse.decode(new _m0.Reader(data))); - } - - CreateLease(request: MsgCreateLease): Promise { - const data = MsgCreateLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Msg", "CreateLease", data); - return promise.then(data => MsgCreateLeaseResponse.decode(new _m0.Reader(data))); - } - - CloseLease(request: MsgCloseLease): Promise { - const data = MsgCloseLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta2.Msg", "CloseLease", data); - return promise.then(data => MsgCloseLeaseResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} diff --git a/src/protobuf/akash/market/v1beta3/bid.ts b/src/protobuf/akash/market/v1beta3/bid.ts deleted file mode 100644 index fed89cc..0000000 --- a/src/protobuf/akash/market/v1beta3/bid.ts +++ /dev/null @@ -1,673 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { OrderID } from "./order"; -import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.order = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.provider = reader.string(); - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.deposit = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateBid { - return { - $type: MsgCreateBid.$type, - order: isSet(object.order) ? OrderID.fromJSON(object.order) : undefined, - provider: isSet(object.provider) ? 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 = {}; - message.order !== undefined && (obj.order = message.order ? OrderID.toJSON(message.order) : undefined); - message.provider !== undefined && (obj.provider = message.provider); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.deposit !== undefined && (obj.deposit = message.deposit ? Coin.toJSON(message.deposit) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateBidResponse { - return { - $type: MsgCreateBidResponse.$type - }; - }, - - toJSON(_: MsgCreateBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseBidResponse { - return { - $type: MsgCloseBidResponse.$type - }; - }, - - toJSON(_: MsgCloseBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidID { - return { - $type: BidID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: BidID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Bid { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - message.state !== undefined && (obj.state = bid_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidFilters { - return { - $type: BidFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: BidFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta3/genesis.ts b/src/protobuf/akash/market/v1beta3/genesis.ts deleted file mode 100644 index 85ab088..0000000 --- a/src/protobuf/akash/market/v1beta3/genesis.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Params } from "./params"; -import { Order } from "./order"; -import { Lease } from "./lease"; -import { Bid } from "./bid"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 3: - message.leases.push(Lease.decode(reader, reader.uint32())); - break; - case 4: - message.bids.push(Bid.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, - orders: Array.isArray(object?.orders) ? object.orders.map((e: any) => Order.fromJSON(e)) : [], - leases: Array.isArray(object?.leases) ? object.leases.map((e: any) => Lease.fromJSON(e)) : [], - bids: Array.isArray(object?.bids) ? object.bids.map((e: any) => Bid.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.orders) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - if (message.leases) { - obj.leases = message.leases.map(e => (e ? Lease.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - if (message.bids) { - obj.bids = message.bids.map(e => (e ? Bid.toJSON(e) : undefined)); - } else { - obj.bids = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta3/lease.ts b/src/protobuf/akash/market/v1beta3/lease.ts deleted file mode 100644 index 3d23384..0000000 --- a/src/protobuf/akash/market/v1beta3/lease.ts +++ /dev/null @@ -1,748 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; -import { BidID } from "./bid"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseID { - return { - $type: LeaseID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: LeaseID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - if (!message.closedOn.isZero()) { - writer.uint32(40).int64(message.closedOn); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Lease { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - case 5: - message.closedOn = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - message.state !== undefined && (obj.state = lease_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - message.closedOn !== undefined && (obj.closedOn = (message.closedOn || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseFilters { - return { - $type: LeaseFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: LeaseFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateLeaseResponse { - return { - $type: MsgCreateLeaseResponse.$type - }; - }, - - toJSON(_: MsgCreateLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? LeaseID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgWithdrawLeaseResponse { - return { - $type: MsgWithdrawLeaseResponse.$type - }; - }, - - toJSON(_: MsgWithdrawLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseLeaseResponse { - return { - $type: MsgCloseLeaseResponse.$type - }; - }, - - toJSON(_: MsgCloseLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta3/order.ts b/src/protobuf/akash/market/v1beta3/order.ts deleted file mode 100644 index 1479674..0000000 --- a/src/protobuf/akash/market/v1beta3/order.ts +++ /dev/null @@ -1,384 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupSpec } from "../../deployment/v1beta3/groupspec"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderID { - return { - $type: OrderID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0 - }; - }, - - toJSON(message: OrderID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Order { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.orderId = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.spec = GroupSpec.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.orderId !== undefined && (obj.orderId = message.orderId ? OrderID.toJSON(message.orderId) : undefined); - message.state !== undefined && (obj.state = order_StateToJSON(message.state)); - message.spec !== undefined && (obj.spec = message.spec ? GroupSpec.toJSON(message.spec) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderFilters { - return { - $type: OrderFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: OrderFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta3/params.ts b/src/protobuf/akash/market/v1beta3/params.ts deleted file mode 100644 index 88bd574..0000000 --- a/src/protobuf/akash/market/v1beta3/params.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.bidMinDeposit = Coin.decode(reader, reader.uint32()); - break; - case 2: - message.orderMaxBids = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - bidMinDeposit: isSet(object.bidMinDeposit) ? Coin.fromJSON(object.bidMinDeposit) : undefined, - orderMaxBids: isSet(object.orderMaxBids) ? Number(object.orderMaxBids) : 0 - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.bidMinDeposit !== undefined && (obj.bidMinDeposit = message.bidMinDeposit ? Coin.toJSON(message.bidMinDeposit) : undefined); - message.orderMaxBids !== undefined && (obj.orderMaxBids = Math.round(message.orderMaxBids)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta3/query.ts b/src/protobuf/akash/market/v1beta3/query.ts deleted file mode 100644 index d71f967..0000000 --- a/src/protobuf/akash/market/v1beta3/query.ts +++ /dev/null @@ -1,952 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { OrderFilters, Order, OrderID } from "./order"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { BidFilters, BidID, Bid } from "./bid"; -import { Account, FractionalPayment } from "../../escrow/v1beta3/types"; -import { LeaseFilters, LeaseID, Lease } from "./lease"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.filters = OrderFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? OrderFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryOrdersResponse { - return { - $type: QueryOrdersResponse.$type, - orders: 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) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = OrderID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? OrderID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.order = Order.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.order !== undefined && (obj.order = message.order ? Order.toJSON(message.order) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filters = BidFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? BidFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bids.push(QueryBidResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryBidsResponse { - return { - $type: QueryBidsResponse.$type, - bids: 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) { - obj.bids = message.bids.map(e => (e ? QueryBidResponse.toJSON(e) : undefined)); - } else { - obj.bids = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? BidID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bid = Bid.decode(reader, reader.uint32()); - break; - case 2: - message.escrowAccount = Account.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bid !== undefined && (obj.bid = message.bid ? Bid.toJSON(message.bid) : undefined); - message.escrowAccount !== undefined && (obj.escrowAccount = message.escrowAccount ? Account.toJSON(message.escrowAccount) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filters = LeaseFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? LeaseFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.leases.push(QueryLeaseResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryLeasesResponse { - return { - $type: QueryLeasesResponse.$type, - leases: 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) { - obj.leases = message.leases.map(e => (e ? QueryLeaseResponse.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? LeaseID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.lease = Lease.decode(reader, reader.uint32()); - break; - case 2: - message.escrowPayment = FractionalPayment.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.lease !== undefined && (obj.lease = message.lease ? Lease.toJSON(message.lease) : undefined); - message.escrowPayment !== undefined && (obj.escrowPayment = message.escrowPayment ? FractionalPayment.toJSON(message.escrowPayment) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta3.Query", "Orders", data); - return promise.then(data => QueryOrdersResponse.decode(new _m0.Reader(data))); - } - - Order(request: QueryOrderRequest): Promise { - const data = QueryOrderRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Query", "Order", data); - return promise.then(data => QueryOrderResponse.decode(new _m0.Reader(data))); - } - - Bids(request: QueryBidsRequest): Promise { - const data = QueryBidsRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Query", "Bids", data); - return promise.then(data => QueryBidsResponse.decode(new _m0.Reader(data))); - } - - Bid(request: QueryBidRequest): Promise { - const data = QueryBidRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Query", "Bid", data); - return promise.then(data => QueryBidResponse.decode(new _m0.Reader(data))); - } - - Leases(request: QueryLeasesRequest): Promise { - const data = QueryLeasesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Query", "Leases", data); - return promise.then(data => QueryLeasesResponse.decode(new _m0.Reader(data))); - } - - Lease(request: QueryLeaseRequest): Promise { - const data = QueryLeaseRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Query", "Lease", data); - return promise.then(data => QueryLeaseResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta3/service.ts b/src/protobuf/akash/market/v1beta3/service.ts deleted file mode 100644 index 942d3bd..0000000 --- a/src/protobuf/akash/market/v1beta3/service.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* eslint-disable */ -import { MsgCreateBidResponse, MsgCloseBidResponse, MsgCreateBid, MsgCloseBid } from "./bid"; -import { MsgWithdrawLeaseResponse, MsgCreateLeaseResponse, MsgCloseLeaseResponse, MsgWithdrawLease, MsgCreateLease, MsgCloseLease } from "./lease"; -import * as _m0 from "protobufjs/minimal"; - -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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta3.Msg", "CreateBid", data); - return promise.then(data => MsgCreateBidResponse.decode(new _m0.Reader(data))); - } - - CloseBid(request: MsgCloseBid): Promise { - const data = MsgCloseBid.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Msg", "CloseBid", data); - return promise.then(data => MsgCloseBidResponse.decode(new _m0.Reader(data))); - } - - WithdrawLease(request: MsgWithdrawLease): Promise { - const data = MsgWithdrawLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Msg", "WithdrawLease", data); - return promise.then(data => MsgWithdrawLeaseResponse.decode(new _m0.Reader(data))); - } - - CreateLease(request: MsgCreateLease): Promise { - const data = MsgCreateLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Msg", "CreateLease", data); - return promise.then(data => MsgCreateLeaseResponse.decode(new _m0.Reader(data))); - } - - CloseLease(request: MsgCloseLease): Promise { - const data = MsgCloseLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta3.Msg", "CloseLease", data); - return promise.then(data => MsgCloseLeaseResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} diff --git a/src/protobuf/akash/market/v1beta4/bid.ts b/src/protobuf/akash/market/v1beta4/bid.ts deleted file mode 100644 index 9f30090..0000000 --- a/src/protobuf/akash/market/v1beta4/bid.ts +++ /dev/null @@ -1,781 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Resources } from "../../base/v1beta3/resources"; -import { OrderID } from "./order"; -import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.resources = Resources.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResourceOffer { - return { - $type: ResourceOffer.$type, - resources: isSet(object.resources) ? Resources.fromJSON(object.resources) : undefined, - count: isSet(object.count) ? Number(object.count) : 0 - }; - }, - - toJSON(message: ResourceOffer): unknown { - const obj: any = {}; - message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); - message.count !== undefined && (obj.count = Math.round(message.count)); - return obj; - }, - - 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 : new _m0.Reader(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: - message.order = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.provider = reader.string(); - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.deposit = Coin.decode(reader, reader.uint32()); - break; - case 5: - message.resourcesOffer.push(ResourceOffer.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateBid { - return { - $type: MsgCreateBid.$type, - order: isSet(object.order) ? OrderID.fromJSON(object.order) : undefined, - provider: isSet(object.provider) ? String(object.provider) : "", - price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, - deposit: isSet(object.deposit) ? Coin.fromJSON(object.deposit) : undefined, - resourcesOffer: Array.isArray(object?.resourcesOffer) ? object.resourcesOffer.map((e: any) => ResourceOffer.fromJSON(e)) : [] - }; - }, - - toJSON(message: MsgCreateBid): unknown { - const obj: any = {}; - message.order !== undefined && (obj.order = message.order ? OrderID.toJSON(message.order) : undefined); - message.provider !== undefined && (obj.provider = message.provider); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.deposit !== undefined && (obj.deposit = message.deposit ? Coin.toJSON(message.deposit) : undefined); - if (message.resourcesOffer) { - obj.resourcesOffer = message.resourcesOffer.map(e => (e ? ResourceOffer.toJSON(e) : undefined)); - } else { - obj.resourcesOffer = []; - } - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateBidResponse { - return { - $type: MsgCreateBidResponse.$type - }; - }, - - toJSON(_: MsgCreateBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseBidResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseBidResponse { - return { - $type: MsgCloseBidResponse.$type - }; - }, - - toJSON(_: MsgCloseBidResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidID { - return { - $type: BidID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: BidID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - case 5: - message.resourcesOffer.push(ResourceOffer.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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: Array.isArray(object?.resourcesOffer) ? object.resourcesOffer.map((e: any) => ResourceOffer.fromJSON(e)) : [] - }; - }, - - toJSON(message: Bid): unknown { - const obj: any = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - message.state !== undefined && (obj.state = bid_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - if (message.resourcesOffer) { - obj.resourcesOffer = message.resourcesOffer.map(e => (e ? ResourceOffer.toJSON(e) : undefined)); - } else { - obj.resourcesOffer = []; - } - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BidFilters { - return { - $type: BidFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: BidFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta4/genesis.ts b/src/protobuf/akash/market/v1beta4/genesis.ts deleted file mode 100644 index de2dc9f..0000000 --- a/src/protobuf/akash/market/v1beta4/genesis.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Params } from "./params"; -import { Order } from "./order"; -import { Lease } from "./lease"; -import { Bid } from "./bid"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 3: - message.leases.push(Lease.decode(reader, reader.uint32())); - break; - case 4: - message.bids.push(Bid.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, - orders: Array.isArray(object?.orders) ? object.orders.map((e: any) => Order.fromJSON(e)) : [], - leases: Array.isArray(object?.leases) ? object.leases.map((e: any) => Lease.fromJSON(e)) : [], - bids: Array.isArray(object?.bids) ? object.bids.map((e: any) => Bid.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.orders) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - if (message.leases) { - obj.leases = message.leases.map(e => (e ? Lease.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - if (message.bids) { - obj.bids = message.bids.map(e => (e ? Bid.toJSON(e) : undefined)); - } else { - obj.bids = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta4/lease.ts b/src/protobuf/akash/market/v1beta4/lease.ts deleted file mode 100644 index 1f7c531..0000000 --- a/src/protobuf/akash/market/v1beta4/lease.ts +++ /dev/null @@ -1,748 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; -import { BidID } from "./bid"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseID { - return { - $type: LeaseID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "" - }; - }, - - toJSON(message: LeaseID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - if (!message.closedOn.isZero()) { - writer.uint32(40).int64(message.closedOn); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Lease { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.price = DecCoin.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - case 5: - message.closedOn = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - message.state !== undefined && (obj.state = lease_StateToJSON(message.state)); - message.price !== undefined && (obj.price = message.price ? DecCoin.toJSON(message.price) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - message.closedOn !== undefined && (obj.closedOn = (message.closedOn || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.provider = reader.string(); - break; - case 6: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeaseFilters { - return { - $type: LeaseFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - provider: isSet(object.provider) ? String(object.provider) : "", - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: LeaseFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.provider !== undefined && (obj.provider = message.provider); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? BidID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateLeaseResponse { - return { - $type: MsgCreateLeaseResponse.$type - }; - }, - - toJSON(_: MsgCreateLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.bidId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bidId !== undefined && (obj.bidId = message.bidId ? LeaseID.toJSON(message.bidId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgWithdrawLeaseResponse { - return { - $type: MsgWithdrawLeaseResponse.$type - }; - }, - - toJSON(_: MsgWithdrawLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.leaseId = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.leaseId !== undefined && (obj.leaseId = message.leaseId ? LeaseID.toJSON(message.leaseId) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCloseLeaseResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCloseLeaseResponse { - return { - $type: MsgCloseLeaseResponse.$type - }; - }, - - toJSON(_: MsgCloseLeaseResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta4/order.ts b/src/protobuf/akash/market/v1beta4/order.ts deleted file mode 100644 index 0ce55fc..0000000 --- a/src/protobuf/akash/market/v1beta4/order.ts +++ /dev/null @@ -1,384 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { GroupSpec } from "../../deployment/v1beta3/groupspec"; -import * as _m0 from "protobufjs/minimal"; - -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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderID { - return { - $type: OrderID.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0 - }; - }, - - toJSON(message: OrderID): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - return obj; - }, - - 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.isZero()) { - writer.uint32(32).int64(message.createdAt); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Order { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.orderId = OrderID.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32() as any; - break; - case 3: - message.spec = GroupSpec.decode(reader, reader.uint32()); - break; - case 4: - message.createdAt = reader.int64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.orderId !== undefined && (obj.orderId = message.orderId ? OrderID.toJSON(message.orderId) : undefined); - message.state !== undefined && (obj.state = order_StateToJSON(message.state)); - message.spec !== undefined && (obj.spec = message.spec ? GroupSpec.toJSON(message.spec) : undefined); - message.createdAt !== undefined && (obj.createdAt = (message.createdAt || Long.ZERO).toString()); - return obj; - }, - - 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.isZero()) { - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.dseq = reader.uint64() as Long; - break; - case 3: - message.gseq = reader.uint32(); - break; - case 4: - message.oseq = reader.uint32(); - break; - case 5: - message.state = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OrderFilters { - return { - $type: OrderFilters.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - dseq: isSet(object.dseq) ? Long.fromValue(object.dseq) : Long.UZERO, - gseq: isSet(object.gseq) ? Number(object.gseq) : 0, - oseq: isSet(object.oseq) ? Number(object.oseq) : 0, - state: isSet(object.state) ? String(object.state) : "" - }; - }, - - toJSON(message: OrderFilters): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.dseq !== undefined && (obj.dseq = (message.dseq || Long.UZERO).toString()); - message.gseq !== undefined && (obj.gseq = Math.round(message.gseq)); - message.oseq !== undefined && (obj.oseq = Math.round(message.oseq)); - message.state !== undefined && (obj.state = message.state); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta4/params.ts b/src/protobuf/akash/market/v1beta4/params.ts deleted file mode 100644 index 2e88794..0000000 --- a/src/protobuf/akash/market/v1beta4/params.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.bidMinDeposit = Coin.decode(reader, reader.uint32()); - break; - case 2: - message.orderMaxBids = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - bidMinDeposit: isSet(object.bidMinDeposit) ? Coin.fromJSON(object.bidMinDeposit) : undefined, - orderMaxBids: isSet(object.orderMaxBids) ? Number(object.orderMaxBids) : 0 - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.bidMinDeposit !== undefined && (obj.bidMinDeposit = message.bidMinDeposit ? Coin.toJSON(message.bidMinDeposit) : undefined); - message.orderMaxBids !== undefined && (obj.orderMaxBids = Math.round(message.orderMaxBids)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta4/query.ts b/src/protobuf/akash/market/v1beta4/query.ts deleted file mode 100644 index a6213a0..0000000 --- a/src/protobuf/akash/market/v1beta4/query.ts +++ /dev/null @@ -1,952 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { OrderFilters, Order, OrderID } from "./order"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { BidFilters, BidID, Bid } from "./bid"; -import { Account, FractionalPayment } from "../../escrow/v1beta3/types"; -import { LeaseFilters, LeaseID, Lease } from "./lease"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.filters = OrderFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? OrderFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.orders.push(Order.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryOrdersResponse { - return { - $type: QueryOrdersResponse.$type, - orders: 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) { - obj.orders = message.orders.map(e => (e ? Order.toJSON(e) : undefined)); - } else { - obj.orders = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = OrderID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? OrderID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.order = Order.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.order !== undefined && (obj.order = message.order ? Order.toJSON(message.order) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filters = BidFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? BidFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bids.push(QueryBidResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryBidsResponse { - return { - $type: QueryBidsResponse.$type, - bids: 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) { - obj.bids = message.bids.map(e => (e ? QueryBidResponse.toJSON(e) : undefined)); - } else { - obj.bids = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = BidID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? BidID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.bid = Bid.decode(reader, reader.uint32()); - break; - case 2: - message.escrowAccount = Account.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.bid !== undefined && (obj.bid = message.bid ? Bid.toJSON(message.bid) : undefined); - message.escrowAccount !== undefined && (obj.escrowAccount = message.escrowAccount ? Account.toJSON(message.escrowAccount) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.filters = LeaseFilters.decode(reader, reader.uint32()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.filters !== undefined && (obj.filters = message.filters ? LeaseFilters.toJSON(message.filters) : undefined); - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.leases.push(QueryLeaseResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryLeasesResponse { - return { - $type: QueryLeasesResponse.$type, - leases: 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) { - obj.leases = message.leases.map(e => (e ? QueryLeaseResponse.toJSON(e) : undefined)); - } else { - obj.leases = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.id = LeaseID.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.id !== undefined && (obj.id = message.id ? LeaseID.toJSON(message.id) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.lease = Lease.decode(reader, reader.uint32()); - break; - case 2: - message.escrowPayment = FractionalPayment.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.lease !== undefined && (obj.lease = message.lease ? Lease.toJSON(message.lease) : undefined); - message.escrowPayment !== undefined && (obj.escrowPayment = message.escrowPayment ? FractionalPayment.toJSON(message.escrowPayment) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta4.Query", "Orders", data); - return promise.then(data => QueryOrdersResponse.decode(new _m0.Reader(data))); - } - - Order(request: QueryOrderRequest): Promise { - const data = QueryOrderRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Query", "Order", data); - return promise.then(data => QueryOrderResponse.decode(new _m0.Reader(data))); - } - - Bids(request: QueryBidsRequest): Promise { - const data = QueryBidsRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Query", "Bids", data); - return promise.then(data => QueryBidsResponse.decode(new _m0.Reader(data))); - } - - Bid(request: QueryBidRequest): Promise { - const data = QueryBidRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Query", "Bid", data); - return promise.then(data => QueryBidResponse.decode(new _m0.Reader(data))); - } - - Leases(request: QueryLeasesRequest): Promise { - const data = QueryLeasesRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Query", "Leases", data); - return promise.then(data => QueryLeasesResponse.decode(new _m0.Reader(data))); - } - - Lease(request: QueryLeaseRequest): Promise { - const data = QueryLeaseRequest.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Query", "Lease", data); - return promise.then(data => QueryLeaseResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/market/v1beta4/service.ts b/src/protobuf/akash/market/v1beta4/service.ts deleted file mode 100644 index fb4f4b5..0000000 --- a/src/protobuf/akash/market/v1beta4/service.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* eslint-disable */ -import { MsgCreateBidResponse, MsgCloseBidResponse, MsgCreateBid, MsgCloseBid } from "./bid"; -import { MsgWithdrawLeaseResponse, MsgCreateLeaseResponse, MsgCloseLeaseResponse, MsgWithdrawLease, MsgCreateLease, MsgCloseLease } from "./lease"; -import * as _m0 from "protobufjs/minimal"; - -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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.market.v1beta4.Msg", "CreateBid", data); - return promise.then(data => MsgCreateBidResponse.decode(new _m0.Reader(data))); - } - - CloseBid(request: MsgCloseBid): Promise { - const data = MsgCloseBid.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Msg", "CloseBid", data); - return promise.then(data => MsgCloseBidResponse.decode(new _m0.Reader(data))); - } - - WithdrawLease(request: MsgWithdrawLease): Promise { - const data = MsgWithdrawLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Msg", "WithdrawLease", data); - return promise.then(data => MsgWithdrawLeaseResponse.decode(new _m0.Reader(data))); - } - - CreateLease(request: MsgCreateLease): Promise { - const data = MsgCreateLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Msg", "CreateLease", data); - return promise.then(data => MsgCreateLeaseResponse.decode(new _m0.Reader(data))); - } - - CloseLease(request: MsgCloseLease): Promise { - const data = MsgCloseLease.encode(request).finish(); - const promise = this.rpc.request("akash.market.v1beta4.Msg", "CloseLease", data); - return promise.then(data => MsgCloseLeaseResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} diff --git a/src/protobuf/akash/provider/v1beta1/genesis.ts b/src/protobuf/akash/provider/v1beta1/genesis.ts deleted file mode 100644 index 2cd12e9..0000000 --- a/src/protobuf/akash/provider/v1beta1/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Provider } from "../../../akash/provider/v1beta1/provider"; - -export const protobufPackage = "akash.provider.v1beta1"; - -/** GenesisState defines the basic genesis state used by provider module */ -export interface GenesisState { - $type: "akash.provider.v1beta1.GenesisState"; - providers: Provider[]; -} - -function createBaseGenesisState(): GenesisState { - return { $type: "akash.provider.v1beta1.GenesisState", providers: [] }; -} - -export const GenesisState = { - $type: "akash.provider.v1beta1.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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - providers: Array.isArray(object?.providers) ? object.providers.map((e: any) => Provider.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.providers) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/provider/v1beta1/provider.ts b/src/protobuf/akash/provider/v1beta1/provider.ts deleted file mode 100644 index 30232e1..0000000 --- a/src/protobuf/akash/provider/v1beta1/provider.ts +++ /dev/null @@ -1,660 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Attribute } from "../../base/v1beta1/attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.email = reader.string(); - break; - case 2: - message.website = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProviderInfo { - return { - $type: ProviderInfo.$type, - email: isSet(object.email) ? String(object.email) : "", - website: isSet(object.website) ? String(object.website) : "" - }; - }, - - toJSON(message: ProviderInfo): unknown { - const obj: any = {}; - message.email !== undefined && (obj.email = message.email); - message.website !== undefined && (obj.website = message.website); - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateProvider { - return { - $type: MsgCreateProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateProviderResponse { - return { - $type: MsgCreateProviderResponse.$type - }; - }, - - toJSON(_: MsgCreateProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUpdateProvider { - return { - $type: MsgUpdateProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateProviderResponse { - return { - $type: MsgUpdateProviderResponse.$type - }; - }, - - toJSON(_: MsgUpdateProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteProvider { - return { - $type: MsgDeleteProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: MsgDeleteProvider): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDeleteProviderResponse { - return { - $type: MsgDeleteProviderResponse.$type - }; - }, - - toJSON(_: MsgDeleteProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Provider { - return { - $type: Provider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.provider.v1beta1.Msg", "CreateProvider", data); - return promise.then(data => MsgCreateProviderResponse.decode(new _m0.Reader(data))); - } - - UpdateProvider(request: MsgUpdateProvider): Promise { - const data = MsgUpdateProvider.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta1.Msg", "UpdateProvider", data); - return promise.then(data => MsgUpdateProviderResponse.decode(new _m0.Reader(data))); - } - - DeleteProvider(request: MsgDeleteProvider): Promise { - const data = MsgDeleteProvider.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta1.Msg", "DeleteProvider", data); - return promise.then(data => MsgDeleteProviderResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/provider/v1beta1/query.ts b/src/protobuf/akash/provider/v1beta1/query.ts deleted file mode 100644 index 5981395..0000000 --- a/src/protobuf/akash/provider/v1beta1/query.ts +++ /dev/null @@ -1,332 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Provider } from "../../../akash/provider/v1beta1/provider"; - -export const protobufPackage = "akash.provider.v1beta1"; - -/** QueryProvidersRequest is request type for the Query/Providers RPC method */ -export interface QueryProvidersRequest { - $type: "akash.provider.v1beta1.QueryProvidersRequest"; - pagination?: PageRequest; -} - -/** QueryProvidersResponse is response type for the Query/Providers RPC method */ -export interface QueryProvidersResponse { - $type: "akash.provider.v1beta1.QueryProvidersResponse"; - providers: Provider[]; - pagination?: PageResponse; -} - -/** QueryProviderRequest is request type for the Query/Provider RPC method */ -export interface QueryProviderRequest { - $type: "akash.provider.v1beta1.QueryProviderRequest"; - owner: string; -} - -/** QueryProviderResponse is response type for the Query/Provider RPC method */ -export interface QueryProviderResponse { - $type: "akash.provider.v1beta1.QueryProviderResponse"; - provider?: Provider; -} - -function createBaseQueryProvidersRequest(): QueryProvidersRequest { - return { - $type: "akash.provider.v1beta1.QueryProvidersRequest", - pagination: undefined - }; -} - -export const QueryProvidersRequest = { - $type: "akash.provider.v1beta1.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 : new _m0.Reader(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: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryProvidersResponse", - providers: [], - pagination: undefined - }; -} - -export const QueryProvidersResponse = { - $type: "akash.provider.v1beta1.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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProvidersResponse { - return { - $type: QueryProvidersResponse.$type, - providers: 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) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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.v1beta1.QueryProviderRequest", owner: "" }; -} - -export const QueryProviderRequest = { - $type: "akash.provider.v1beta1.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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderRequest { - return { - $type: QueryProviderRequest.$type, - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderRequest): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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.v1beta1.QueryProviderResponse", - provider: undefined - }; -} - -export const QueryProviderResponse = { - $type: "akash.provider.v1beta1.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 : new _m0.Reader(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: - message.provider = Provider.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.provider !== undefined && (obj.provider = message.provider ? Provider.toJSON(message.provider) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.provider.v1beta1.Query", "Providers", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - Provider(request: QueryProviderRequest): Promise { - const data = QueryProviderRequest.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta1.Query", "Provider", data); - return promise.then(data => QueryProviderResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/provider/v1beta2/genesis.ts b/src/protobuf/akash/provider/v1beta2/genesis.ts deleted file mode 100644 index b1779a4..0000000 --- a/src/protobuf/akash/provider/v1beta2/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Provider } from "./provider"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - providers: Array.isArray(object?.providers) ? object.providers.map((e: any) => Provider.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.providers) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/provider/v1beta2/provider.ts b/src/protobuf/akash/provider/v1beta2/provider.ts deleted file mode 100644 index 592e33f..0000000 --- a/src/protobuf/akash/provider/v1beta2/provider.ts +++ /dev/null @@ -1,660 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Attribute } from "../../base/v1beta2/attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.email = reader.string(); - break; - case 2: - message.website = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProviderInfo { - return { - $type: ProviderInfo.$type, - email: isSet(object.email) ? String(object.email) : "", - website: isSet(object.website) ? String(object.website) : "" - }; - }, - - toJSON(message: ProviderInfo): unknown { - const obj: any = {}; - message.email !== undefined && (obj.email = message.email); - message.website !== undefined && (obj.website = message.website); - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateProvider { - return { - $type: MsgCreateProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateProviderResponse { - return { - $type: MsgCreateProviderResponse.$type - }; - }, - - toJSON(_: MsgCreateProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUpdateProvider { - return { - $type: MsgUpdateProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateProviderResponse { - return { - $type: MsgUpdateProviderResponse.$type - }; - }, - - toJSON(_: MsgUpdateProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteProvider { - return { - $type: MsgDeleteProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: MsgDeleteProvider): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDeleteProviderResponse { - return { - $type: MsgDeleteProviderResponse.$type - }; - }, - - toJSON(_: MsgDeleteProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Provider { - return { - $type: Provider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.provider.v1beta2.Msg", "CreateProvider", data); - return promise.then(data => MsgCreateProviderResponse.decode(new _m0.Reader(data))); - } - - UpdateProvider(request: MsgUpdateProvider): Promise { - const data = MsgUpdateProvider.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta2.Msg", "UpdateProvider", data); - return promise.then(data => MsgUpdateProviderResponse.decode(new _m0.Reader(data))); - } - - DeleteProvider(request: MsgDeleteProvider): Promise { - const data = MsgDeleteProvider.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta2.Msg", "DeleteProvider", data); - return promise.then(data => MsgDeleteProviderResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/provider/v1beta2/query.ts b/src/protobuf/akash/provider/v1beta2/query.ts deleted file mode 100644 index 6984847..0000000 --- a/src/protobuf/akash/provider/v1beta2/query.ts +++ /dev/null @@ -1,332 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Provider } from "./provider"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProvidersResponse { - return { - $type: QueryProvidersResponse.$type, - providers: 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) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderRequest { - return { - $type: QueryProviderRequest.$type, - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderRequest): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(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: - message.provider = Provider.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.provider !== undefined && (obj.provider = message.provider ? Provider.toJSON(message.provider) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.provider.v1beta2.Query", "Providers", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - Provider(request: QueryProviderRequest): Promise { - const data = QueryProviderRequest.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta2.Query", "Provider", data); - return promise.then(data => QueryProviderResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/provider/v1beta3/genesis.ts b/src/protobuf/akash/provider/v1beta3/genesis.ts deleted file mode 100644 index f11b227..0000000 --- a/src/protobuf/akash/provider/v1beta3/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Provider } from "./provider"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - return { - $type: GenesisState.$type, - providers: Array.isArray(object?.providers) ? object.providers.map((e: any) => Provider.fromJSON(e)) : [] - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.providers) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - return obj; - }, - - 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 Array - ? 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 } & Record | "$type">, never>; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/src/protobuf/akash/provider/v1beta3/provider.ts b/src/protobuf/akash/provider/v1beta3/provider.ts deleted file mode 100644 index 1a15719..0000000 --- a/src/protobuf/akash/provider/v1beta3/provider.ts +++ /dev/null @@ -1,660 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Attribute } from "../../base/v1beta3/attribute"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.email = reader.string(); - break; - case 2: - message.website = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProviderInfo { - return { - $type: ProviderInfo.$type, - email: isSet(object.email) ? String(object.email) : "", - website: isSet(object.website) ? String(object.website) : "" - }; - }, - - toJSON(message: ProviderInfo): unknown { - const obj: any = {}; - message.email !== undefined && (obj.email = message.email); - message.website !== undefined && (obj.website = message.website); - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateProvider { - return { - $type: MsgCreateProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateProviderResponse { - return { - $type: MsgCreateProviderResponse.$type - }; - }, - - toJSON(_: MsgCreateProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUpdateProvider { - return { - $type: MsgUpdateProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateProviderResponse { - return { - $type: MsgUpdateProviderResponse.$type - }; - }, - - toJSON(_: MsgUpdateProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteProvider { - return { - $type: MsgDeleteProvider.$type, - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: MsgDeleteProvider): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteProviderResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDeleteProviderResponse { - return { - $type: MsgDeleteProviderResponse.$type - }; - }, - - toJSON(_: MsgDeleteProviderResponse): unknown { - const obj: any = {}; - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - case 2: - message.hostUri = reader.string(); - break; - case 3: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - case 4: - message.info = ProviderInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Provider { - return { - $type: Provider.$type, - owner: isSet(object.owner) ? String(object.owner) : "", - hostUri: isSet(object.hostUri) ? String(object.hostUri) : "", - attributes: 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 = {}; - message.owner !== undefined && (obj.owner = message.owner); - message.hostUri !== undefined && (obj.hostUri = message.hostUri); - if (message.attributes) { - obj.attributes = message.attributes.map(e => (e ? Attribute.toJSON(e) : undefined)); - } else { - obj.attributes = []; - } - message.info !== undefined && (obj.info = message.info ? ProviderInfo.toJSON(message.info) : undefined); - return obj; - }, - - 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 class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.provider.v1beta3.Msg", "CreateProvider", data); - return promise.then(data => MsgCreateProviderResponse.decode(new _m0.Reader(data))); - } - - UpdateProvider(request: MsgUpdateProvider): Promise { - const data = MsgUpdateProvider.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta3.Msg", "UpdateProvider", data); - return promise.then(data => MsgUpdateProviderResponse.decode(new _m0.Reader(data))); - } - - DeleteProvider(request: MsgDeleteProvider): Promise { - const data = MsgDeleteProvider.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta3.Msg", "DeleteProvider", data); - return promise.then(data => MsgDeleteProviderResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/provider/v1beta3/query.ts b/src/protobuf/akash/provider/v1beta3/query.ts deleted file mode 100644 index 3630d3b..0000000 --- a/src/protobuf/akash/provider/v1beta3/query.ts +++ /dev/null @@ -1,332 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Provider } from "./provider"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.providers.push(Provider.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProvidersResponse { - return { - $type: QueryProvidersResponse.$type, - providers: 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) { - obj.providers = message.providers.map(e => (e ? Provider.toJSON(e) : undefined)); - } else { - obj.providers = []; - } - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - 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 : new _m0.Reader(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: - message.owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProviderRequest { - return { - $type: QueryProviderRequest.$type, - owner: isSet(object.owner) ? String(object.owner) : "" - }; - }, - - toJSON(message: QueryProviderRequest): unknown { - const obj: any = {}; - message.owner !== undefined && (obj.owner = message.owner); - return obj; - }, - - 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 : new _m0.Reader(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: - message.provider = Provider.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.provider !== undefined && (obj.provider = message.provider ? Provider.toJSON(message.provider) : undefined); - return obj; - }, - - 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 class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - 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("akash.provider.v1beta3.Query", "Providers", data); - return promise.then(data => QueryProvidersResponse.decode(new _m0.Reader(data))); - } - - Provider(request: QueryProviderRequest): Promise { - const data = QueryProviderRequest.encode(request).finish(); - const promise = this.rpc.request("akash.provider.v1beta3.Query", "Provider", data); - return promise.then(data => QueryProviderResponse.decode(new _m0.Reader(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 Array - ? 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 } & Record | "$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/src/protobuf/akash/staking/v1beta3/genesis.ts b/src/protobuf/akash/staking/v1beta3/genesis.ts deleted file mode 100644 index 867eb28..0000000 --- a/src/protobuf/akash/staking/v1beta3/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/staking/v1beta3/params.ts b/src/protobuf/akash/staking/v1beta3/params.ts deleted file mode 100644 index d7034bb..0000000 --- a/src/protobuf/akash/staking/v1beta3/params.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.minCommissionRate = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - minCommissionRate: isSet(object.minCommissionRate) ? String(object.minCommissionRate) : "" - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.minCommissionRate !== undefined && (obj.minCommissionRate = message.minCommissionRate); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/take/v1beta3/genesis.ts b/src/protobuf/akash/take/v1beta3/genesis.ts deleted file mode 100644 index 67404da..0000000 --- a/src/protobuf/akash/take/v1beta3/genesis.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import { Params } from "./params"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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 = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/take/v1beta3/params.ts b/src/protobuf/akash/take/v1beta3/params.ts deleted file mode 100644 index f129c2c..0000000 --- a/src/protobuf/akash/take/v1beta3/params.ts +++ /dev/null @@ -1,183 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.denom = reader.string(); - break; - case 2: - message.rate = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DenomTakeRate { - return { - $type: DenomTakeRate.$type, - denom: isSet(object.denom) ? String(object.denom) : "", - rate: isSet(object.rate) ? Number(object.rate) : 0 - }; - }, - - toJSON(message: DenomTakeRate): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.rate !== undefined && (obj.rate = Math.round(message.rate)); - return obj; - }, - - 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 : new _m0.Reader(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: - message.denomTakeRates.push(DenomTakeRate.decode(reader, reader.uint32())); - break; - case 2: - message.defaultTakeRate = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - return { - $type: Params.$type, - denomTakeRates: Array.isArray(object?.denomTakeRates) ? object.denomTakeRates.map((e: any) => DenomTakeRate.fromJSON(e)) : [], - defaultTakeRate: isSet(object.defaultTakeRate) ? Number(object.defaultTakeRate) : 0 - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.denomTakeRates) { - obj.denomTakeRates = message.denomTakeRates.map(e => (e ? DenomTakeRate.toJSON(e) : undefined)); - } else { - obj.denomTakeRates = []; - } - message.defaultTakeRate !== undefined && (obj.defaultTakeRate = Math.round(message.defaultTakeRate)); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/akash/take/v1beta3/query.ts b/src/protobuf/akash/take/v1beta3/query.ts deleted file mode 100644 index fa1aa07..0000000 --- a/src/protobuf/akash/take/v1beta3/query.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "akash.take.v1beta3"; - -/** Query defines the gRPC querier service */ -export interface Query {} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} diff --git a/src/protobuf/cosmos/base/query/v1beta1/pagination.ts b/src/protobuf/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 2fa5dde..0000000 --- a/src/protobuf/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,294 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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(), - 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.isZero()) { - writer.uint32(16).uint64(message.offset); - } - if (!message.limit.isZero()) { - writer.uint32(24).uint64(message.limit); - } - if (message.countTotal === true) { - writer.uint32(32).bool(message.countTotal); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.key = reader.bytes(); - break; - case 2: - message.offset = reader.uint64() as Long; - break; - case 3: - message.limit = reader.uint64() as Long; - break; - case 4: - message.countTotal = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - return { - $type: PageRequest.$type, - key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), - offset: isSet(object.offset) ? Long.fromValue(object.offset) : Long.UZERO, - limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO, - countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false, - reverse: isSet(object.reverse) ? Boolean(object.reverse) : false - }; - }, - - toJSON(message: PageRequest): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); - message.countTotal !== undefined && (obj.countTotal = message.countTotal); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial, I>>(object: I): PageRequest { - const message = createBasePageRequest(); - message.key = object.key ?? new Uint8Array(); - 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(), - 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.isZero()) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.nextKey = reader.bytes(); - break; - case 2: - message.total = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - return { - $type: PageResponse.$type, - nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), - total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO - }; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.nextKey !== undefined && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); - message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): PageResponse { - const message = createBasePageResponse(); - message.nextKey = object.nextKey ?? new Uint8Array(); - message.total = object.total !== undefined && object.total !== null ? Long.fromValue(object.total) : Long.UZERO; - return message; - } -}; - -messageTypeRegistry.set(PageResponse.$type, PageResponse); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/cosmos/base/v1beta1/coin.ts b/src/protobuf/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ec33641..0000000 --- a/src/protobuf/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,304 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 : new _m0.Reader(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: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Coin { - return { - $type: Coin.$type, - denom: isSet(object.denom) ? String(object.denom) : "", - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - 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.padEnd(23, "0")); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.denom = reader.string(); - break; - case 2: - message.amount = (parseInt(reader.string()) / 10 ** 18).toPrecision(18); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DecCoin { - return { - $type: DecCoin.$type, - denom: isSet(object.denom) ? String(object.denom) : "", - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - 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 : new _m0.Reader(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: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IntProto { - return { - $type: IntProto.$type, - int: isSet(object.int) ? String(object.int) : "" - }; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - 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 : new _m0.Reader(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: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DecProto { - return { - $type: DecProto.$type, - dec: isSet(object.dec) ? String(object.dec) : "" - }; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/cosmos_proto/cosmos.ts b/src/protobuf/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a1..0000000 --- a/src/protobuf/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/src/protobuf/gogoproto/gogo.ts b/src/protobuf/gogoproto/gogo.ts deleted file mode 100644 index 3f41a04..0000000 --- a/src/protobuf/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/src/protobuf/google/api/annotations.ts b/src/protobuf/google/api/annotations.ts deleted file mode 100644 index aace478..0000000 --- a/src/protobuf/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/src/protobuf/google/api/http.ts b/src/protobuf/google/api/http.ts deleted file mode 100644 index a6e1d89..0000000 --- a/src/protobuf/google/api/http.ts +++ /dev/null @@ -1,617 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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 === true) { - writer.uint32(16).bool(message.fullyDecodeReservedExpansion); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Http { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.rules.push(HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - return { - $type: Http.$type, - rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromJSON(e)) : [], - fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion) ? Boolean(object.fullyDecodeReservedExpansion) : false - }; - }, - - toJSON(message: Http): unknown { - const obj: any = {}; - if (message.rules) { - obj.rules = message.rules.map(e => (e ? HttpRule.toJSON(e) : undefined)); - } else { - obj.rules = []; - } - message.fullyDecodeReservedExpansion !== undefined && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); - return obj; - }, - - 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 : new _m0.Reader(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: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message.delete = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - return { - $type: HttpRule.$type, - selector: isSet(object.selector) ? String(object.selector) : "", - get: isSet(object.get) ? String(object.get) : undefined, - put: isSet(object.put) ? String(object.put) : undefined, - post: isSet(object.post) ? String(object.post) : undefined, - delete: isSet(object.delete) ? String(object.delete) : undefined, - patch: isSet(object.patch) ? String(object.patch) : undefined, - custom: isSet(object.custom) ? CustomHttpPattern.fromJSON(object.custom) : undefined, - body: isSet(object.body) ? String(object.body) : "", - responseBody: isSet(object.responseBody) ? String(object.responseBody) : "", - additionalBindings: Array.isArray(object?.additionalBindings) ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e)) : [] - }; - }, - - toJSON(message: HttpRule): unknown { - const obj: any = {}; - message.selector !== undefined && (obj.selector = message.selector); - message.get !== undefined && (obj.get = message.get); - message.put !== undefined && (obj.put = message.put); - message.post !== undefined && (obj.post = message.post); - message.delete !== undefined && (obj.delete = message.delete); - message.patch !== undefined && (obj.patch = message.patch); - message.custom !== undefined && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); - message.body !== undefined && (obj.body = message.body); - message.responseBody !== undefined && (obj.responseBody = message.responseBody); - if (message.additionalBindings) { - obj.additionalBindings = message.additionalBindings.map(e => (e ? HttpRule.toJSON(e) : undefined)); - } else { - obj.additionalBindings = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CustomHttpPattern { - return { - $type: CustomHttpPattern.$type, - kind: isSet(object.kind) ? String(object.kind) : "", - path: isSet(object.path) ? String(object.path) : "" - }; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - 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 Array - ? 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 } & Record | "$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/src/protobuf/google/protobuf/any.ts b/src/protobuf/google/protobuf/any.ts deleted file mode 100644 index 8d80147..0000000 --- a/src/protobuf/google/protobuf/any.ts +++ /dev/null @@ -1,244 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * JSON - * ==== - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message [google.protobuf.Duration][]): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - */ -export interface Any { - $type: "google.protobuf.Any"; - /** - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a [google.protobuf.Type][] - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - */ - typeUrl: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -function createBaseAny(): Any { - return { $type: "google.protobuf.Any", typeUrl: "", value: new Uint8Array() }; -} - -export const Any = { - $type: "google.protobuf.Any" as const, - - encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.typeUrl !== "") { - writer.uint32(10).string(message.typeUrl); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Any { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAny(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.typeUrl = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - return { - $type: Any.$type, - typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", - value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array() - }; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); - message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): Any { - const message = createBaseAny(); - message.typeUrl = object.typeUrl ?? ""; - message.value = object.value ?? new Uint8Array(); - return message; - } -}; - -messageTypeRegistry.set(Any.$type, Any); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/google/protobuf/descriptor.ts b/src/protobuf/google/protobuf/descriptor.ts deleted file mode 100644 index 0283b35..0000000 --- a/src/protobuf/google/protobuf/descriptor.ts +++ /dev/null @@ -1,3902 +0,0 @@ -/* eslint-disable */ -import { messageTypeRegistry } from "../../typeRegistry"; -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - -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; - /** e.g. "foo", "foo.bar", etc. */ - package: string; - /** 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; -} - -/** Describes a message type. */ -export interface DescriptorProto { - $type: "google.protobuf.DescriptorProto"; - name: string; - 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; - /** Exclusive. */ - end: number; - 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; - /** Exclusive. */ - end: number; -} - -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; - number: number; - label: FieldDescriptorProto_Label; - /** - * 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; - /** - * 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; - /** - * For extensions, this is the name of the type being extended. It is - * resolved in the same manner as type_name. - */ - extendee: string; - /** - * 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. - * TODO(kenton): Base-64 encode? - */ - defaultValue: string; - /** - * 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; - /** - * 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; - 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; -} - -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; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface EnumDescriptorProto { - $type: "google.protobuf.EnumDescriptorProto"; - name: string; - 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; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - $type: "google.protobuf.EnumValueDescriptorProto"; - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - $type: "google.protobuf.ServiceDescriptorProto"; - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface MethodDescriptorProto { - $type: "google.protobuf.MethodDescriptorProto"; - name: string; - /** - * 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; - outputType: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - clientStreaming: boolean; - /** Identifies if server streams multiple server messages */ - serverStreaming: boolean; -} - -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; - /** - * 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; - /** - * 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; - /** - * This option does nothing. - * - * @deprecated - */ - javaGenerateEqualsAndHash: boolean; - /** - * 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; - optimizeFor: FileOptions_OptimizeMode; - /** - * 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; - /** - * 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; - javaGenericServices: boolean; - pyGenericServices: boolean; - phpGenericServices: boolean; - /** - * 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; - /** - * Enables the use of arenas for the proto messages in this file. This applies - * only to generated classes for C++. - */ - ccEnableArenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objcClassPrefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharpNamespace: string; - /** - * 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; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - phpClassPrefix: string; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** 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; - /** - * 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; - /** - * 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; - /** - * 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. - */ - lazy: boolean; - /** - * 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; - /** For Google-internal migration only. Do not use. */ - weak: boolean; - /** 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; - /** - * 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; - /** 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; - /** 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; - /** 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; - idempotencyLevel: MethodOptions_IdempotencyLevel; - /** 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; - positiveIntValue: Long; - negativeIntValue: Long; - doubleValue: number; - stringValue: Uint8Array; - aggregateValue: string; -} - -/** - * 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], ["qux", false] } represents - * "foo.(bar.baz).qux". - */ -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. 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 qux. - * // - * // Another line attached to qux. - * optional double qux = 4; - * - * // Detached comment for corge. This is not leading or trailing comments - * // to qux 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; - trailingComments: string; - 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; - /** - * Identifies the starting offset in bytes in the generated code - * that relates to the identified object. - */ - begin: number; - /** - * 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; -} - -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 : new _m0.Reader(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: - message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileDescriptorSet { - return { - $type: FileDescriptorSet.$type, - file: Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) : [] - }; - }, - - toJSON(message: FileDescriptorSet): unknown { - const obj: any = {}; - if (message.file) { - obj.file = message.file.map(e => (e ? FileDescriptorProto.toJSON(e) : undefined)); - } else { - obj.file = []; - } - return obj; - }, - - 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 !== "") { - writer.uint32(10).string(message.name); - } - if (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 !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.package = reader.string(); - break; - case 3: - message.dependency.push(reader.string()); - break; - case 10: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.publicDependency.push(reader.int32()); - } - } else { - message.publicDependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weakDependency.push(reader.int32()); - } - } else { - message.weakDependency.push(reader.int32()); - } - break; - case 4: - message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileDescriptorProto { - return { - $type: FileDescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - package: isSet(object.package) ? String(object.package) : "", - dependency: Array.isArray(object?.dependency) ? object.dependency.map((e: any) => String(e)) : [], - publicDependency: Array.isArray(object?.publicDependency) ? object.publicDependency.map((e: any) => Number(e)) : [], - weakDependency: Array.isArray(object?.weakDependency) ? object.weakDependency.map((e: any) => Number(e)) : [], - messageType: Array.isArray(object?.messageType) ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) : [], - enumType: Array.isArray(object?.enumType) ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) : [], - service: Array.isArray(object?.service) ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) : [], - extension: 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) ? String(object.syntax) : "" - }; - }, - - toJSON(message: FileDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.package !== undefined && (obj.package = message.package); - if (message.dependency) { - obj.dependency = message.dependency.map(e => e); - } else { - obj.dependency = []; - } - if (message.publicDependency) { - obj.publicDependency = message.publicDependency.map(e => Math.round(e)); - } else { - obj.publicDependency = []; - } - if (message.weakDependency) { - obj.weakDependency = message.weakDependency.map(e => Math.round(e)); - } else { - obj.weakDependency = []; - } - if (message.messageType) { - obj.messageType = message.messageType.map(e => (e ? DescriptorProto.toJSON(e) : undefined)); - } else { - obj.messageType = []; - } - if (message.enumType) { - obj.enumType = message.enumType.map(e => (e ? EnumDescriptorProto.toJSON(e) : undefined)); - } else { - obj.enumType = []; - } - if (message.service) { - obj.service = message.service.map(e => (e ? ServiceDescriptorProto.toJSON(e) : undefined)); - } else { - obj.service = []; - } - if (message.extension) { - obj.extension = message.extension.map(e => (e ? FieldDescriptorProto.toJSON(e) : undefined)); - } else { - obj.extension = []; - } - message.options !== undefined && (obj.options = message.options ? FileOptions.toJSON(message.options) : undefined); - message.sourceCodeInfo !== undefined && (obj.sourceCodeInfo = message.sourceCodeInfo ? SourceCodeInfo.toJSON(message.sourceCodeInfo) : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - 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 !== "") { - 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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - return { - $type: DescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - field: Array.isArray(object?.field) ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) : [], - extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) : [], - nestedType: Array.isArray(object?.nestedType) ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) : [], - enumType: Array.isArray(object?.enumType) ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) : [], - extensionRange: Array.isArray(object?.extensionRange) ? object.extensionRange.map((e: any) => DescriptorProto_ExtensionRange.fromJSON(e)) : [], - oneofDecl: Array.isArray(object?.oneofDecl) ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) : [], - options: isSet(object.options) ? MessageOptions.fromJSON(object.options) : undefined, - reservedRange: Array.isArray(object?.reservedRange) ? object.reservedRange.map((e: any) => DescriptorProto_ReservedRange.fromJSON(e)) : [], - reservedName: Array.isArray(object?.reservedName) ? object.reservedName.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: DescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - if (message.field) { - obj.field = message.field.map(e => (e ? FieldDescriptorProto.toJSON(e) : undefined)); - } else { - obj.field = []; - } - if (message.extension) { - obj.extension = message.extension.map(e => (e ? FieldDescriptorProto.toJSON(e) : undefined)); - } else { - obj.extension = []; - } - if (message.nestedType) { - obj.nestedType = message.nestedType.map(e => (e ? DescriptorProto.toJSON(e) : undefined)); - } else { - obj.nestedType = []; - } - if (message.enumType) { - obj.enumType = message.enumType.map(e => (e ? EnumDescriptorProto.toJSON(e) : undefined)); - } else { - obj.enumType = []; - } - if (message.extensionRange) { - obj.extensionRange = message.extensionRange.map(e => (e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined)); - } else { - obj.extensionRange = []; - } - if (message.oneofDecl) { - obj.oneofDecl = message.oneofDecl.map(e => (e ? OneofDescriptorProto.toJSON(e) : undefined)); - } else { - obj.oneofDecl = []; - } - message.options !== undefined && (obj.options = message.options ? MessageOptions.toJSON(message.options) : undefined); - if (message.reservedRange) { - obj.reservedRange = message.reservedRange.map(e => (e ? DescriptorProto_ReservedRange.toJSON(e) : undefined)); - } else { - obj.reservedRange = []; - } - if (message.reservedName) { - obj.reservedName = message.reservedName.map(e => e); - } else { - obj.reservedName = []; - } - return obj; - }, - - 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 !== 0) { - writer.uint32(8).int32(message.start); - } - if (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 : new _m0.Reader(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: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto_ExtensionRange { - return { - $type: DescriptorProto_ExtensionRange.$type, - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - options: isSet(object.options) ? ExtensionRangeOptions.fromJSON(object.options) : undefined - }; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - message.options !== undefined && (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); - return obj; - }, - - 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 !== 0) { - writer.uint32(8).int32(message.start); - } - if (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 : new _m0.Reader(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: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto_ReservedRange { - return { - $type: DescriptorProto_ReservedRange.$type, - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0 - }; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; - }, - - 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 : new _m0.Reader(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: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - return { - $type: ExtensionRangeOptions.$type, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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 !== "") { - writer.uint32(10).string(message.name); - } - if (message.number !== 0) { - writer.uint32(24).int32(message.number); - } - if (message.label !== 1) { - writer.uint32(32).int32(message.label); - } - if (message.type !== 1) { - writer.uint32(40).int32(message.type); - } - if (message.typeName !== "") { - writer.uint32(50).string(message.typeName); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.defaultValue !== "") { - writer.uint32(58).string(message.defaultValue); - } - if (message.oneofIndex !== 0) { - writer.uint32(72).int32(message.oneofIndex); - } - if (message.jsonName !== "") { - writer.uint32(82).string(message.jsonName); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3Optional === true) { - writer.uint32(136).bool(message.proto3Optional); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32() as any; - break; - case 5: - message.type = reader.int32() as any; - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3Optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - return { - $type: FieldDescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - number: isSet(object.number) ? 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) ? String(object.typeName) : "", - extendee: isSet(object.extendee) ? String(object.extendee) : "", - defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", - oneofIndex: isSet(object.oneofIndex) ? Number(object.oneofIndex) : 0, - jsonName: isSet(object.jsonName) ? String(object.jsonName) : "", - options: isSet(object.options) ? FieldOptions.fromJSON(object.options) : undefined, - proto3Optional: isSet(object.proto3Optional) ? Boolean(object.proto3Optional) : false - }; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); - message.label !== undefined && (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.typeName !== undefined && (obj.typeName = message.typeName); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.defaultValue !== undefined && (obj.defaultValue = message.defaultValue); - message.oneofIndex !== undefined && (obj.oneofIndex = Math.round(message.oneofIndex)); - message.jsonName !== undefined && (obj.jsonName = message.jsonName); - message.options !== undefined && (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); - message.proto3Optional !== undefined && (obj.proto3Optional = message.proto3Optional); - return obj; - }, - - 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 !== "") { - 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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.options = OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofDescriptorProto { - return { - $type: OneofDescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - options: isSet(object.options) ? OneofOptions.fromJSON(object.options) : undefined - }; - }, - - toJSON(message: OneofDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); - return obj; - }, - - 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 !== "") { - 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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - return { - $type: EnumDescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - value: Array.isArray(object?.value) ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) : [], - options: isSet(object.options) ? EnumOptions.fromJSON(object.options) : undefined, - reservedRange: Array.isArray(object?.reservedRange) ? object.reservedRange.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromJSON(e)) : [], - reservedName: Array.isArray(object?.reservedName) ? object.reservedName.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: EnumDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - if (message.value) { - obj.value = message.value.map(e => (e ? EnumValueDescriptorProto.toJSON(e) : undefined)); - } else { - obj.value = []; - } - message.options !== undefined && (obj.options = message.options ? EnumOptions.toJSON(message.options) : undefined); - if (message.reservedRange) { - obj.reservedRange = message.reservedRange.map(e => (e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined)); - } else { - obj.reservedRange = []; - } - if (message.reservedName) { - obj.reservedName = message.reservedName.map(e => e); - } else { - obj.reservedName = []; - } - return obj; - }, - - 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 !== 0) { - writer.uint32(8).int32(message.start); - } - if (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 : new _m0.Reader(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: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - return { - $type: EnumDescriptorProto_EnumReservedRange.$type, - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0 - }; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; - }, - - fromPartial, 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 !== "") { - writer.uint32(10).string(message.name); - } - if (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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueDescriptorProto { - return { - $type: EnumValueDescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - number: isSet(object.number) ? Number(object.number) : 0, - options: isSet(object.options) ? EnumValueOptions.fromJSON(object.options) : undefined - }; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); - message.options !== undefined && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); - return obj; - }, - - 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 !== "") { - 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 : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceDescriptorProto { - return { - $type: ServiceDescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - method: 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 = {}; - message.name !== undefined && (obj.name = message.name); - if (message.method) { - obj.method = message.method.map(e => (e ? MethodDescriptorProto.toJSON(e) : undefined)); - } else { - obj.method = []; - } - message.options !== undefined && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); - return obj; - }, - - 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 !== "") { - writer.uint32(10).string(message.name); - } - if (message.inputType !== "") { - writer.uint32(18).string(message.inputType); - } - if (message.outputType !== "") { - writer.uint32(26).string(message.outputType); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.clientStreaming === true) { - writer.uint32(40).bool(message.clientStreaming); - } - if (message.serverStreaming === true) { - writer.uint32(48).bool(message.serverStreaming); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - return { - $type: MethodDescriptorProto.$type, - name: isSet(object.name) ? String(object.name) : "", - inputType: isSet(object.inputType) ? String(object.inputType) : "", - outputType: isSet(object.outputType) ? String(object.outputType) : "", - options: isSet(object.options) ? MethodOptions.fromJSON(object.options) : undefined, - clientStreaming: isSet(object.clientStreaming) ? Boolean(object.clientStreaming) : false, - serverStreaming: isSet(object.serverStreaming) ? Boolean(object.serverStreaming) : false - }; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.inputType !== undefined && (obj.inputType = message.inputType); - message.outputType !== undefined && (obj.outputType = message.outputType); - message.options !== undefined && (obj.options = message.options ? MethodOptions.toJSON(message.options) : undefined); - message.clientStreaming !== undefined && (obj.clientStreaming = message.clientStreaming); - message.serverStreaming !== undefined && (obj.serverStreaming = message.serverStreaming); - return obj; - }, - - 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: false, - 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 !== "") { - writer.uint32(10).string(message.javaPackage); - } - if (message.javaOuterClassname !== "") { - writer.uint32(66).string(message.javaOuterClassname); - } - if (message.javaMultipleFiles === true) { - writer.uint32(80).bool(message.javaMultipleFiles); - } - if (message.javaGenerateEqualsAndHash === true) { - writer.uint32(160).bool(message.javaGenerateEqualsAndHash); - } - if (message.javaStringCheckUtf8 === true) { - writer.uint32(216).bool(message.javaStringCheckUtf8); - } - if (message.optimizeFor !== 1) { - writer.uint32(72).int32(message.optimizeFor); - } - if (message.goPackage !== "") { - writer.uint32(90).string(message.goPackage); - } - if (message.ccGenericServices === true) { - writer.uint32(128).bool(message.ccGenericServices); - } - if (message.javaGenericServices === true) { - writer.uint32(136).bool(message.javaGenericServices); - } - if (message.pyGenericServices === true) { - writer.uint32(144).bool(message.pyGenericServices); - } - if (message.phpGenericServices === true) { - writer.uint32(336).bool(message.phpGenericServices); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.ccEnableArenas === true) { - writer.uint32(248).bool(message.ccEnableArenas); - } - if (message.objcClassPrefix !== "") { - writer.uint32(290).string(message.objcClassPrefix); - } - if (message.csharpNamespace !== "") { - writer.uint32(298).string(message.csharpNamespace); - } - if (message.swiftPrefix !== "") { - writer.uint32(314).string(message.swiftPrefix); - } - if (message.phpClassPrefix !== "") { - writer.uint32(322).string(message.phpClassPrefix); - } - if (message.phpNamespace !== "") { - writer.uint32(330).string(message.phpNamespace); - } - if (message.phpMetadataNamespace !== "") { - writer.uint32(354).string(message.phpMetadataNamespace); - } - if (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 : new _m0.Reader(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: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32() as any; - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - return { - $type: FileOptions.$type, - javaPackage: isSet(object.javaPackage) ? String(object.javaPackage) : "", - javaOuterClassname: isSet(object.javaOuterClassname) ? String(object.javaOuterClassname) : "", - javaMultipleFiles: isSet(object.javaMultipleFiles) ? Boolean(object.javaMultipleFiles) : false, - javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? Boolean(object.javaGenerateEqualsAndHash) : false, - javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 1, - goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", - ccGenericServices: isSet(object.ccGenericServices) ? Boolean(object.ccGenericServices) : false, - javaGenericServices: isSet(object.javaGenericServices) ? Boolean(object.javaGenericServices) : false, - pyGenericServices: isSet(object.pyGenericServices) ? Boolean(object.pyGenericServices) : false, - phpGenericServices: isSet(object.phpGenericServices) ? Boolean(object.phpGenericServices) : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - ccEnableArenas: isSet(object.ccEnableArenas) ? Boolean(object.ccEnableArenas) : false, - objcClassPrefix: isSet(object.objcClassPrefix) ? String(object.objcClassPrefix) : "", - csharpNamespace: isSet(object.csharpNamespace) ? String(object.csharpNamespace) : "", - swiftPrefix: isSet(object.swiftPrefix) ? String(object.swiftPrefix) : "", - phpClassPrefix: isSet(object.phpClassPrefix) ? String(object.phpClassPrefix) : "", - phpNamespace: isSet(object.phpNamespace) ? String(object.phpNamespace) : "", - phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? String(object.phpMetadataNamespace) : "", - rubyPackage: isSet(object.rubyPackage) ? String(object.rubyPackage) : "", - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.javaPackage !== undefined && (obj.javaPackage = message.javaPackage); - message.javaOuterClassname !== undefined && (obj.javaOuterClassname = message.javaOuterClassname); - message.javaMultipleFiles !== undefined && (obj.javaMultipleFiles = message.javaMultipleFiles); - message.javaGenerateEqualsAndHash !== undefined && (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); - message.javaStringCheckUtf8 !== undefined && (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); - message.optimizeFor !== undefined && (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); - message.goPackage !== undefined && (obj.goPackage = message.goPackage); - message.ccGenericServices !== undefined && (obj.ccGenericServices = message.ccGenericServices); - message.javaGenericServices !== undefined && (obj.javaGenericServices = message.javaGenericServices); - message.pyGenericServices !== undefined && (obj.pyGenericServices = message.pyGenericServices); - message.phpGenericServices !== undefined && (obj.phpGenericServices = message.phpGenericServices); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.ccEnableArenas !== undefined && (obj.ccEnableArenas = message.ccEnableArenas); - message.objcClassPrefix !== undefined && (obj.objcClassPrefix = message.objcClassPrefix); - message.csharpNamespace !== undefined && (obj.csharpNamespace = message.csharpNamespace); - message.swiftPrefix !== undefined && (obj.swiftPrefix = message.swiftPrefix); - message.phpClassPrefix !== undefined && (obj.phpClassPrefix = message.phpClassPrefix); - message.phpNamespace !== undefined && (obj.phpNamespace = message.phpNamespace); - message.phpMetadataNamespace !== undefined && (obj.phpMetadataNamespace = message.phpMetadataNamespace); - message.rubyPackage !== undefined && (obj.rubyPackage = message.rubyPackage); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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 ?? false; - 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 === true) { - writer.uint32(8).bool(message.messageSetWireFormat); - } - if (message.noStandardDescriptorAccessor === true) { - writer.uint32(16).bool(message.noStandardDescriptorAccessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.mapEntry === true) { - 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 : new _m0.Reader(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: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - return { - $type: MessageOptions.$type, - messageSetWireFormat: isSet(object.messageSetWireFormat) ? Boolean(object.messageSetWireFormat) : false, - noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) ? Boolean(object.noStandardDescriptorAccessor) : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); - message.noStandardDescriptorAccessor !== undefined && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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, - 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 !== 0) { - writer.uint32(8).int32(message.ctype); - } - if (message.packed === true) { - writer.uint32(16).bool(message.packed); - } - if (message.jstype !== 0) { - writer.uint32(48).int32(message.jstype); - } - if (message.lazy === true) { - writer.uint32(40).bool(message.lazy); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.weak === true) { - 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 : new _m0.Reader(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: - message.ctype = reader.int32() as any; - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32() as any; - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - return { - $type: FieldOptions.$type, - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, - packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, - lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - weak: isSet(object.weak) ? Boolean(object.weak) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: FieldOptions): unknown { - const obj: any = {}; - message.ctype !== undefined && (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); - message.packed !== undefined && (obj.packed = message.packed); - message.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); - message.lazy !== undefined && (obj.lazy = message.lazy); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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.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 : new _m0.Reader(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: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - return { - $type: OneofOptions.$type, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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 === true) { - writer.uint32(16).bool(message.allowAlias); - } - if (message.deprecated === true) { - 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 : new _m0.Reader(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: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - return { - $type: EnumOptions.$type, - allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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 === true) { - 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 : new _m0.Reader(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: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - return { - $type: EnumValueOptions.$type, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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 === true) { - 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 : new _m0.Reader(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: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - return { - $type: ServiceOptions.$type, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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 === true) { - writer.uint32(264).bool(message.deprecated); - } - if (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 : new _m0.Reader(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: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32() as any; - break; - case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - return { - $type: MethodOptions.$type, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : 0, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] - }; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotencyLevel !== undefined && (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel)); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map(e => (e ? UninterpretedOption.toJSON(e) : undefined)); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - 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(), - 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 !== "") { - writer.uint32(26).string(message.identifierValue); - } - if (!message.positiveIntValue.isZero()) { - writer.uint32(32).uint64(message.positiveIntValue); - } - if (!message.negativeIntValue.isZero()) { - writer.uint32(40).int64(message.negativeIntValue); - } - if (message.doubleValue !== 0) { - writer.uint32(49).double(message.doubleValue); - } - if (message.stringValue.length !== 0) { - writer.uint32(58).bytes(message.stringValue); - } - if (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 : new _m0.Reader(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: - message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64() as Long; - break; - case 5: - message.negativeIntValue = reader.int64() as Long; - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - return { - $type: UninterpretedOption.$type, - name: Array.isArray(object?.name) ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) : [], - identifierValue: isSet(object.identifierValue) ? 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) ? Number(object.doubleValue) : 0, - stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(), - aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "" - }; - }, - - toJSON(message: UninterpretedOption): unknown { - const obj: any = {}; - if (message.name) { - obj.name = message.name.map(e => (e ? UninterpretedOption_NamePart.toJSON(e) : undefined)); - } else { - obj.name = []; - } - message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); - message.positiveIntValue !== undefined && (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()); - message.negativeIntValue !== undefined && (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString()); - message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); - message.stringValue !== undefined && (obj.stringValue = base64FromBytes(message.stringValue !== undefined ? message.stringValue : new Uint8Array())); - message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); - return obj; - }, - - 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(); - 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 === true) { - writer.uint32(16).bool(message.isExtension); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - return { - $type: UninterpretedOption_NamePart.$type, - namePart: isSet(object.namePart) ? String(object.namePart) : "", - isExtension: isSet(object.isExtension) ? Boolean(object.isExtension) : false - }; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.namePart !== undefined && (obj.namePart = message.namePart); - message.isExtension !== undefined && (obj.isExtension = message.isExtension); - return obj; - }, - - 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 : new _m0.Reader(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: - message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo { - return { - $type: SourceCodeInfo.$type, - location: Array.isArray(object?.location) ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) : [] - }; - }, - - toJSON(message: SourceCodeInfo): unknown { - const obj: any = {}; - if (message.location) { - obj.location = message.location.map(e => (e ? SourceCodeInfo_Location.toJSON(e) : undefined)); - } else { - obj.location = []; - } - return obj; - }, - - 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 !== "") { - writer.uint32(26).string(message.leadingComments); - } - if (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 : new _m0.Reader(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 & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - } else { - message.path.push(reader.int32()); - } - break; - case 2: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.span.push(reader.int32()); - } - } else { - message.span.push(reader.int32()); - } - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - message.leadingDetachedComments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - return { - $type: SourceCodeInfo_Location.$type, - path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], - span: Array.isArray(object?.span) ? object.span.map((e: any) => Number(e)) : [], - leadingComments: isSet(object.leadingComments) ? String(object.leadingComments) : "", - trailingComments: isSet(object.trailingComments) ? String(object.trailingComments) : "", - leadingDetachedComments: Array.isArray(object?.leadingDetachedComments) ? object.leadingDetachedComments.map((e: any) => String(e)) : [] - }; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map(e => Math.round(e)); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map(e => Math.round(e)); - } else { - obj.span = []; - } - message.leadingComments !== undefined && (obj.leadingComments = message.leadingComments); - message.trailingComments !== undefined && (obj.trailingComments = message.trailingComments); - if (message.leadingDetachedComments) { - obj.leadingDetachedComments = message.leadingDetachedComments.map(e => e); - } else { - obj.leadingDetachedComments = []; - } - return obj; - }, - - 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 : new _m0.Reader(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: - message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GeneratedCodeInfo { - return { - $type: GeneratedCodeInfo.$type, - annotation: Array.isArray(object?.annotation) ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) : [] - }; - }, - - toJSON(message: GeneratedCodeInfo): unknown { - const obj: any = {}; - if (message.annotation) { - obj.annotation = message.annotation.map(e => (e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined)); - } else { - obj.annotation = []; - } - return obj; - }, - - 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 !== "") { - writer.uint32(18).string(message.sourceFile); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (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 : new _m0.Reader(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 & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - } else { - message.path.push(reader.int32()); - } - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GeneratedCodeInfo_Annotation { - return { - $type: GeneratedCodeInfo_Annotation.$type, - path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], - sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "", - begin: isSet(object.begin) ? Number(object.begin) : 0, - end: isSet(object.end) ? Number(object.end) : 0 - }; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map(e => Math.round(e)); - } else { - obj.path = []; - } - message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); - message.begin !== undefined && (obj.begin = Math.round(message.begin)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; - }, - - 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); - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = globalThis.atob || (b64 => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = globalThis.btoa || (bin => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach(byte => { - bin.push(String.fromCharCode(byte)); - }); - return 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 Array - ? 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 } & Record | "$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/src/protobuf/typeRegistry.ts b/src/protobuf/typeRegistry.ts deleted file mode 100644 index 82e3c70..0000000 --- a/src/protobuf/typeRegistry.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import Long from "long"; - -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 Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in Exclude]?: DeepPartial } - : Partial; diff --git a/src/stargate/index.ts b/src/stargate/index.ts index fda45d1..23fb1de 100644 --- a/src/stargate/index.ts +++ b/src/stargate/index.ts @@ -1,11 +1,10 @@ -import { MessageType, messageTypeRegistry, UnknownMessage } from "@akashnetwork/akash-api/typeRegistry"; +import { MessageType, messageTypeRegistry } from "@akashnetwork/akash-api/typeRegistry"; /** * Retrieves the Akash type registry. * @returns An array of tuples containing the type URL and the corresponding message type. */ -export const getAkashTypeRegistry: () => [string, MessageType][] = () => - Array.from(messageTypeRegistry).map(([path, type]) => [`/${path}`, type]); +export const getAkashTypeRegistry: () => [string, MessageType][] = () => Array.from(messageTypeRegistry).map(([path, type]) => [`/${path}`, type]); /** * Gets the type URL for a given message type. @@ -20,23 +19,23 @@ export const getTypeUrl: (type: MessageType) => string = type => `/${type.$type} */ export enum Message { /** Message type for creating a certificate. */ - MsgCreateCertificate = "/akash.cert.v1beta3.MsgCreateCertificate", + MsgCreateCertificate = "/akash.cert.v1.MsgCreateCertificate", /** Message type for revoking a certificate. */ - MsgRevokeCertificate = "/akash.cert.v1beta3.MsgRevokeCertificate", + MsgRevokeCertificate = "/akash.cert.v1.MsgRevokeCertificate", /** Message type for creating a deployment. */ - MsgCreateDeployment = "/akash.deployment.v1beta3.MsgCreateDeployment", + MsgCreateDeployment = "/akash.deployment.v1.MsgCreateDeployment", /** Message type for closing a deployment. */ - MsgCloseDeployment = "/akash.deployment.v1beta3.MsgCloseDeployment", + MsgCloseDeployment = "/akash.deployment.v1.MsgCloseDeployment", /** Message type for depositing into a deployment. */ - MsgDepositDeployment = "/akash.deployment.v1beta3.MsgDepositDeployment", + MsgDepositDeployment = "/akash.deployment.v1.MsgDepositDeployment", /** Message type for updating a deployment. */ - MsgUpdateDeployment = "/akash.deployment.v1beta3.MsgUpdateDeployment", + MsgUpdateDeployment = "/akash.deployment.v1.MsgUpdateDeployment", /** Message type for closing a group. */ - MsgCloseGroup = "/akash.deployment.v1beta3.MsgCloseGroup", + MsgCloseGroup = "/akash.deployment.v1.MsgCloseGroup", /** Message type for pausing a group. */ - MsgPauseGroup = "/akash.deployment.v1beta3.MsgPauseGroup", + MsgPauseGroup = "/akash.deployment.v1.MsgPauseGroup", /** Message type for starting a group. */ - MsgStartGroup = "/akash.deployment.v1beta3.MsgStartGroup", + MsgStartGroup = "/akash.deployment.v1.MsgStartGroup", /** Message type for creating a lease. */ - MsgCreateLease = "/akash.market.v1beta4.MsgCreateLease" + MsgCreateLease = "/akash.market.v1.MsgCreateLease" }